Extracting the Document Number and in SAP and Writing it Into Excel for the Current Row

Hello to all UiPath enthusiasts,

I would like to add more features in my robot, but can not figure out what to do. I am glad to hear out if you have any suggestions for the below,

I want to add these in the process:

  • Once an entry is succesful into SAP, I want the robot to mark that row as COMPLETED.

  • Also the SAP program gives a document number for each succesful entry. So I would like to extract this number and take it into Excel too.

Here is my whole process so far.

@sehz4d

For extraction either use sap activities or get text activity

And to write the data to excel against each row…you can either write directly to datatable for correspondingn row using assign with currentrow("ColumnName") = "Completed" instead of completed can write the required number as well and write the data back to excel after loop

If columns are not present then before loop use add data column and add the columns you need

If you want to write to excel directly then wither use for eachr ow in excel and use same as above…or for loop has index property assign a variable to it and use it in write cell to find each row correpsonding cell

Eg: "D" + (index+2).ToString

Adding 2 because 1 is header and index starts from 0

Cheers

1 Like

@Anil_G Thanks for your great reply.

1 Like

Hi @sehz4d

You can also use REFramework with queue-based approach this will provide better control and scalability.

Setting up the REFramework Structure:

Dispatcher: You will read the excel file & send all the working transaction data to queue.

Performer: By using Re-Framework.

Initialization: Configure necessary settings, initialize variables, and open applications (SAP, Excel) in the Init state.

Get Transaction Data: Get Transaction Data from queue.

Process Transaction: Process each transaction item by entering data into SAP and updating Excel in the Process Transaction state.

End Process: Finalize and perform cleanup tasks in the End Process state.

Hope this helps :slight_smile:

1 Like