Click. Strict Selector

Hallo,

I want to click on a particular row of a table in SAP.
I have row index information and my selector looks like this:

<sap id=‘usr/tblZ_CA_MATERIAL’ tableCol=‘-1’ tableRow=‘-1’ /

All i want is to add a variable ‘rowindex’ defined as string containing value 3 (for example).

I tried :slight_smile:
tableRow=‘" + rowindex + "’ />"

But still it points the first row.

can someone help.

<sap id='usr/tblZ_CA_MATERIAL' tableCol='-1' tableRow='" + rowIndex.ToString + "' /> Try this selector expression

try this approach
In assign activity rowindex = "3" as string and then pass into selector
<sap id='usr/tblZ_CA_MATERIAL' tableCol='-1' tableRow='" + rowindex + "' />
Cheers

yeah i tried toString as well it doesnt work

That is what exactly i am doing. it doesnt work.

If you leave tableRow=‘-1’, SAP UI defaults to the first visible row.
When you try to concatenate " + rowindex + ", it might not be building a valid selector string (e.g. quotes inside quotes issue).

Replace the tableRow value with a variable placeholder.
In the properties panel, for Selector, put,
“‘(sap id=‘usr/tblZ_CA_MATERIAL’ tableCol=‘2’ tableRow=’” + rowIndex.ToString + "’ )**

Check if tableRow really changes when you click row 0, row 1, row 2, etc.
If it doesn’t change, then SAP is not exposing row index this way the selector will never work.
Cheers

yes it does. I gave 3 as default value directly and it changed.

Then edit the selector as
<sap id='usr/tblZ_CA_MATERIAL' tableCol='-1' tableRow='{{rowindex}}' />

Make sure your rowindex as String variable in assign activity and pass “3” as value

<sap id='usr/tblZ_CA_MATERIAL' tableCol='-1' tableRow='" + rowIndex.ToString + "' />
first use this in your click selector

  • rowIndex must be Int32.
    Check with Log Message that it becomes:
    <sap id='usr/tblZ_CA_MATERIAL' tableCol='-1' tableRow='3' />

If it still clicks first row → try idx instead of tableRow:
<sap id='usr/tblZ_CA_MATERIAL' tableCol='-1' idx='" + rowIndex.ToString + "' />

Hello @parnalmahavir.patni

You can try using the Click ToolBar Button activity, which is specifically designed for SAP integration. If the issue still persists, we can connect on a meeting or else please share a screenshot so I can assist you further.

Best Regards,
Asad

You can also try the Table Cell Scope activity.

It’s not working because you are selecting the header of the table. Try clicking below and see if it works.

Got your point. If you’re free then please connect on below mentioned meet link else let me know your comfortable time to connect.

Yeah below one doesnt help either it still points on the first row

Can you share the selector after clicking on the first row of the table in SAP?

idx has a validation error. the others dont work as well


after changing it to 3