Iterate through each line with double click in SAP

Hi there

Goal: I want to double click each line (the ones with black lines). Each line then leads me to a similar window where the same process will be necessary. The number of lines varies.

What I have done so far: I have managed to get a correct count of the lines through creating a data table. My idea was read the data table, getting the number of lines and then clicking each corresponding line in SAP. I have also passed a variable in the selector but Uipath only clicks one line (using a single click for testing purposes).

Anyone have any ideas? Your help would be greatly appreciated.

Thanks

Sergio

UntitledSAP.xaml (13.9 KB)

Did you checked the selector for each of the row manually using UiExplorer? Are you sure that only ‘Rowstart’ variable value within the selector changes and the whole selector stays intact?

Thanks,
Rammohan B.

Yes. The variable within the selector is the only one that changes because it contains the row number.

I have in the meantime managed to get it to iterate every line but it doesn’t want to stop at 3 (in this case). It wants to find another line that doesn’t exist. I was trying to implement a counter but am having a hard time implementing this.

Thanks for the reply.

If you are still facing issue with this, i would suggest you to also try ‘Find Children’ activity. Since you would like to click on every row, identify your table as the selector for the activity and then the row selector as the Filter selector. Using the for each again you should be able to iterate through each one of the child elements(i.e.) rows identified.

Let me know if you need any help on that.

Thanks,
Rammohan B.

Hi Rammohan

Thanks for the reply but I’m not sure how to implement your solution. I’m not familiar with that activity and I’m not sure where I should place it.

Thanks

I believe I have solved this. Used an If activity and and basically said to loop if Rowstart is >= Rownumber.

Thanks for your help.

Great.:slight_smile: Check this thread just in case you would like to see the way to implement a table using Find Children activity.

Thanks,
Rammohan B.

Thanks :+1:

1 Like

Hi Rammohan,
I also have some issues with the table in SAP. I tried using Find Children activity, but i don’t seem to get any selector that has rownumber or something similar. instead I get a selector that looks like this:
<sap id=‘usr/sub/1[0,0]/sub/1/2[0,0]’ />

I tried to replace this 1 (as i assumed that this is the row number) with counter on the following ways:

<sap id=‘usr/sub/’“+counter.ToString+”‘[0,0]/sub/1/2[0,0]’ />
or
<sap id=‘usr/sub/"’+counter.ToString+‘"[0,0]/sub/1/2[0,0]’ />
and I always get an error that my selector is syntaxically invalid…

Can you please please help me in this matter?
thank you very much…

Can’t confirm if you selector is indicating the correct one or not however for the syntax you should use it as below,

"<sap id=‘usr/sub/" +counter.ToString+ "[0,0]/sub/1/2[0,0]’ />"

Thanks,
Rammohan B.

1 Like

Thank you very much! This is the right syntax now.
Can you also check if I put the other characters instead of 3 right: (I assume there may be a Problem):

This is the original one:
wnd app='saplogon.exe' cls='#32770' title='QEK(1)/100 Kontonummer des Debitors 1 Eintrag' />
<sap id='usr/sub/1[0,0]/sub/1/2[0,0]/sub/1/2**/3**[0,3]/chk[12,3]' />

Now I Need to replace number 3 with the Counter:

wnd app='saplogon.exe' cls='#32770' title='QEK(1)/100 Kontonummer des Debitors *' />
<sap id='usr/sub/1[0,0]/sub/1/2[0,0]/sub/1/2/" +Counter.ToString+ “[0,” + Counter.ToString+ “]/chk[12,” + Counter.ToString + "]' />

Thank you!!!

Instead can you attach a screenshot of these selector. It would be more readable. I am seeing some * characters not sure if your selector is supposed to contain that.

Thanks,
Rammohan B.


I made a Screenshot of both - the activity and selector.
In the above case - Robot perfectly recognizes the selector and I get the right value…

Now what I did: (I replaced just the number 3 - as it is dynamically changing - like a row number), and Robot cannot find it anymore…
I checked my Counter and it equals 3 - so at least for the first value in the table it should work-. but no :(((

Since you are using parameters for the selector, just do not open the selector editor. Instead paste it as a string within the property window.

Thanks,
Rammohan B.

1 Like

WOW! IT WORKS! THANK YOUUUUUUUUUUU!

1 Like

Hello,
In my case this works when table rows are visible but i have multiple rows and some arent visible on screen so if i pass a higher number of table row no. it is clicking random.


selector:

wnd app=‘saplogon.exe’ cls=‘SAP_FRONTEND_SESSION’ title=‘Create TD Third Party: Overview’ />
<sap id=‘usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/tblSAPMV45ATCTRL_U_ERF_AUFTRAG’ tableCol=‘1’ tableRow=‘“+inc_count+”’ /