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: 

difference between a BAPI and function module

Former Member
0 Kudos

plz tell what is the difference between BAPI and function module


Former Member
0 Kudos


Remote enabled function module is BAPI


Active Participant
0 Kudos


the main differences are:

1) BAPIs can be called remotely, from other application servers or even other external programs written in other languages that support the RFC protocol

2) BAPIs, usually contain the "business logic" of a transaction. For example, when you call the BAPI_SALESDOCU_CREATEFROMDATA1 BAPI, it will create a Sales Order (as if you created a sales order manually in transaction VA01) but ALSO, it will check ALL the relevant customizing of this transaction. All user-exits and other BAdIs used during the online VA01 transaction will also be executed. In that sense, the BAPI has the business logic. It is also a better alternative to the classic batch-input.

3) Function modules are a super-set of BAPIs. That means that BAPIs are actually function modules but with the main difference that are also RFC-enabled. Function modules are usually used to encapsulate code snippets that will be used by various programs. So, instead of writting the same code again and again, if possible, you write it within a function module and you just call that function module by any other program.

Please, reward if it was helpful.



Former Member
0 Kudos

Hi Ranveer,



A BAPI is an Interface which provides access to data and processes in Business application systems. These BAPIs are defined as API Methods in Business Objects and are stored in Business Object Repository (BOR).


BAPIs are standardized methods of SAP Business Objects that enables customers and third parties to integrate their software components with the R/3 system.


A BAPI is implemented as a Remote Enabled Function Module and we maintain this in SE37 (Form Builder).


BAPI will have precisely defined Interface. So for an Application program to use a BAPI it should know the Interface definition of the BAPI. Application Program has to supply the appropriate interface information.

BAPI will have the Interface definition same as that of a normal function module. Like Import Parameters, Export Parameters, Tables parameters. But the main difference is you can pass only by Value, we cannot use Reference parameters in RFC enabled Function modules. RFC does not support transfer “By Reference”. We should not raise any exceptions in this Function module. If it raises any exception the connection between the two systems is automatically disconnected.

The definitions and descriptions used by the BAPI interface are stored in Dictionary. While creating our own BAPIs also we have to define the Import and Export structures in Dictionary only.

Defining and Implementing a BAPI:

Before creating the BAPI first you need to define the Individual objects, which the BAPI uses, in Dictionary.

Identify and prepare the Structures for the Interface parameters.

You can use Individual fields, structures, tables as interface parameters and these parameters must refer to a Dictionary Object.

We have to create our own data structures for BAPI interface that are independent of the data structures generally used in R/3 applications. This enables changes to be made in R/3 applications without affecting BAPIs. We can use existing data elements and domains for the BAPI structure component s.

The Transactions that we use in Creating a BAPI are:

SE11 – ABAP Dictionary

SE37 – Function Builder

SWO1 – To create the business object type.


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 at the heart of the Business Framework, enabling the interoperability of

software components. They cover a wide spectrum of R/3 business data and processes.

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.

SAP provided the first BAPIs for customers and external providers in Release 3.1, enabling them

to integrate their software components in the R/3 System and the Business Framework. The

number of BAPIs is increasing with each R/3 Release and with this the extent of object-oriented

access to the R/3 System.

Diff bet bapi and RFC will helps u to understand much better

A BAPI is remotely enabled function module

ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..

You can make your function module remotely enabled in attributes of Function module but

A BAPI are standard SAP function modules provided by SAP for remote access.

Also they are part of Businees Objest Repository(BOR).

BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects.

You create business objects and those are then registered in your BOR (Business Object Repository)

which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA.

In this case u only specify the business object and its method from external system

in BAPI there is no direct system call. while RFC are direct system call.

Some BAPIs provide basic functions and can be used for most SAP business object types.

These BAPIs should be implemented the same for all business object types.

Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.

Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.

chk some useful links,289625,sid21_cid558752_tax293481,00.html


Former Member
0 Kudos


BAPI are the subclass of the Function Module.

BAPIs are tied to the BOR (Business Object Repository). FMs are not bound to Business Objects.

BAPIs are remote enabled function modules, but usually implement some business object. Meaning that a BAPI would do all of the required transactions, data processing associated with the business object, like creating a purchase order. There are a lot of connections which are made when you create purchase order, and all are taken care of by the BAPI. So when you call the BAPI and pass the required parameters, it would be like you have created the PO using the standard transaction(ME21N) but there is no screen processing. Also, BAPIs are well documented in the transaction BAPIs. Just remember that at a technical level, BAPIs are nothing more than an RFC enabled function module.

It can be invoked from remote programs like standalone JAVA programs, web interface etc..

You can make your function module remotely enabled in attributes of Function module but

A BAPI are standard SAP function modules provided by SAP for remote access.

Also they are part of Businees Objest Repository(BOR).