UiPath for SAP script automations

SAP ERP offers a wide range of tools designed for automated data processing. Some of these tools are already on the market for decades and some are relatively new and exclusive for S/4Hana or BTP scenarios.

  • SAP Batch Data Communication (BDC) is a traditional data transfer technique that automates the process of entering data into SAP systems by simulating user inputs in transaction screens.
  • SAP Scripting is a capability within SAP systems that allows for the automation of user interactions with SAP GUI screens through scripts, facilitating the execution of repetitive tasks and data entry processes.
  • SAP Legacy System Migration Workbench (LSMW) is a tool designed to facilitate the easy and efficient migration of data from non-SAP systems into SAP systems, offering various methods for data import including direct input, batch input, and IDoc processing.
  • The S/4HANA Template Upload Apps like Migrate Your Data, Mass Maintenance of Business Partners, Upload General Journal Entries are specialized applications within SAP S/4HANA that facilitate the efficient importation of data using predefined templates, streamlining the process of populating the system with necessary information for various business scenarios.
  • S/4HANA Build Process Automation refers to the suite of tools and technologies in SAP S/4HANA that automate and streamline the development, configuration, and deployment processes, enhancing efficiency and reducing manual efforts in building and maintaining SAP applications.

In this example we want to make use of SAP script access by using UiPath Studio for creating Buisness Partners in an automated way.

UiPath is a global software company that specializes in Robotic Process Automation (RPA) technology, providing tools for automating repetitive office tasks by mimicking user interactions with various software applications, thereby enhancing efficiency and productivity.

There are certain requirements that needs to be adjusted to run scripts on Sap. Sap will notice that a script program is trying to access. There is a warning message that will appear. First of all the client side scripiting needs to be enabled:

Furthermore there is a server side scripting setting that can be checked by running transaction code RZ11 (display and maintain instance profile parameters). The setting should look like this:

UiPath offers a 60 days trail access to their cloud based UiPath Studio. This software is a visual development tool for Robotic Process Automation (RPA), allowing users to create automation workflows via drag-and-drop to mimic human tasks across applications. UiPath Studio offers some useful SAP automation capabilities, including SAP GUI automation.

Initially, we use the SAP Login and Logon activities to gain access to our test system. A technical user got created to distinctly recognize the access facilitated by the scripting tool. Sequences are used to organize a linear flow of activities, allowing for the straightforward execution of tasks in a specific order.

As previously stated, our goal is to create business partners by executing transaction BP, requiring an Excel file filled with test data as the essential input for this automation.

A new sequence is established through the „Use Application/Browser“ activity, which selects a specific screen of an SAP transaction. This is done after invoking the transaction with the built-in „Call Transaction“ activity.

By using the 1) Excel Process Scope, 2) Use Excel File and 3) For Each excel row activity a Loop processing can be implemented. The Excel file can be used into the UiPath project, and through an Excel integration (plugin), the data from that worksheet can be utilized in the activities.

By using the activity „Type into“ we fill the sap dynprofields by data of the first row of that excel worksheet.  Upon clicking the save button, implementing a brief time delay ensures the subsequent activities execute properly.

In the next step we want to read the SAP status bar to report back the buisness partner number that got created for our data set. Here i encountered a minor issue by the screen detecting functions of UiPath Studio. As the business partner number will change on every loop the screen recognition isnt working anymore. This can be fixed by using the „Selection-Editor“ function. You can alter the screen recognition by using an asterisk symbol. We save the sap statusbar messagetext into an variable that we created.

This variable can be used in the next activity to write into the excel sheet that we already used as an input file. The loop ends with the button for creating a new business partner so that the second row of the excel worksheep can be processed like intended.

The outcome of the UiPath project’s test run can be evaluated by examining the output messages.

The technical user created the business partner successfully.

As mentioned, the messages from the SAP status bar were recorded back into the Excel sheet.

This entry was posted in Basis.