SAP Intelligent RPA 2.0 – How to execute BAPI
In this blog post I would like to introduce you to the BAPI SDK which is available with the September release (2109) of SAP Intelligent RPA 2.0. I will explain how to execute a BAPI from SAP Intelligent RPA using this SDK.
Let’s start off with a brief introduction of BAPI.
What is BAPI:
BAPI is a standard interface to the business object models in SAP products. In the SAP system, BAPIs are stored as RFC (Remote function call) capable function modules in the ABAP workbench function builder.
Client programs that use BAPIs to access SAP business objects can be part of the same SAP system, part of an external system (for example, a .Net application), part of an HTTP Gateway, or part of another SAP system. To execute any BAPI user needs to pass import, table and changing parameters.
You can also refer to the detailed documentation from help.sap.com if you want more details about BAPI.
What is BAPI SDK:
The SAP BAPI SDK package is a collection of activities allowing you to automate processes in SAP system by calling BAPI. SDK package consist mainly three types of activities.
- Set and Close SAP connection
- Execute BAPI
- Commit all transaction on SAP connection
- Latest desktop agent should be installed. i.e., desktop agent of SAP Intelligent RPA 2109
- For Set SAP Connection (SSO) SDK BAPI activity, SSO (SAP Single Sign-On) must be configured on your system
Steps to follow:
Here we are going to create Purchase requisition order using “BAPI_PR_CREATE”. It has following import, table and export parameters.
We will be using PRHEADER, PRHEADERX from import parameters and PRITEM, PRITEMX from table parameters.
- Set SAP connection (Basic or SSO): Use Set SAP connection (Basic/SSO) activity to set connection. Input parameters of activity can be found under properties of sap system.
- Create parameters of BAPI: All import and changing parameters are in form of structure(object) and all table parameters are in form list of structure(object).
- Create Import data type by name Import_PR (datatype name can be anything) as shown in picture.
- Create Table data type by name Table_PR as shown in picture
- Drag and drop the Import_PR data type to create an Import_PR variable and fill the values.
- Drag and drop the Table_PR data type to create a Table_PR variable and fill the values.
- Execute BAPI with above connection and parameters: Drag and drop Execute BAPI activity and fill the input parameters.
Outputs parameter is for response of execute BAPI, user can pass comma separated parameters name. if nothing is pass in outputs then entire BAPI response will be return else provided parameters response will be returned in JSON format.
- Commit BAPI and Close Connection:
Find more information on SAP Intelligent RPA: