SAP to SAP: Copy and Paste of varying numbers

Dear Community,

I am relatively new to the world of automation and would like your help.

Is it possible to copy certain texts/numbers (these numbers can vary) in SAP with UiPath and paste them into a new SAP transaction, see screenshots.

Briefly about the manual editing process:
We copy the order number (without letters, otherwise the processing does not work) and paste it in a new SAP transaction, green mark.

If the order number is followed by “von VkOrg #### fehlt in ####”, the processing looks slightly different. “VkOrg” is placed in the field marked yellow and the number after ‘missing in’ is placed in the field marked red.

The challenge here is that the number of orders varies, sometimes there are more, sometimes fewer, and the numbers in the line “von VkOrg #### fehlt in ####” also vary.

If you have any questions, please let me know.

Many thanks in advance!
Daniel

Hello Daniel,

I think you forgot to add the screenshots.

Either way: have you tried using the “Extract data table functionality”? This way you can dynamically select the different rows, and also use the DataTable.Rows.Count attribute to check whether or not any entries exist at all.

Regarding the numbers, you should be able to use String.Replace or regular expressions (Matches activity in UiPath) to extract them if this is needed.

Either way, I believe adding the screenshots would be required to give you more specific answers, as without them, I’m just roughly guessing what the issue is.

Hello Roel,

you are right, i forgot to add the Screenshots… :man_facepalming:

I have to copy the data from the left site and paste it on the right:

My bad, sorry!

Kind regards,
Daniel

Hi @DaWi1

Yes this can be done. You need to use activity called Table extraction to extract the data from your first screen & then you will have all the data saved in the data table variable.
You can iterate over this data table & process each order no. By using activity for each row in datatable.

In the for each you can create a loop sequence which will process the order in another T-code of sap.

Hope this helps :slight_smile:

In case the extract data table doesn’t work if it’s all stored in one big text field, you will possibly have to do some string manipulation using String.Split and then iterate over the resulting string collection using a for loop.

1 Like

Hello AJ & Roel,

thanks for your replies.

I tried it with Extract Table Date and used “Indicate in SAP Easy Access” and got following error message:

image

this message appears, no matter which field I select.

Hi @DaWi1

Try using CV Screen Scope inside that use CV Extarct Table this activity.

image

Hope this helps :slight_smile:

I would recommend against CV Screen Scope, as it can return inaccurate values of text and is inconsistent. What might work instead is selecting the whole text and seperating the lines using String.Split. Strings.Split(String, String, Int32, CompareMethod) Method (Microsoft.VisualBasic) | Microsoft Learn

Usage: