SAP Data Table Extraction problem: result does not match preview, data in wrong columns

Hi there UiPath community,

I’m currently working on a process that will carry out several actions in SAP, more specifically keying in invoice details in the MIRO transaction. The process works as intended in some cases, but I noticed some erroneous results where there shouldn’t have been any, specifically when handling larger documents with a lot of rows.


Intro / Contextual information:

A simplified representation of the process and the activities used would be the following:

  1. SAP is launched and transaction MIRO is called (Activities: SAP Logon + Login & Call transaction)
  2. The workflow opens an XLSX file that contains the details that need to be keyed into SAP.
  3. The workflow builds and fills a data table with all the details that are relevant to one specific invoice.
  4. Once all the invoice lines of one specific invoice have been stored in the data table, the workflow keys in the general details first (Invoice Number / Invoice Date / our reference / Delivery fee, etc.)

  1. Afterwards the workflow extracts all the lines that are in the current Purchase order using the Extract Table Data activity. I will reference to this data table using the term ‘SAP Data Table’.
    This is the step where the erroneous results seem to originate from.


  1. Using the Lookup Data Table activity the workflow finds a match between one column of the data table built in Step 3 and one column of the SAP Data Table generated from the extraction in Step 5. If a match was found this activity will return the index of the row in which the match has been found. (If no match was found this line gets skipped)

  2. The workflow saves the returned index in a variable. This variable will be used in a selector as the returned index is the TableRow in the SAP DataTable in which the invoice details need to be keyed into.

  3. The workflow keys the invoice details in the matched TableRow using a Type into activity with a variable selector. The workflow does this for two columns, two variable ‘type into’ activities per matched row.

  4. If everything is in order, the workflow saves the invoice and continues to build a datatable for the next invoice.


The problem:

The problem only presents itself when working with rather large documents. A large invoice document will have a data table in SAP of similarly large size, given that there are a lot of data rows that need to be completed.

However, the workflow seems to struggle with these larger tables and it is unable to fully complete them with the returned result that it could not match all the details of the invoice document to a row in the SAP data table. On closer inspection, some of these details should have been matched as I can clearly see the details are the same in the two data tables.

After digging around a little I was able to determine that the problem creates itself when the SAP details are extracted using the Extract table activity.
In the preview of the activity it correctly counts and displays a data table of 124 columns and 81 rows. However, during the runtime of the workflow it changes the extracted result by moving the contents of specific columns after a certain amount of rows.

To verify this I added a Write DataTable to Excel activity to the workflow to see the output of the Extract table activity during runtime. I uploaded a result below.

TestfileLeftMonitor.xlsx (29.3 KB)

In the file you can see that all the relevant details are displayed correctly for the first 18 rows of the data table. However, starting at row 19 in the table, some details are being moved to another column.
For example: the contents of column CB get moved to column CC, the contents of column CC get moved to column CD, etc.
Starting at row 37, this occurs again and some data gets moved a column to the right again, leaving them at 2 columns to the right of their correct/original place.
I designated this in the Excel file by using green for the correct column, yellow for the first displacement, orange for the second one.

I tried limiting the Extract data table activity to the columns I need, which results into a table with 7 columns and 81 rows in this case, however this was not a solution to the problem. Even with a limited amount of columns the extracted data table differs from its preview. Below you can see the preview showing the data table as it should be, and in the Excel file below you see the actual result of the extraction, in which details are moved to the wrong column and even disappeared in some cases.


TestfileLimitedColumns.xlsx (18.3 KB)

As a result, my Lookup Data table activity is unable to match all the rows of my two data tables, because the extracted SAP Data Table has had its content changed to the point where the important columns no longer contain the data they should contain.


Relevant sidenote:
The problem seems to be related to the maximum amount of rows my monitor can display in the SAP transaction.
My left monitor uses a 1920x1080 resolution and is able to display 18 rows in said transaction. The problem with the columns starts occurring at row 19 in the table.

My right monitor uses a 3840x2160 resolution and is able to display 26 rows in said transaction. When running the workflow on this monitor, the problem with the columns starts occuring at row 27 in the table.


The question:
Why does the extraction during runtime of my workflow modify the contents of my data table like this? When previewing the extraction during designtime it is able to show me the complete data table without any issues, so I’m confused as to why it can’t produce the same result during runtime.

Is there any way for me tackle this, do I need to modify the properties of the Extract table activity perhaps?
I added the current properties & settings below.

Extract metadata:
"<extract-table get_columns_name='1' get_empty_columns='1' columns_name_source='Longest' />"

Table settings:
Table settings.txt (20.5 KB)


Thank you for taking the time to read my question. Sorry for making it so long, but I felt like I needed to add as much relevant info as possible to give you a detailed view of what exactly goes wrong.

Many thanks for any clarification or help, I would really love to see a solution to the above.

Wouter

1 Like

Hello @HERRYGERS_Wouter!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff

HI @HERRYGERS_Wouter

Let me summarize the answer in 1 sentence:

If you want to extract data from SAP, you should use a proper method. Means, you are navigating to the right table within e.g. SE16N / SE16 / SM30 and then extract the data with help of standard SAP functionality.

This table you are showing above is for EDIT purpose and not suitable for DATA extraction.
image

Best regards, Lev

1 Like

Hi there @LevKushnir,

Many thanks for getting back to me on this topic!

Okay, perhaps I am taking a wrong approach, however the purpose of my workflow is indeed to edit the table in question.
The primary reason I am using the data extraction is to be able to match the data in this table to the data that is available in another table, so that when I use the Lookup Data Table activity the result gives me the index of the row in which I need to type the result I want to get into the table mentioned above.

Should I be taking a different approach to get the details I already have in another table in the correct/matching row of the table above?

Thanks again for your reply, kindly appreciated!

1 Like

As a short follow-up: is there a SAP transaction in which I can display the purchase order while having Material + VMN + EAN in a tabular format?

I have tried looking and the closest transaction I found is ME23N in which the Purchase order details are displayed, but in this transaction the VMN and EAN are not part of the tabular data, bu they are displayed in a separate field below the table.

I would need to have those two parametres as part of the table so I can extract it for further steps in the process. :slight_smile:

1 Like

HI @HERRYGERS_Wouter

I can teach you how to automate SAP with UiPath, but I cannot teach you, how to work with SAP itself :slight_smile: You know, what I mean… SAP is so huge, it requires a deep dive into your use case.

The best would be to speak to KeyUser in your company to find out where the data are stored in SAP and how to access them. In some cases SAP Queries could be pretty useful if you want to collect more information together.

The most famous SAP table is EKKO (but maybe you need something different), which give you a lot of insights into Purchase orders. So go to SE16N, open EKKO and see if it has all data you are interesting in.

Best regards, Lev

2 Likes

Hi there @LevKushnir,

Thank you for your reply again, and you’re absolutely right. I’m mostly drawing blanks here because after checking with our local key users I’ve yet to find a transaction that fully fits the needs of this use case. I did read online about SAP tables EKKO, EINE and EINA, so perhaps I can find what I need after some more research. :slight_smile:

I personally lack the permissions to access SE16N but I will inquire further with our key users to see if the tables above contain the data I am looking for.

Thank you for the insights, referring back to the original question of this thread I think I can safely say my questions have been answered, so I will go ahead and mark your response as solution. :slight_smile:

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.