This section describes BAPI activities that help you to design automations for BAPI.
Activities
The following is the set of activities related to BAPI.
Activity Name
Description
Best Practice
Set SAP Connection (SSO)
Sets SSO (Single Sign-On) SAP connection.
You must configure SSO on your system.
To set SSO SAP connection, you must specify the values in the InstanceNumber, Client, Language, and SNCName parameter fields.
You can find all the required parameters and its values in SAP Logon Application. Open SAP Logon application and then go to Properties of the SAP system.
The following is the list of all parameters and its values that are required to set SSO SAP connection:
InstanceNumber: 36
SNCName: p/secude:CN=Q43, O=SAP-AG, C=DE
Client: 002
Language: EN
Double click on the SAP system name and then go to System > Status.
The following is the list of all parameters and its values that are non-mandatory to set SSO SAP connection:
MessageServer: ldciq43.wdf.sap.corp
It is the hostname of the specific SAP application server to which all connections are opened. This parameter is required only if UseLoadBalancer is set to false.
UseLoadBalancer: This parameter must be enabled to create load balance connection. By default, this parameter is set to false.
If this parameter is set to true,
value for MessageServer can be skipped.
value for MessageServerHost, SystemID or MessageServerService and LogonGroup must be passed.
If this parameter is set to false,
value for MessageServer must be passed.
value for MessageServerHost, SystemID or MessageServerService and LogonGroup can be skipped.
SystemID: Q43
It is the SAP system’s three-letter system ID. This parameter is required if message server service is not specified.
To get the value of SystemID field, open the SAP logon Pad, and then go to properties of the SAP system.
MessageServerHost: 1dciq43
It is the hostname of the SAP system message server (central instance).
To get the value of MessageServerHost, login into the SAP system and use Tcode RZ11. Then, open the “Maintain Profile Parameters” screen and enter rdisp/mshost in the Param. Name field and click Display. Finally, use the value of Current Value field as MessageServerHost value.
MessageServerService: sapmsQ43
It is the service name under which the message server responds to load-balancing requests. This parameter is required if system ID is not specified.
To get the value of MessageServerService, open the “Maintain Profile Parameters” screen and enter rdisp/msserv in the Param. Name field and click Display. Finally, use the value of Current Value field as MessageServerService.
LoginGroup: PUBLIC
This parameter is used by the message server to select an application server. By default, parameter value is “PUBLIC”.
To get the value of Group/Server field, open the SAP Logon Pad, and then go to properties of the SAP system.
Set SAP Connection (Basic)
Sets basic SAP connection.
To set basic SAP connection, you must specify the values in the User, Password, InstanceNumber, Client, and Language parameter fields.
The following is the list of all parameters that are required to set basic SAP connection:
InstanceNumber: 36
User: Username to connect with SAP system.
Password: Password to connect with SAP system.
Client: 002
Language: EN
The following is the list of all parameters and its values that are non-mandatory to set basic SAP connection:
MessageServer: ldciq43.wdf.sap.corp
This parameter is required only if UseLoadBalancer is set to false.
UseLoadBalancer: This parameter must be enabled to create load balance connection. By default, this parameter is set to false.
If this parameter is set to true,
value for MessageServer can be skipped.
value for MessageServerHost, SystemID or MessageServerService and LogonGroup must be passed.
If this parameter is set to false,
value for MessageServer must be passed.
value for MessageServerHost, SystemID or MessageServerService and LogonGroup can be skipped.
SystemID: Q43
MessageServerHost: 1dciq43
MessageServerService: sapmsQ43
LoginGroup: PUBLIC
Set SAP Connection (Advanced)
Sets advanced SAP connection.
The Set SAP Connection (Advanced) activity gives you flexibility to configure the connection with different connection parameter.
No connection parameter is mandatory in this activity which allows you to construct the connection as per your requirement. However, if connection parameters are not sufficient or wrongly passed, runtime error is displayed in the test console.
In this activity, you can choose three types of connection type.
SSO: This connection type allows you to set SSO connection like Set SAP Connection (SSO) activity. SNCName, MessageServer, InstanceNumber and Client are commonly used for this connection type. By default, SNCMode is set to true for this connection type.
Basic: This connection type allows you to set Basic connection like Set SAP Connection (Basic) activity. User, Password, MessageServer, InstanceNumber and Client are commonly used for this connection type. By default, SNCMode is set to false for this connection type.
Custom: This connection type allows you to set any other advance connection. You can add connection parameters as per your requirement. By default, SNCMode is set to false for this connection type. However, you can change the SNCMode value by adding the parameter.
The following is the list of all parameters and its values that are non-mandatory to set Advanced SAP connection:
MessageServer: This parameter value must be avoided for load balance connection.
InstanceNumber: 00-99
Client: Client ID into which to login.
SystemID: Q43
Language: EN
MessageServerHost: Host name of the SAP Message server (central system) in the SAP system.
MessageServerService: Service name under which the message server responds to load-balancing requests.
LoginGroup: Default value is "PUBLIC"
SAPRouter: Parameter that specifies the route string if the connection needs to be made through firewall via an SAP Router.
SNCModeThis parameter value is true for SSO connection type. Default value is false for all other connection type.
Execute BAPI
Validates the parameters that are passed for BAPI and execute the BAPI.
The validation of parameters checks whether:
all required parameters are passed or not.
all parameters have the correct name.
all parameters have the correct data type.
If the validation fails, the exception BAPI_InvalidParamException will be thrown.
In this activity, you must specify the values in the BAPI_Name and SAPConnection parameter fields.
The following is the list of two mandatory and four optional parameters:
BAPI_Name: It is a mandatory parameter. The value of the parameter must be the name of the BAPI. For example: "BAPI_PR_CREATE" or "STFC_STRUCTURE".
SAPConnection: It is a mandatory parameter. The value of the parameter must be the Response of Set SAP Connection (SSO/Basic) activity.
Imports: It is an optional parameter. The value of the all BAPI import parameters must be in JSON format and then the JSON data can be passed in Imports parameter field.
Tables: It is an optional parameter. The value of the all BAPI table parameters must be in JSON format and then the JSON data can be passed in Tables parameter field.
Changing: It is an optional parameter. The value of the all BAPI changing parameters must be in JSON format and then the JSON data can be passed in Changing parameter field.
Outputs: It is an optional parameter. This parameter is related to the response that the Execute BAPI activity returns.
If you do not pass any parameter name as value in the Outputs parameter field, the Execute BAPI activity returns the entire BAPI response in JSON format.
If you pass single or multiple parameter names as value(s) in the Outputs parameter field, the Execute BAPI activity returns the BAPI response only of these passed parameter(s) in JSON format. Multiple parameter names are passed as comma separated string.
ValidationRequired: It is an optional parameter. This parameter enables the BAPI parameter validation. By default, the value of this parameter is set to ‘true’. Set the value of this parameter to ‘false’ if you want to skip the BAPI parameter validation.
Is SAP Connection Alive
Checks whether the SAP connections opened using either Set SAP connection (Basic) or Set SAP connection (SSO) activity is active or not.
In this activity, you must specify the values in the SAPConnection field.
The following is the parameter of this activity:
SAPConnection: It is a mandatory parameter. The value of the parameter must be the Response of Set SAP Connection (SSO/Basic) activity.
IsSapConnectionAlive: It is an output parameter. It returns true if the connection is active, else returns false.
Commit BAPI
Commits the transactions of BAPI.
Commit is done on the connection object. If multiple BAPIs are executed on the same connection, the Commit BAPI activity commits all the transactions done on that connection.
In this activity, you must specify the values in the SAPConnection field.
The following is the parameter of this activity:
SAPConnection: It is a mandatory parameter. The value of the parameter must be the Response of Set SAP Connection (SSO/Basic) activity.
Close SAP Connection
Closes the SAP connection and dump the active connection object.
In this activity, you must specify the values in the SAPConnection field.
The following is the parameter of this activity:
SAPConnection: It is a mandatory parameter. The value of the parameter must be the Response of Set SAP Connection (SSO/Basic) activity.