What is SAP BAPI?

Business Application Programming Interfaces (BAPIs) are standard SAP interfaces that enable software vendors to integrate their software into the mySAP Business Suite. BAPIs are technically implemented using RFC (Remote Function Call) enabled function modules inside SAP systems. BAPIs are defined in the Business Object Repository (BOR) as methods of SAP business objects that perform specific business tasks. They allow integration at business level, not technical level. This makes it much easier to find suitable BAPIs compared to non-BAPI based function modules.

Integrating SAP with AquaLogic BPM

AquaLogic BPM uses the SAP Java Connector (JCo) to use BAPIs to access SAP. The SAP Java Connector (JCo) is a toolkit that allows Java applications to communicate with SAP systems. JCo is a high-performance encapsulation of the RFC Library that supports all features of RFC. It combines an easy to use API with unprecedented flexibility and performance. It can be used to implement BAPI based integrations. You also need additional files to be able to use this integration:

If you are using the Studio in a Windows environment:
  • librfc32.dll, it has to be located under the system32 directory, and
  • sapjcorfc.dll, it has to be located under the ext directory of the Studio installation.
If you are using the Studio in a Unix environment:
  • Copy the file librfccm.so to your system file and add the folder that contains it to environment variable LD_LIBRARY_PATH,
  • libsapjcorfc.so, it has to be located under the ext directory of the Studio installation.

SAP BAPI Objects, Tables, and Structures

After cataloging SAP BAPI, the following are available:
SAP Object Description
BAPI Objects An object is created for each of the introspected BAPIs
SAP Structures Represent SAP structures which are a set of attributes.
SAP Tables Represent an SAP table where each row has a set of attributes

BAPI Objects

Each BAPI Object contains the following:
Imports Input arguments for the BAPI.
Exports Output arguments for the BAPI
Tables Input/Output arguments for the BAPI.
Call Method Used to invoke BAPI.

Tables

Use the currentRow attribute to access the fields in the current row and the rows attribute to get an iterator to access all the rows in a for each statement.