Invoke RFC BAPI in SAP

Use the Invoke RFC BAPI in SAP activity to invoke RFC/BAPIs in the SAP system.

Only request/reply requests are supported. Asynchronous requests are not supported.

General Tab

On the General tab, establish connections to the SAP system, and download the schema of the RFC/BAPI to be invoked in the SAP system.

The following table lists the configurations on the General tab of the Invoke RFC BAPI in SAP activity:

Field Module Property? Description
Name No Specify the name to be displayed as the label for the activity in the process.
SAP Connection Yes Click to select an SAP Connection shared resource. The SAP Connection shared resource establishes connections between the plug-in and the SAP system.

If no matching SAP Connection shared resources are found, click Create Shared Resource to create one. For more details, see Creating and Configuring an SAP Connection.

Note: When a process contains multiple Invoke RFC BAPI activities, if you want the activities to use different SAP Connection shared resources, you have to create process properties for the shared resources to be used, and then choose the corresponding process property for the activity. If you choose different SAP Connection shared resources for the Invoke RFC BAPI activities in a process by clicking , the activities use the same shared resource.
RFC/BAPI No Click Fetch Function Module to download the schema of the RFC/BAPI to be invoked in the SAP system.

In the Fetch Function Module dialog, you can use the RFC/BAPI tab or BOR tab to download the schema of the RFC/BAPI to be invoked in the SAP system.

The RFC/BAPI tab is useful when the name of the function module, function group, or both are known. The BOR tab is useful for browsing SAP business objects based on application objects.

In the RFC/BAPI tab, complete the following tasks:
  1. Specify the RFC/BAPI filter or the RFC/BAPI group filter to filter out the required RFC/BAPI types with the RFC/BAPI type name.

    Both the RFC/BAPI filter and the RFC/BAPI group filter support the wildcard search.

  2. Click Fetch RFC/BAPIs.
  3. Select the RFC/BAPI type that you want to download and click OK.

    Ensure that the selected RFC/BAPI type has been released in the SAP system.

In the BOR tab, complete the following tasks:
  1. Specify values for the Object Type Filter, Object Name Filter, and Object Text Filter fields to filter out the required business objects.

    All the object type filter, object name filter, and object text filter support the wildcard search. The values of the preceding three fields are case sensitive.

  2. Click Fetch Object Types.
  3. Expand an object type in the Object Type column, select the method that you want to download, and click OK.

After the RFC/BAPI schema is downloaded, an XSD file is created. The XSD file is intentionally invisible in the project, but it can be picked from the activity if required.

Note:
  • The plug-in does not support basXML and class-based exceptions.
  • When you download more than one page of the RFC/BAPI schema spanning, only the first page is cached for subsequent activities.
  • If an RFC/BAPI function group is inactive in the SAP system, the RFC/BAPIs in the function group are still displayed in the search result.
  • If a business object does not contain any released key attributes, non-key attributes, or methods, the business object is still displayed in the object type search result.
  • In a process, you cannot associate the same RFC/BAPI with multiple Invoke RFC BAPI in SAP activities. If you want to use the Invoke RFC BAPI in SAP activities with the same RFC/BAPI, create different processes for the activities.
  • If the schema for an RFC/BAPI activity is refreshed, then the other RFC/BAPI activities in the same process that are using the same schema may not be refreshed.

Description Tab

On the Description tab, enter a short description for the Invoke RFC BAPI in SAP activity.

Advanced Tab

On the Advanced tab, select the Transactional check box to support one or more RFC/BAPI calls to be executed as a transaction or logical unit of work in the SAP system.

The following configurations are displayed on the Advanced tab of the Invoke RFC BAPI in SAP activity when you select the Transactional check box:

Field Module Property? Description
Invocation Protocol No Specify the invocation protocol for the activity. They are:
  • Request/Reply

    If Request/Reply is selected, the Transactional check box is available.

  • tRFC

    If tRFC is selected, the support for asynchronous request is enabled.

The default value is Request/Reply.

Note: For one way invocation protocol, the confirmation report following the invocation is not available.
Context End No If you want to end the RFC/BAPI transaction at this activity, select this check box.

This check box is cleared by default.

This check box is the same as the Terminate Connection check box in the Advanced tab of the Dynamic Connection activity. When a dynamic connection with the selected Transactional check box is used, if you want to end the transaction, you must select the Terminate Connection check box instead of selecting the Context End check box.

Auto Commit No If you want the transaction or logical unit of work to be committed automatically when the transaction or logical unit of work consists of only one RFC/BAPI call and the RFC/BAPI call does not return any errors, select this check box.

This check box is cleared by default.

Commit Expiry(ms) No Specify the timeout value in milliseconds for the activity to wait for the subsequent activity to be invoked.

The default value is 30000.

This field is the same as the contextTimeout input item in the Input tab of the Dynamic Connection activity, and can overwrite the contextTimeout input item.

Input Tab

On the Input tab, enter the request of the RFC/BAPI to be invoked, the session ID of the previous activity, and the timeout value for the activity to wait for invoking the RFC/BAPI.

The following table lists the input elements on the Input tab of the Invoke RFC BAPI in SAP activity:
Input Item Data Type Description
sessionID String Enter the session ID of the previous activity when the Transactional check box in the Advanced tab is selected.
Note: If the Invoke RFC BAPI in SAP activity invokes the first RFC/BAPI in the context of the transaction, leave this element blank.
timeout Long Enter the timeout value in milliseconds for the activity to wait for invoking the RFC/BAPI.

The default value is 600000.

Note: The module property of the long type cannot be left blank, and its value range does not include the negative numbers.
RfcRequest Complex Enter the request of the RFC/BAPI to be invoked.

Output Tab

The Output tab shows the session ID of the activity and the response of the invoked RFC/BAPI . It also shows the CPIC_ID associated to the SAP connection. If the invocation protocol of tRFC is selected, the output shows SessionID, CPIC_ID and TID.

Fault Tab

On the Fault tab, you can find the error codes and error messages of the Invoke RFC BAPI in SAP activity and the SAP system. The SAP system exceptions are returned by the RFC/BAPI invoked in the SAP system.

See Error Codes for more detailed explanation of errors of the Invoke RFC BAPI in SAP activity.

Note:
  • If you want to catch the SAP system exception in a process, it is good practice to use the Catch fault handler, instead of the Catch ALL fault handler.
  • If the exception that is sent back to the SAP system has more than 50 characters, then the SAP system can only retrieve the first 50 characters.
  • If you catch a SAPSystemException, then the schema is inline with the Invoke RFC BAPI in SAP activity, which will cause issues if the corresponding RFC or BAPI changes in terms of exceptions.

The following table lists error schema elements in the Fault tab of the Invoke RFC BAPI in SAP activity:
Error Schema Element Data Type Description
msg String Displays the error message.
msgCode String Displays the error code.