Copy data table to clipboard / Paste to SAP

Hi,
I want to copy data table from UiPath (i don’t have it in Excel as I collect the data from different sources during the run) to SAP.
I tried to use Output Data Table + Set to Clipboard, but I have 2 issues here:

  1. Output Data Table also copies headers
  2. Set to clipboard is creating text in a format which is not recognised by SAP (it should be in separate columns).

How I can create a code/activity to copy table to clipboard? Or is there something already available for this? I found something On Microsoft site but I don’t know how to use it in UiPath:

PS. I don’t want to:

  • save data in Excel to then copy-paste it
  • fill SAP table cell by cell

There are SAP specific activities. Copy/paste isn’t a good way to enter data.

Then which of these SAP activities would you suggest for me? Because I haven’t found anything in this course which would help me with inputting the data, apart from “Type Into” cell by cell (which is a much slower, and in my opinion worse, solution)

What about the API?

https://docs.uipath.com/activities/other/latest/legacy-integrations/about-the-sap-bapi-activities-pack

our company doesn’t have API enabled for SAP. but thanks for that, I can try to suggest it for the future.

@OlaQ

Welcome to the community

Try to copy the data and paste in atext file and check what is the delimiter youa re getting for the table…we can try to construct the data using that delimiter …or in output datatable string can replace the comma with the required delimiter like tab or spaces…as needed

Cheers

Hi, delimiter that I need for SAP is tab.
Replacing comma with tab (Chr(9)) in the output string works - data is split into columns correctly.
But I still have the other issue, that “output datatable” is including headers in my output, which I don’t want.

It would be great to have this (include headers, delimiter char) as input for “output datatable” activity but I don’t think it will happen, right?

@OlaQ

We can remove the first row from output datatable and replace I believe you already solved using replace function

for removing first row use the following

str.Split({Environment.newLine},2,StringSplitOptions.None)(1)

cheers

OK, this is solving my issue, thank you @Anil_G!

1 Like

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