Loop for each in SAP another window

sap

#1

Hey
I need to do SAP automation.

In the SAP window with selection field (for example):
word-image-217

I click on the (i don’t know what it is :-))
word-image-218

And
I have new window with a list of names.

Question 1;
How to take the names one by one that the loop works ang gives one name each iteration (in selection field)
Question 2:
I want to skip first name (0001).

THANKS !!


#2

Did you try using DataScraping and see if it captures all that names into a DataTable?

Thanks,
Rammohan B.


#3

Hey @Rammohan91

Thank you for Your time.

This is my seq ( screen scraping )

and bug
LOG-INFO

any ideas ??
THANKS


#4

Can someone help me ??
Thanks


#5

Hi @Marcin

Could you clarify what do you want to do with the names? Do you have to do an action in the app with each particular name, or is it enough to scrap the names first to a Data Table?

As far as your error goes, please use the For Each Row activity that handles Data Tables. You can use your Data Table variable in that one directly.


#6

Hi @loginerror

For each of these names:

I want to do a specific action in a given window.

I will get some data in this way.

Thanks


#7

Okay, I simply wanted to confirm your approach.

I would proceed as follows.

  1. Try Data Scraping wizard and see if it works (it is easiest to save the output Data Table with Write Range activity to see the output)
  2. If works, you can use For Each Row with that Data Table right away to do the second part of the workflow
  3. If does not work, use Screen Scraping wizard, then Generate Data Table activity and also save to Excel to see how it looks like
  4. Use the resulting Data Table to do the second part of the workflow.

Let me know if it is helpful and if you have any issues.


#8

Hi @loginerror

Screen scraping works, however, “get visible text” can be problematic with more names. How to avoid this ??

Thanks Maciej !!


#9

Could you check with the other option “Get Full Text”?
image

If not, could you check your software for any type of export functionality? It might help if there is one.


#10

Thanks for Your time Maciej.

1.When I check “full text”, uipath doesn’t see table
This is what I received.


and next

and final
get%20full%20text%20message

  1. “Native” Screen scraping works

    and next

but

  1. How to begin interation by 5200 ??
  2. How get not visible names ??

my flowchart

Thanks !!


#11
  1. After you get the full table, you can use a For Each Row activity to loop through all items. To skip the first row, you have a few options. The easiest would be to add an If activity in the loop and use something like that for the If statement:
    row.Item("JG").ToString = "0001"
    and then doing nothing for Then and doing everything else in the Else.

  2. Just to be sure, could you test options under this button:
    image
    Maybe there is an easy way to export to a file over there, ideally a csv file or other text format.


#12

Please use Data scraping instead of Screen scraping.

image

I have worked on same kind of tables in SAP. It works fine :grinning:

Given below the link of guide for Datascraping for your reference.

Once you are done with the scraping, you can loop the datatable using For each row


#13

@vivek_Nalashaa
It does not work.
data_scraping

:frowning:

Mayby have you special settings in SAP ??


#14

Hi Maciej

export%20to%20PDF

This is export to PDF file (all names).


#15

Hi Marcin,

You need to use dynamic selector here.

  1. First use “Click” activity and indicate the value “5200”. Give continue on error as true
  2. Create a Counter variable
  3. Replace the Row ID in selector with the counter

Eg:
image
4. Perform whatever the process required in the new window
5. Increase the counter by 1, until the value is blank

So this should loop the Row until the value is null :grinning:


#16

I understand the 3rd point.
Could You picture that ??
Thanks


#17

Once you indicate the element, in selectors you can find attribute for column Id and row id. For every row the row id will increase by 1. So you need replace the row id with counter. Now you can loop each row easily.


#18

Hi @vivek_Nalashaa

I return after break to this task.

You write in your answers about the ROW ID. I can not see it. I’m using click image activity and indicatethe value “5200”. I create a counter and it stop. Click image does not have selector. An exemplary flowchart would be useful.

Thank for Your time.


#19

Hi @loginerror

Back to the topic.
If i know how many list items are is it is possible to counterthe passage of each item?

pics_1

He would have to remember the previous position and start the next loop.
Thanks Maciej !


#20

This might be helpful. You could:

  1. Scrap first “page” of items
  2. Send hotkey, for example page down
  3. Scrap second “page” of items and append it to the first one
  4. Remove duplicates

You can use the total counter as a boundary condition. Basically, add the number of visible (thus scraped) rows to a counter and have a While Do loop that will keep repeating if your counter is smaller than the total number of records.