0% found this document useful (0 votes)
67 views

(Business Application Programming Interface) : Some of The Important Points Related To BAPI

BAPI (Business Application Programming Interface) allows connecting SAP systems and integrating SAP with non-SAP systems by defining API methods and objects stored in the Business Object Repository (BOR). Custom BAPIs can be created using function modules defined as remote-enabled with import, export, and return parameters. Standard BAPIs can be identified by searching transactions associated with business objects and methods, or by prefixing common method names like GetList() with BAPI_.

Uploaded by

Trainning ABAP
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

(Business Application Programming Interface) : Some of The Important Points Related To BAPI

BAPI (Business Application Programming Interface) allows connecting SAP systems and integrating SAP with non-SAP systems by defining API methods and objects stored in the Business Object Repository (BOR). Custom BAPIs can be created using function modules defined as remote-enabled with import, export, and return parameters. Standard BAPIs can be identified by searching transactions associated with business objects and methods, or by prefixing common method names like GetList() with BAPI_.

Uploaded by

Trainning ABAP
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

BAPI

(Business Application Programming Interface)

BAPI's are used to connecting from SAP to SAP as well as SAP to NON-SAP.

BAPI's are defined as an API method (Application Programming Interface) of SAP objects. These
methods & their objects are stored as well maintained in BOR (Business Object Repository). BOR
taking care about version change management (when ever the version is changed, if any changes
required in BAPI those changes is done by BOR).
BAPI's are also called as one of the remote enable function module.

Some of the important points related to BAPI: -


1) BAPI mustn't contain call transaction.
2) BAPI mustn't invoke commit work instead of commit work
we call the BAPI-TRANSACTION_COMMIT function module.
3) BAPI structure mustn't contains includes.
4) There is o functional dependences between any two BAPI's.
5) BAPI never calls to terminate the program.
Whenever an error occurred in BAPI it written those errors through written parameter.
6) BAPI must not contain dialogue programs.
7) BAPI mustn't contain Submit reports.

Steps to create our own custom BAPI


1. Create the BAPI structure (SE11)
2. Create the BAPI function module (SE37)
1. Which is remote enable.
2. Must contains RETURN parameter
3. All parameters are pass by value
3. Create the object and methods for BAPI function module (SW01)
4. Release the object and method (SW01).
Object:Develop a custom BAPI to display the purchasing doc number, doc date & vendor number
based on the given purchasing doc number.

Steps to create the BAPI structure: -

 Execute SE11.
 Select the radio button data type.
 Provide the BAPI structure name (ZBAPI_STR).
 Click on create.
 Select the radio button structure. Enter.
 Provide short description (BAPI Structure).
 Provide the component & component type.
EBELN EBELN
BEDAT BEDAT
LIFNR LIFNR
 Save in own package. Check, activate.

Steps to create function group: -

 Execute SE37.
 In the menu bar click on goto  function groups  create group.
 Provide the function group name (ZBAPI_FG), short description.
 Save in our own package.
Steps to activate the function group: -
 In the menu bar click on environment  inactive objects.
 Expand the function group under transportable objects.
 Select the function group. Right click  activate. Enter.

Steps to create function module: -


Import
Parameter type associated type pass by value
I_EBELN TYPE ZBAPI_STR-EBELN
Export
Parameter type associated type pass by value
E_WA TYPE ZBAPI_STR
RETURN TYPE BAPI_RET2

Source code
Select single ebeln bedat lifnr from ekko into wa_ekko where ebeln = i_ebeln.
 Save, check, activate.
 Click on back. In the menu bar click on function module. Release -> Release.
 Function module is released.
Steps to release the object & method for BAPI function module: -
 Execute SW01.
 Provide the object name (ZBAPI_OB).
 Click on create.
 Provide the same to all. Select the application (M). Enter.
 Click on enter. Save in our package.
 Place the cursor on methods. In the menu bar click on utilities. API methods  Add method.
 Provide function module name (ZBAPI_FM1). Click on enter.
 Click on next step (CTRL + SHIFT + F11). Click on next.
 Click on yes. Click on save.

Steps to release the object & method: -

 Place the cursor on object (ZBAPI_7OB).


 In the menu bar click on edit  change release status  object type  to modeled
(to implemented, to release also).
 Select the method. In the menu bar, click on edit  change release status  object type
component to modeled (to implemented, to released also).
 Click on generate (CTRL + F3).

Steps to check BAPI is available or not in BOR:-

 Execute BAPI transaction.


Click on alphabetical tab & Observe our BAPI.

Steps to identify the standard BAPIs: -


Method 1:-
 Execute ‘SE93’.
 Provide the related transaction code (ME23N).
 Click on display.
 Click on display object list (CTRL + SHIFT + F5) in the application tool bar.
 Expand the package.
 Expand the business engineering.
 Expand the business object types.
 Double click on our required business object.
 Expand the method. Double click on our required method (Get details).
 Click on ABAP tab.
 Identify the BAPI name (BAPI_PO_GETDETAIL).

Method 2:-
By using BAPI methods, we can identify the standard BAPI. Some of the BAPI methods are
1. Get list ()
2. Get details ()
3. Get status ()
4. Existence check ()
5. Create ()
6. Change ()
7. Delete ()
Steps to identify the BAPI based on BAPI method name: -
 Execute ‘SE37’.
 Provide BAPI *<Method name>. Click on F4.
 We get the list of BAPIs related to that method & identify our required method.

Note: - When ever we are working with crate, change, delete BAPIs, then we must committed the data
base by using ‘BAPI_TRANSACTION_COMMIT’ function module. Other wise the data base
isn’t updated.

You might also like