Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
BAPI in SAP
BAPI stands for Business Application Programming Interface (B + API), BAPI`s are methods
(Function Modules) defined in Business Object Repository (BOR).
Before going to BAPI, we need to get understanding on BOR.
Business Object:
Business Object is similar to class, which is a group of attributes, methods, interfaces, events and
key fields for a particular business application or scenario.
Examples for BOR are BUS1001 - Material Business Object, BUS2012 - Purchase Order Business
Object.
What is a BAPI?
BAPI is a remote enabled function module, which is used to communicate between SAP to SAP,
SAP to NON-SAP systems.
BAPI RFC function module will be inserted into business object, it will convert into BAPI.
How BAPI is created?
Remote Enabled Function Module created.
Remote enabled function module inserted into a business object.
BAPI created.
Uses of BAPI
In SAP BAPI`s can be used for
Generating reports.
For communication between different servers SAP SAP or SAP NON-
SAP.
BAPI`s can be used for data migration.
Used for communication Between SAP Used for communication Between SAP
SAP and SAP non-SAP SAP and SAP non-SAP
BAPI is a part of business object, it can RFC is a standalone function module, it cannot
communicate with other BAPI`s. communicate with other RFC`s
BAPI Uses Object Oriented concepts RFC uses procedure oriented concepts
BAPI can be used in report development, in the example program we will develop a report to
display material basic details for a material input.
To get material details for a material we use BAPI_MATERIAL_GET_DETAIL (go to SE37
check).
Go to SE38, create a program ZSAPN_BAPI_MATERIAL, save it in a local object.
REPORT ZSAPN_BAPI_MATERIAL.
PARAMETERS: P_MATNR TYPE MARA-MATNR.
DATA : MAT_DATA TYPE BAPIMATDOA.
START-OF-SELECTION.
CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL' "get material details
EXPORTING
MATERIAL = P_MATNR
* PLANT =
* VALUATIONAREA =
* VALUATIONTYPE =
* MATERIAL_EVG =
IMPORTING
MATERIAL_GENERAL_DATA = MAT_DATA
* RETURN =
* MATERIALPLANTDATA =
* MATERIALVALUATIONDATA =
.
WRITE: / MAT_DATA-MATL_DESC, MAT_DATA-MATL_TYPE, MAT_DATA-IND_SECTOR,
MAT_DATA-MATL_GROUP.
Step 2: Go to SE37, create a remote enabled Function module to get material details for material
input.
Go to SE37, provide name as ZBAPI_GET_MATERIALS and create
A popup will come provide function group and short text, enter.
Go to attributes tab, select Remote-Enabled module radio button.
Go to import tab, add parameter as below.
A popup will come, provide RFC function module name and enter.
We have inserted a RFC function module into methods of business object, now we need to do two
things.
Change 'change release status' to 'implemented'
Again 'change release status' to 'released'
A popup will come just press enter.
Once object is released, you will find released icon as below.