How to iterate over or extract an SAP table that is of category Structured

datatable
sap

#1

Hello all

I read the “How to ask a good question” article which speaks of searching the forum for a similar question first. I suppose this question is very much like “Extract Structured data?” in the HowTo section, see Link. However there is no reply at all to it.

The situation :
I need to perform actions on certain rows of a table. The table is structured (I heard this can cause issues). I will have to open a certain row and perform further actions. Then I have to move on to the next row.

My idea :
As far as I have been able to figure out, perhaps it’s best to export the list to Excel, read it in as a datatable and then try to find the correct line in the SAP window based on document or assignment number (or some other identifier).

What I hope :
I hope there is another way of doing this that I am not aware of. Is it possible to iterate over a structured SAP table without extracting it?

If not, what is the best way of extracting it? It’s a large table with over 4000 rows.

MCVE :
My apologies, there is no MCVE as I am asking if it is possible in the first place (iterate over structured table) and if not, how to reliably extract the table into a datatable. I suppose it’s more of a theoretical question and not a code sample question.

UiPath version :
I’m using UiPath Studio 2017.1.6522 Community Edition

Thanks for reading and hopefully contributing to the discussion :smile:


#2

@tvd: Please watch this video on SAP automation. The do extract a SAP table, hope you find it useful.


#3

@PD2 Hi Priya, thank you for the reply. I had a look but this doesn’t seem to work for structured tables. The selectors in SAP for structured tables only have an ID, not rows and column indexes. So there is no way to extract the whole table by performing a “Get Table Cell” and then looping over the entire table using counters.

The difference is that a structure doesn’t actually hold data it seems. More about that can be seen in this link Transparent Tables vs Structures

Since structures don’t actually hold any data UiPath can’t extract the data from the source. So the only options are OCR and exporting to Excel. From Excel it can be read into a datatable and then somehow I will have to manipulate elements in SAP. Probably by using “Double Click OCR Text”.

Is my thinking correct?


#4

@tvd: Please try this out:

Using Data scraping click on any of the cells on the table and click on finish to extract as datatable.

Let me know how it goes.


#5

Hi @PD2

Thank you for the suggestion. I tried that before but that technique doesn’t work on tables of the category “structure”. See the link I posted in my previous reply and you will find that these tables don’t actually hold any data that can be extracted. If you try to use datascraping as you suggest, you will get the following error :
SAP_structure_data_scraping

Luckily I can get the data using the export to Excel option in SAP and read the Excel file into a datatable. So by working around it that way I can get the data. But then I still need to find a reliable way to open each line in the structured table based on the row info from the datatable. This can only be done using OCR I think, and my tests show that this isn’t very reliable unfortunately.


#6

I had the same issue with a report in SAP. Some of the reports in SAP however, does not have that option to export to excel, or the export format is not good at all. In this case I suggest using screen scraping with the Native method. This will extract all the text in the report and it has a accuracy of 100%. Then you can generate a table and structure the data, allowing you to extract the data you want. Hope this helps! :slight_smile:


#7

Hi @nbjerke, thanks for the suggestion.

I gave it a try but the screen I’m working with has text above the table and the table is 4000+ rows long, so much much more than just 1 screen. The Excel export is working perfectly so I can get the data reliably already and all I have to do is read it in, no extra steps required to structure the data. It would just be nice to be able to natively iterate over the rows in SAP but that’s simply not possible for now :slight_smile:


#8

I’m having the same issue, and the excel export is unreliable / causes an error message to appear. So far, the only way I’ve found to work consistently is to export it to Firefox (IE failed because of ActiveX block settings and Chrome because the UIPath plugin gets more and more unreliable each day). Haven’t found a reliable way to perform actions once the line is properly identified though especially if said line is not visible on screen. I’ll let you know if I find a decent workaround.

Cheers
Stratum


#9

Update on this one: I was able to manipulate / read / act / data-scrape over table data switching in the settings to ALV Grid view. Have you tried that?

Cheers
Stratum


#10

Greetings Mate,
Gratitude for putting up this prolific article! You truly make everything a cake walk. Genuinely good stuff, saving time and energy.
Somebody could share the way how possible (or how it uses) to do the automation testing of a mobile app in combination: windows PC + iOS mobile phone.
Many automation software platforms support only the combination - MAC pc + iOS phone.
Is it possible to use the Windows PC + iOS phone at all?
Thanks for the help.
But nice Article Mate! Great Information! Keep up the good work!
Cheers,
aravindasha


#11

[quote=“asha, post:10, topic:20961, full:true”]
Greetings Mate,

Gratitude for putting up this prolific article! You truly make everything a cake walk. Genuinely good stuff, savingtime and energy.

Somebody could share the way how possible (or how it uses) to do the automation testing of a mobile app in combination: windows PC + iOS mobile phone.

Many automation software platforms support only the combination - MAC pc + iOS phone.

Is it possible to use the Windows PC + iOS phone at all?

Thanks for the help.

But nice Article Mate! Great Information! Keep up the good work!

Cheers,

aravindasha


#12

Hello There,

10/10 !!! Thank you for making your blogs an embodiment of perfection and simplicity. You make everything so easy to follow. Uipath Training USA

I think it’s also important to keep in mind that your approvals might come in at a rhythm that differs greatly from your logging rhythm. This might make less of a difference if you constantly log a high number of bugs but as a part-time job it basically means that you can’t count on a regular steady income. You would also have to count in sick days and holidays and certain times of the year with less work available.
Thanks a lot. This was a perfect step-by-step guide. Don’t think it could have been done better.

,Merci

Radhey