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:
- SAP is launched and transaction MIRO is called (Activities: SAP Logon + Login & Call transaction)
- The workflow opens an XLSX file that contains the details that need to be keyed into SAP.
- The workflow builds and fills a data table with all the details that are relevant to one specific invoice.
- 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.)
- 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.
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)
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.
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.
If everything is in order, the workflow saves the invoice and continues to build a datatable for the next invoice.
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.
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.
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-table get_columns_name='1' get_empty_columns='1' columns_name_source='Longest' />"
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.