A BAPI is a point of entry to the R/3 System- that is,a point at which the R/3 System provides access to business data and processes.
Each object in a BOR can have many methods,one or more of which can be implemented as BAPIs.
BAPIs can have various functions:
- Create an object
- Retrieving the attributes of an object
- Changing the attributes of an object
A BAPI is an interface that can be used for various applications:
-Internet Application Components, which make individual R/3 functions available on the Internet or an intranet for users with no R/3 experience.
- R/3 Components compositions,which allows communication between the business objects of different R/3components(applications).
- Visual Basic/JAVA/C++ - external clients (for ex- alternative GUIs) that can access business data and processes directly.
We can display more information on business objects and the BAPIs that belong to them using the BAPI Explorer Information.
If we expand a sub-tree for a business object in the BAPI Explorer,the system displays the following:
Key Attributes: This provide an unique identifier for each business object.
Instance-specified Methods: These are the methods that are bound to the instance identified by the key attributes.
Non-Instance Specified Methods: These can be called by all instances of an object type.
If we expand a substructure for a method,the system returns the names of its import and export parameters. We can obtain more detailed information on the typing of interface parameters by choosing the TOOLS tab,then choosing the ABAP Dictionary. BAPI interface parameters are always typed using ABAP Dictionary types.
BAPIs usually have an export parameter called RETURN.This can be structure or an internal table.The return parameter contains information on errors that occurred while the BAPI was being processed.There are no exceptions for BAPIs.
To display complete information on a business object type, use the Business Object Builder tool.The system displays a tree structure for the business objects type,including non-API methods.
To search for an business object use the Business Object Repository(BOR) tool.This tool displays the component hierarchy with all the business objects that belongs to it.
BAPIs with standardized names contains standard methods.Three of the most important are listed :
GetList: Returns the contents of the key fields for the object we have chosen.
GetDetail: Returns detailed in formations for the required object.
CreateFromData: Create a new object in the R/3 and returns information about it.
BAPI : Exception Handling
Every BAPI contains an interface parameter,RETURN which contains information about errors that occurs.This parameter is always of an ABAP Dictionary type. This means that we must include a structure of an identical type in our program.
Know more about SAP ABAP