SAP Help Home SAP Intelligent RPA Help Portal SAP Intelligent RPA Community

Module - BAPI

Activities for BAPI execution

Activities

Execute BAPI

Validate passed parameters and execute the BAPI.


Technical Name Type Minimal Agent Version
executeBAPI synchronous WIN-2.0.27

Input Parameters:

Name Type Attributes Default Description
BAPIName string mandatory Required BAPI name.
SAPConnection any mandatory Required SAP connection details.
Imports any optional BAPI import parameters.
Tables any optional BAPI table parameters.
Changing any optional BAPI changing parameters.
Outputs string optional Comma separated output parameters.
ValidationRequired boolean optional true Parameter to enable the BAPI parameter validation: set to true by default. Set this parameter to false if you want to skip the BAPI parameter validation.

Output Parameters:

Name Type Description
BAPIResponse any (JSON object ): returned values from BAPI execution.

Sample Code:

irpa_bapi.BAPI.executeBAPI();

Errors:

Error Class Package Description
BAPIRFCException irpa_bapi Exception due to RFC failure
BAPIInvalidPrameterException irpa_bapi Exception due to invalid parameters
BAPIException irpa_bapi Exception due to failure in BAPI execution


Set SAP Connection(SSO)

Create a JSON response to set up an SSO SAP connection.


Technical Name Type Minimal Agent Version
setSAPSystemSSO synchronous WIN-2.0.27

Input Parameters:

Name Type Attributes Default Description
MessageServer string optional This is the hostname of the specific SAP application server to which all connections are opened. This parameter is only required if UseLoadBalancer is set to false.
InstanceNumber string mandatory Required instance number.
Client string mandatory Required client.
Language string mandatory Required language.
SNCName string mandatory Required SNC name.
UseLoadBalancer boolean optional false This parameter must be enabled to create a load balanced connection. By default, this parameter is set to false. If this parameter is set to true, the value for MessageServer can be skipped. The value for MessageServerHost, (SystemID or MessageServerService) and LogonGroup must be sent. If this parameter is set to false, the value for MessageServer must be sent. The value for MessageServerHost, SystemID, MessageServerService and LogonGroup can be skipped.
SystemID string optional This is the SAP system's three-letter system ID. This parameter is required if the message server service is not defined.
MessageServerHost string optional The hostname of the SAP system message server (central instance).
MessageServerService string optional This is the service name under which the message server responds to load-balancing requests. This parameter is required if the system ID is not defined.
LogonGroup string optional This parameter is used by the message server to select an application server. By default, the parameter value is "œPUBLIC".

Output Parameters:

Name Type Description
SAPConnection any (JSON object ): returned value of SAP connection detail.

Sample Code:

irpa_bapi.BAPI.setSAPSystemSSO("MessageServer","InstanceNumber","Client","Language","SNCName", "UseLoadBalancer","SystemID","MessageServerHost","MessageServerService","LogonGroup");

Errors:

Error Class Package Description
BAPIInvalidPrameterException irpa_bapi Exception due to invalid parameters


Set SAP Connection (Basic)

Create a JSON response to set up a basic SAP connection.


Technical Name Type Minimal Agent Version
setSAPSystemBasic synchronous WIN-2.0.27

Input Parameters:

Name Type Attributes Default Description
User string mandatory Required username.
Password string mandatory Required password.
MessageServer string optional This is the hostname of the specific SAP application server to which all connections are opened. This parameter is only required if UseLoadBalancer is set to false.
InstanceNumber string mandatory Required instance number.
Client string mandatory Required client.
Language string mandatory Required language.
SystemID string optional This is the SAP system'€™s three-letter system ID. This parameter is required if the message server service is not defined or if UseLoadBalancer is false.
UseLoadBalancer boolean optional false This parameter must be enabled to create a load balanced connection. By default, this parameter is set to false. If this parameter is set to true, the value for MessageServer can be skipped. The value for MessageServerHost, (SystemID or MessageServerService) and LogonGroup must be sent. If this parameter is set to false, the value for MessageServer and SystemID must be sent. The value for MessageServerHost, MessageServerService and LogonGroup can be skipped.
MessageServerHost string optional The hostname of the SAP system message server (central instance).
MessageServerService string optional This is the service name under which the message server responds to load-balancing requests. This parameter is required if the system ID is not defined.
LogonGroup string optional This parameter is used by the message server to select an application server. By default, the parameter value is "œPUBLIC".

Output Parameters:

Name Type Description
SAPConnection any (JSON object ): returned value of SAP connection detail.

Sample Code:

irpa_bapi.BAPI.setSAPSystemBasic("user","passwrd","ashost","sysnr","client","lang","sysid","UseLoadBalancer","mshost","msserv","group");

Errors:

Error Class Package Description
BAPIInvalidPrameterException irpa_bapi Exception due to invalid parameters


Set SAP Connection (Advanced)

Create a JSON response to set up a any type of connection (SSO, Basic or Custom).


Technical Name Type Minimal Agent Version
setSAPConnection synchronous WIN-2.0.27

Input Parameters:

Name Type Attributes Default Description
SNCName string optional Secure Network Communication (SNC) name of the communication partner
User string optional User name used to log in
Password string optional Password used to log in
MessageServer string optional Host name of the SAP application server to which the connection will be opened
InstanceNumber string optional Instance number of the SAP system
Client string optional Client ID of the client in which you want to log in
SystemID string optional Three-letter system ID of the SAP system
Language string optional Language used in SAP log on
MessageServerHost string optional Host name of the SAP Message Server (central instance) in the SAP System.
MessageServerService string optional Service name under which the message server responds to load-balancing requests
LogonGroup string optional This parameter is used by the message server to select an application server. By default, the parameter value is "PUBLIC"
SAPRouter string optional Parameter used to specify the route string if the connection needs to be made through a firewall via a SAP Router
SNCMode boolean optional false Selects whether the connection will be secured with SNC (secure network communication)
ConnectionType irpa_bapi.enums.ConnectionType optional SSO Defines the type of connection.

Output Parameters:

Name Type Description
SAPConnection any (JSON object ): returned value of SAP connection detail.

Sample Code:

irpa_bapi.BAPI.setSAPConnection("","");

Errors:

Error Class Package Description
BAPIInvalidPrameterException irpa_bapi Exception due to invalid parameters


Is SAP Connection Alive

Is SAP Connection Alive.


Technical Name Type Minimal Agent Version
isConnectionAlive synchronous WIN-2.0.28

Input Parameters:

Name Type Attributes Default Description
SAPConnection any mandatory Required SAP connection details.

Output Parameters:

Name Type Description
IsSapConnectionAlive boolean IsSapConnectionAlive

Sample Code:

irpa_bapi.BAPI.isConnectionAlive();

Errors:

Error Class Package Description
BAPIInvalidPrameterException irpa_bapi Exception due to invalid parameters
BAPIException irpa_bapi Exception due to failure in BAPI execution


Commit BAPI

Commit BAPI transactions.


Technical Name Type Minimal Agent Version
commitBAPI synchronous WIN-2.0.27

Input Parameters:

Name Type Attributes Default Description
SAPConnection any mandatory Required SAP connection details.

Sample Code:

irpa_bapi.BAPI.commitBAPI();



Close SAP Connection

Close an SAP connection.


Technical Name Type Minimal Agent Version
closeConnection synchronous WIN-2.0.27

Input Parameters:

Name Type Attributes Default Description
SAPConnection any mandatory Required SAP connection details.

Sample Code:

irpa_bapi.BAPI.closeConnection();