Knowledge Document: SAP Application Server RFC Connection with UiPath

The attached knowledge document describes various technical communication possibilities between an SAP back-end system and UiPath. The calls bases on the RFC interface of the SAP system. The document describes the direct use of RFC calls as well as BAPI and ABAP usage.
It is a structured collection of my posts on this topic here in the UiPath Forum.
The target audience of this document are Citizen Developer and RPA Developer who needs to connect to SAP back-end via RFC.
These approaches to use RFM, BAPI and ABAP with UiPath offers a wide range of possibilities to execute functions or programs in an SAP back-end system. That allows a very high degree of technical integration of UiPath workflows. As well it allows SAP automation on a technical level via RFC calls to be easily implemented, for many use cases with high performance.

SAPApplicationServerRFCConnectionWithUiPath_Public.pdf (2.1 MB)

Version history:

  • 1.00 from 01.11.2020
    Initial document creation
  • 1.01 from 12.12.2020
    Table with ABAP data types added
  • 1.02 from 22.03.2021
    BAPI source and explanation about DATS added
  • 1.03 from 03.04.2021
    Restructuring, explanation about leading zeros and how to find an RFM added
  • 1.04 from 04.04.2021
    ABAP example in Search via Description added, remove information about the Data Modeller because it is obsolete and new links in the List of References added
  • 1.05 from 01.05.2021
    List of interesting transaction codes, tables, RFMs and programs added, Using System Trace to Monitor RFC Activities added, Debug ABAP Code from BAPI corrected, Modify XAML to use Installed NCo added

6 Likes

Excellent work! Some years ago this would have saved me days of investigation and experiments. In the end it didnt work out because my company didnt give us developers access to the RFC functions on the productive SAP systems. But anyway - the way you describe it is the way automation with SAP and UIPath should be done.

1 Like

@moenk

Thank you very much Thomas :grinning:

@StefanSchnell This looks like a Master Thesis for SAP RFC Automation world!

Love it! :heart:

Thank you very much!

Lev

2 Likes

Also many thanks to you @LevKushnir :slightly_smiling_face:

Thanks for this, Stefan. This is really helpful, I had a small follow up question, more on the network side.

For UiPath BAPI calls, is there any specific network port that needs to be enabled, apart from 443.

Sorry, if the question is too naive, would appreciate any help from the experts here. I was also thinking to start a separate topic, but thought let me try here first.

1 Like

@debduttamohanty

Hello Debdutta,
welcome at the UiPath Community and thanks for your response.

Your question is great. The SAP infrastructure offers many TCP/IP ports. You can find the whole list of all SAP ports here. For CPIC and RFC communication is the range of 33xx (3300 to 3399) available. xx is your system number. You can detect your system number with the function module GET_SYSTEM_NUMBER with TAC SE37. Is your system number 10 your port is 3310.

image

In my case it is 00 so my port is 3300.

But it is not necessary to enable it. All you have to do is to add it in your drivers\etc\services file like this: sapgw10 3310/tcp. But normally the SAP GUI for Windows installation does this automatically.

Best regards
Stefan

1 Like

Thank you very much Stefan. This is clear now, we will get in touch with the BASIS admin to confirm this.

1 Like