Bapi & RFC
Bapi & RFC
What is BAPI ?
BAPI stands for Business Application Programming Interface it is precisely defined interface providing access to processes and data in business application systems such as R/3. BAPIs are the standard interfaces and they play important role in the exchange of business data between SAP components, and between SAP and non-SAP components.
BAPIs are defined as API methods of SAP Objects. These objects and their BAPIs are described and stored in the Business Object Repository (BOR).
For example, the full name of the BAPI CheckAvailability() of the business object Material is: Material.CheckAvailability().
Uses of BAPI
BAPIs can be called within the R/3 System from external application systems and other programs. A BAPI call can either be made as an object oriented method call or as a remote function call (RFC). The Business Framework - the open, component-based architecture, which allows software components from SAP and third parties to interact and integrate with each other, is becoming more and more important. SAP business objects are accessed through BAPIs (Business Application Programming Interfaces), which are stable, standardized methods. SAP business objects and their BAPIs provide an object-oriented view of R/3 business functions.
Synchronous/Asynchronous
BAPI:
Updation: Synchronous Process: Asynchronous
RFC:
Synchronous: This type of RFC executes the function call based
on synchronous communication, meaning that the systems involved must both be available at the time the call is made. Synchronous communication can be implemented in function calls that require the immediate return of data to the sender system.
Creating a BAPI
Steps for creating a BAPI: T code to create a BAPI is: BAPI. Step 1: Define Structure For The BAPI Step 2: Write Function Module Step 3: Create the API Method Step 4: Final Steps
Select Structure
Click continue
Save
Tables:
Press Enter
T Code SWO1
Select Here
Click Here
Click Here
Now we can write codes for interface in VB, Java, C++ etc.
Now based on our requirement we have to search for BAPI, Here we are going to search for BAPI related to Purchase Order. Purchase order is in MM so we select that from the list. We have to get purchase order detail, So Double click on the GetDetail. The right frame will show the BAPI name. Materials Management -> Purchasing -> Purchase Order -> GetDetail
Now Expand The GetList by pressing > , you will get the screen as below
We need Purchase Order Header detail, double Click Header, we will get Right Frame with the Dictionary Reference. The Dictionary Reference is BAPIEKKO. We can see the fields by Double clicking that BAPIEKKO.
Note down the Fields name from the Components Column those are required in the report.
Material Management:
Purchase Req Item: BAPI_REQUIREMENT_GET_LIST Purchasing info: BAPI_INFORECORD_GETLIST
Finance:
AP Account: BAPI_AP_ACC_GETOPENITEMS Debtor Credit: Account BAPI_CR_ACC_GETDETAIL AR Account: BAPI_AR_ACC_GETOPENITEMS
Note: We can write any number of fields from the Dictionary BAPIEKPO in the output, just Note the field and give that in the Write statement within LOOP ENDLOOP.
Click Here
Thank You