Loop for each in SAP another window

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 !!

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

Thanks,
Rammohan B.

Hey @Rammohan91

Thank you for Your time.

This is my seq ( screen scraping )
flowchart

and bug
LOG-INFO

any ideas ??
THANKS

Can someone help me ??
Thanks

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.

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

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.

Hi @loginerror

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

Thanks Maciej !!

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.

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 !!

  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.

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

@Vivek_Arunagiri
It does not work.
data_scraping

:frowning:

Mayby have you special settings in SAP ??

Hi Maciej

export%20to%20PDF

This is export to PDF file (all names).

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:

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

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.

Hi @Vivek_Arunagiri

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.

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 !

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.