Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

what are bapi's

Former Member
0 Kudos

hello gurus can any one tell me exactly what are bapi's and where are they used for and what is the difference between fucntion module and bapis




Former Member
0 Kudos

Hi Afzal,

Check below thread.




Former Member
0 Kudos

Hi Afzal,

Check below thread.



Active Contributor
0 Kudos


A Business Application Programming Interface (BAPI) is a precisely defined interface providing access to processes and data in business application systems such as R/3.

BAPIs are defined as API methods of SAP Objects. These objects and their BAPIs are described and stored in the BOR (BOR).


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).

BAPIs are a global communication standard for business applications.

Examples of what BAPIs can be used for include:

· R/3 satellite systems

· Distributed R/3 scenarios using Application Link Enabling (ALE)

· Connecting R/3 Systems to the Internet using Internet application components (IACs)

· Visual Basic programs as frontends to R/3 Systems

· Work flow applications that extend beyond system boundaries

· Customers' and partners' own developments

· Connections to non-SAP software

· Connections to legacy systems

See also:

BAPI - Introduction and Overview.



The Business Object Repository (BOR) is the object oriented repository in the R/3 System. It contains, among other objects, SAP Business Objects and their methods.

In the BOR a Business Application Programming Interface (BAPI) is defined as an API method of an SAP Business Object. Thus defined, the BAPIs become standard with full stability guarantees as regards their content and interface.


With regard to SAP Business Objects and their BAPIs, the BOR has the following functions:

· Provides an object oriented view of R/3 System data and processes.

R/3 application functions are accessed using methods (BAPIs) of SAP Business Objects. Implementation information is encapsulated; only the interface functionality of the method is visible to the user.

· Arranges the various interfaces in accordance with the component hierarchy, enabling functions to be searched and retrieved quickly and simply.

· Manages BAPIs in release updates.

BAPI interface enhancements made by adding parameters are recorded in the BOR. Previous interface versions can thus be reconstructed at any time.

When a BAPI is created the release version of the new BAPI is recorded in the BOR. The same applies when any interface parameter is created.

The version control of the function module that a BAPI is based on is managed in the Function Builder.

· Ensures interface stability.

Any interface changes that are carried out in the BOR, are automatically checked for syntax compatibility against the associated development objects in the ABAP Dictionary.


You should only define a BAPI as a SAP Business Object method in the BOR if the function module that the BAPI is based on has been fully implemented.

Full access to the BOR is restricted to the persons responsible for the objects involved and for quality control.


The BOR-BAPI Wizard assists with creating new BAPI methods in the BOR. It takes you through the creation process step by step.

Transaction Model for Developing BAPIs


The transaction model in which BAPIs are used determines how you have to program BAPIs.

The transaction model described here has been used to develop BAPIs for R/3 Releases 3.1 and 4.0A.

Logical Unit of Work (LUW) and Statelessness

Within the context of this transaction model a transaction represents one processing step or one logical unit of work (LUW). When a transaction is called, database operations are either fully executed or not at all. The whole transaction must be programmed to be stateless.

This transaction model requires that:

· No data is imported that may indirectly affect the result. If a transaction is called more than once, each call must have the same result.

For BAPIs this means, for example, that Set or Get parameters cannot be used. However, you can keep Customizing data in a global memory as this data remains unchanged even if transaction calls are repeated.

· There must be no functional dependencies between two transactions.

· Either all relevant data has to be changed in the database or none at all.

The following sections describe how the transaction model effects BAPI development:

· Using the Transaction Model in Release 3.1

· Using the Transaction Model in Release 4.0A

Using the Transaction Model in Release 3.1


The example below of an external program calling a BAPI to change data in an R/3 System, illustrates how the transaction model affects BAPI development in Release 3.1. Assume the transaction was written in, for instance, Visual Basic and that data is to be changed in the R/3 System only.

The RFC connection is live the whole time the external program is logged on to the R/3 System to avoid having to connect and disconnect repeatedly. When the RFC connection is already established, an RFC call does not essentially take up any more CPU time than a direct call to the function module from within the R/3 System.

There is one BAPI call for each transaction in the transaction model supported in 3.1. BAPIs can only be called synchronously. A BAPI call is essentially the call of the underlying RFC capable function module.

Process Flow

The process flow of the program consists of the steps below (see graphic):

Log on

..... (Visual Basic source code)

Call BAPI to read and/or change data

..... (Visual Basic source code)

Call BAPI to read and/or change data

..... (Visual Basic source code)

Log off


What do the terms "LUW" and "statelessness" mean to BAPIs that are implemented in the framework of this transaction model?

If a transaction represents one Logical Unit of Work and in addition is supposed to be stateless, BAPIs are affected as follows:

· Initial state each time a BAPI is called

A repeated call of one BAPI must produce the same result. Only data that is not affected by the execution of the BAPI, for example, Customizing data, can be buffered.

· No functional dependency between two BAPIs

A BAPI call must not be negatively affected by an earlier call of another BAPI. A follow up call must not presuppose an earlier call.

· All or nothing principle

A database change, for example, creating a new sales order, must be carried out completely or not at all (LUW).

This is why BAPIs to be implemented in 3.1 are created with integrated commit control. The "Commit Work" command is always invoked at the end of the function module of a BAPI that modifies data.

Former Member
0 Kudos

Hi Afzal,

Below is the defination of BAPI.

SAP created the Business Framework to allow the technical integration and exchange of business data among SAP components and between SAP and non-SAP components. Important components of the Business Framework are the Business Application Programming Interfaces (BAPIs), which represent visible interfaces at the component boundaries and whose properties serve to integrate these components.

The integration can include both components within a local network and components that are connected with one another through the Internet.

BAPIs allow integration at the business level, not the technical level. This provides for greater stability in the link, and independence from the underlying communication technology.

You can get all the standard SAP BAPI functions with the transactions code 'BAPI'.

Difference between a BAPI and Function Module....

Remote Function Calls

BAPI is ultimately a mechanism for getting data out of SAP R/3. If a BAPI is a ship pushing a barge (data), the engine of that ship is a Remote Function Call (RFC). An RFC is a function module in a system that is called from some other system. This, of course, covers a great deal of ground. The two systems can both be SAP, or they can be different platforms, or an RFC may be used on the spot in real time by any party making an inquiry of an SAP system from the outside (including you, sitting at your laptop).

How do RFCs relate to BAPIs? An RFC is the means by which the business object represented by a BAPI is implemented. A BAPI is a business object; an RFC is functional code.

Basically BAPI is also a function module that is Remote enabled.

This will give you a idea about how to write a BAPI.<b></b><b></b><b></b>;



Rewards points for useful answers.

0 Kudos

Hi Afzal,

Refer to this link for a details understanding of BAPI.

Also a BAPI can be defined as

BAPIs (Business Application Programming Interfaces) are the standard SAP interfaces. They play an important role in the technical integration and in the exchange of business data between SAP components, and between SAP and non-SAP components. BAPIs enable you to integrate these components and are therefore an important part of developing integration scenarios where multiple components are connected to each other, either on a local network or on the Internet.

BAPIs allow integration at the business level, not the technical level. This provides for greater stability of the linkage and independence from the underlying communication technology.

Refer to this link...



Rewards points for useful answers.