Copy data from Excel to SAP

Hi all,
does anyone know how to insert Excel data into SAP? For example, a multi-row material table

Thank you

Hi @Sajuri
you can see other threads related to this topic such as Excel fields for input to SAP
Adding new users from an excel table to SAP

have you tried short cuts.? open excel copy the data(ctrl+c) you want to paste and and go to SAP and paste(ctrl+v), But as per my knowledge you have to loop through each row and insert the values.

Hi @PAD,
thank you for your answer. I read those topics.

I created For Each Row (pic 1), but I have an error message (pic 2).


Maybe UiPath can’t find the target area :thinking: why? I indicated that range

Hi @Divyashreem,

yes I tried it but SAP can’t read the data table either as .ToString if there are multiple lines in the area

Hi @Sajuri
you were almost right
the condition should be like this
For each row
–inside this first use a if condition with condition like this
String.IsNullOrEmpty(row(0) .ToString)
this means it will check whether value is null or not, and if this condition gets passed it will go to the THEN part where we can leave it simply, while if it has any value it will go to ELSE part where we can mention like this first with
–Send hot key activity with key tab and use as many as needed until it reaches the field where you want to enter the text.
–Then still being inside the ELSE part, next to the above the send hot key activity use a type into activity with value like this row(0).ToString
This will work for sure
and the reason why it didn’t work the value PNsExcel has not value in it, kindly check before passing to the For each row loop and that can be done by using output datatable activity before the for each row loop where input is datatable PNsExcel and output will be type string, next use a write line activity and pass the above obtained string variable as input, then use this for each row loop
If there is any value in the write line activity, then we are good, else we need to check with the value in the PNsExcel datatable

Hope this would help you
Cheers @Sajuri

1 Like

Yes, you have to loop through the table and enter the values row by row.

but the range of rows varies. Sometimes the order for one material (one line) is sometimes more

you can use Build data table and modify the data as per you requirement and use that table to enter the values to SAP.

I don’t know what I did but it works :smiley:
I putmessage box before For Each Row. The message box says nothing to me, but Material and Qty are written :smiley:
I’m confused :smiley:

1 Like

Great, any issues still buddy
Cheers @Sajuri

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