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

HIGURUS WHAT IS THE DIFFERNCE BETWEEN RFC & BAPI

Former Member
0 Likes
877

HI GURUS WHAT IS THE DIFFERNCE BETWEEN RFC & BAPI. AND WHAT IS THE DIFFERENCE BETWEEN BDC & BAPI .

7 REPLIES 7
Read only

gopi_narendra
Active Contributor
0 Likes
835

Hi Sri Vasu,

Do a search in the ABAP Forum, you will find many threads related.

P.S : Before posting such basic question, you can make search the forum because such question have been asked many a times. And more over posting questions like these would lead to replies with lot of links.

Regards

Gopi

Read only

Former Member
0 Likes
835

BAPI:

BAPI is an API method of a business object which intern is a RFC enabled function module. Business objects are objects in their own sense which involve with a business process.

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

We 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 we 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.

RFC:

Remote Function Call (RFC) is a call to a function module running in a system different from the caller's. The remote function can also be called from within the same system, but usually caller and callee will be in differene system. RFC allows for remote calls between two SAP Systems (R/3 or R/2) or between an SAP System and a non-SAP System.

FUNCTION MODULE:

Function modules are special external subroutine stored in a central library. The R/3 system provides numerous predefined functin modules that you can call from your ABAP/4 programs. The function modules have global presence and can return value.

1) The main difference between BAPI and RFC is BUSINESS OBJECT.

2) BAPI is the defined interface it holds business data and process, it is the point of entry to the external apllications( JAVA, VB,...) for aceesing and processing SAP data directly.

3) BAPI has it's corresponding RFC function module where as viceversa is not possible.

4) We can call BAPI as Remote Enabled Function Module and Call as the method of Business Object in the BOR, where as RFC can be called as Remote Enabled Function Module only.

5) BAPI has no User dialog and Exceptions.

Reward points..

Read only

0 Likes
835

RFC vs BAPI

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

The following standardized BAPIs are provided:

Reading instances of SAP business objects

GetList ( ) With the BAPI GetList you can select a range of object key

values, for example, company codes and material numbers.

The BAPI GetList() is a class method.

GetDetail() With the BAPI GetDetail() the details of an instance of a

business object type are retrieved and returned to the calling program. The

instance is identified via its key. The BAPI GetDetail() is an instance

method. BAPIs that can create, change or delete instances of a business

object type

The following BAPIs of the same object type have to be programmed so that

they can be called several times within one transaction. For example, if,

after sales order 1 has been created, a second sales order 2 is created in

the same transaction, the second BAPI call must not affect the consistency

of the sales order 2. After completing the transaction with a COMMIT WORK,

both the orders are saved consistently in the database.

Create( ) and CreateFromData! ( )

The BAPIs Create() and CreateFromData() create an instance of an SAP

business object type, for example, a purchase order. These BAPIs are class

methods.

Change( )

The BAPI Change() changes an existing instance of an SAP business object

type, for example, a purchase order. The BAPI Change () is an instance

method.

Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP

business object type from the database or sets a deletion flag.

The BAPI Undelete() removes a deletion flag. These BAPIs are instance

methods.

Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance

of a business object type. The instance to be cancelled remains in the

database and an additional instance is created and this is the one that is

actually canceled. The Cancel() BAPI is an instance method.

Add ( ) and Remove ( ) The BAPI Add adds a

subobject to an existing object inst! ance and the BAPI and

Remove removes a subobject from an object instance. These BAPIs

are instance methods.

2) No it is not possible to connect SAP to Non-SAP systems to retrieve data

using RFC alone. RFC can acces the SAP from outside only through BAPI and

same is for vice versa access.

3) Each Bapi Object has Interface, Key Fields, Attributes,Methods and

Events.

Bapi Function Modules can be attached to these Bapi objects .Function module

has a single bound functionality while a BAPI object can contain many

functionalities

rfc vs function module

Function Module : In a function module passing data is by

call by reference in particular the tables parameter has to

by call by reference by passing memory.

RFC: In a RFC passing data is by value the reason is its

going to access other system while doing the above by

reference wouldn't work as we r into another system whose

memory id will not match,this is the basic cause for

creation of RFC.

Reward points..

Read only

Former Member
0 Likes
835

Difference between BAPI and BDC:

BAPI is a higher end usage for tranfering the data from SAP to non-SAP and vice-versa. for ex: if we are using VB application,where in that we want to connect to SAP and retireve the data,and then change and update the data in SAP for that purpose we can use that.

Apart from that, we can also use it for Uploading/Downloading the data from SAP to Non-SAP like BDC, provided we have an existing BAPI for that.

BAPI function modules will also do all the checks required for data integrity like Transactions for BDC.

There is one more advantage using BAPI instead of BDC. When we go for upgradation, there might be pozzibility to change the screen elements for transactions depending on the requirement. In that case,our BDC pgm may or may not work (depending on the screen changes they have made). Unless and until we prepare new BDC we cant use the old BDC pgm. But in BAPI, SAP promises that they are going to keep the old BAPI and for new functionality they will provide an upgraded BAPI. Until we write a new BAPI pgm, we can use the exisitng BAPI pgm.

For one, Batch Data Communication (BDC) is older. Business Application Programming Interface (BAPI) came later, about 10 years ago (you can see this already from the name, which contains marketese like "business" ).

More important though, they are different technologies. With BDC you build the "batch input transaction" yourself, with an ABAP program which creates the "batch input session" ("Batch-Input-Mappe" in german). You then take that session, like an object, and "run" it on a system (most of the time, this is done on a local system by the administrators, after it has been tested for correctness).

With BAPI, a system (local or remote) exposes its interface to you through some kind of Remote Function Call (RFC). Practically, it tells you: "What do you want to do? Insert that data into Materials Management? Here is the function and the the parameters you have to use for each record". You only work with the Interface - the exposed function. How this function works does not have to interest you. You don't have sessions to "run", you fire your function calls filled with data, one after another and you're done.

BAPI can be run remotely. With BDC, you probably have to call the administrators of the remote system and send them the session you created for them to run. With BDC you go through the whole transaction in one BDC session, with BAPI you may need more than one "BAPI calls" to do this.

With BAPI you don't fill obcure field names with values, you just fill the parameters. You can use a BAPI from inside your ABAP program to let a "business object" do some clearly defined work for you, then you can continue with your code doing other things. You don't do this with BDC. With BDC you write a dedicated program that creates the "session", which is then executed separately.

RFC vs BAPI

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

The following standardized BAPIs are provided:

Reading instances of SAP business objects

GetList ( ) With the BAPI GetList you can select a range of object key

values, for example, company codes and material numbers.

The BAPI GetList() is a class method.

GetDetail() With the BAPI GetDetail() the details of an instance of a

business object type are retrieved and returned to the calling program. The

instance is identified via its key. The BAPI GetDetail() is an instance

method. BAPIs that can create, change or delete instances of a business

object type

The following BAPIs of the same object type have to be programmed so that

they can be called several times within one transaction. For example, if,

after sales order 1 has been created, a second sales order 2 is created in

the same transaction, the second BAPI call must not affect the consistency

of the sales order 2. After completing the transaction with a COMMIT WORK,

both the orders are saved consistently in the database.

Create( ) and CreateFromData! ( )

The BAPIs Create() and CreateFromData() create an instance of an SAP

business object type, for example, a purchase order. These BAPIs are class

methods.

Change( )

The BAPI Change() changes an existing instance of an SAP business object

type, for example, a purchase order. The BAPI Change () is an instance

method.

Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP

business object type from the database or sets a deletion flag.

The BAPI Undelete() removes a deletion flag. These BAPIs are instance

methods.

Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance

of a business object type. The instance to be cancelled remains in the

database and an additional instance is created and this is the one that is

actually canceled. The Cancel() BAPI is an instance method.

Add ( ) and Remove ( ) The BAPI Add adds a

subobject to an existing object inst! ance and the BAPI and

Remove removes a subobject from an object instance. These BAPIs

are instance methods.

2) No it is not possible to connect SAP to Non-SAP systems to retrieve data

using RFC alone. RFC can acces the SAP from outside only through BAPI and

same is for vice versa access.

3) Each Bapi Object has Interface, Key Fields, Attributes,Methods and

Events.

Bapi Function Modules can be attached to these Bapi objects .Function module

has a single bound functionality while a BAPI object can contain many

functionalities

rfc vs function module

Function Module : In a function module passing data is by

call by reference in particular the tables parameter has to

by call by reference by passing memory.

RFC: In a RFC passing data is by value the reason is its

going to access other system while doing the above by

reference wouldn't work as we r into another system whose

memory id will not match,this is the basic cause for

creation of RFC.

do reward if helpful

Read only

Former Member
0 Likes
835

Hi

BAPI stands for Business Application Programming Interface.

It is a library of functions that are released to the public

as an interface into an existing SAP system from an external

system.

RFC is the protocol used to call functions in an R/3 system

by a caller external to R/3 or to call programs external to

R/3 from an R/3 system.

Functions can only be called via RFC, if they are tagged as

RFC functions in the SAP development workbench. They are

then called RFC function modules. BAPIs are complete sets of

(BAPI) function modules that model a business application.

When you are familiar with web developments: RFC can be

compared to HTTP and BAPIs are CGI applications.

In other words: A BAPI function is a function module that

can be called remotely using the RFC technology.

See the below details :

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.

RFC Vs BAPI

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 you 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. It is not possible to connect SAP to Non-SAP systems to retrieve data using RFC alone. RFC can acces the SAP from outside only through BAPI and same is for vice versa access.

RFC is the protocol used by SAP for remote communication, that is, for communications between remote (independent) systems. RFC is used for communications between two independent SAP systems, or for communications between an SAP system and a non-SAP system, such as an external application. It can also be used for communications between modules on the same system. Using the RFC interfaces you can extend the functionality of R/3 applications from an external program.

Read only

Former Member
0 Likes
835

BAPIs are technically nothing else but RFC-enabled function modules meaning that they provide us with external access to the SAP system.

However, BAPIs are more than "normal" RFC-enables function modules in that they generally access SAP business objects (like customer, sales order, etc.).

Usually, a BAPI corresponds to a certain dialog transaction dealing with a SAP business object (e.g. BAPI_USER_CREATE -> SU01 to create SAP users).

BAPIs and dialog transaction have in common that they both validate the incoming data very carefully.

For example, you may find a function module that allows you to create a user (SU01) with a wrong title. Althouth this is a minor fault you will get error messages as soon as you want to change this user using transaction SU01. The BAPI BAPI_USER_CREATE will not create a user with a wrong (i.e. not customized) title, like the dialog transaction.

In which scenarios do you use BAPIs? Most obviously, if you have to access a SAP business object but cannot use dialog.

More generally speaking, if you have either a BAPI or a normal function module which gives you the appropriate access to the business object always choose the BAPI because, as already mentioned, the interface of a BAPI is promised by SAP to be stable over several releases.

Finally, BAPIs are by no means restricted to financial operations and they have nothing to do whatsoever with object orientation (OO).

All BAPIs are RFCs , but all RFCs are not BAPIs . BAPI process a

business object and handles a busienss function completely. RFC perform a

function which process tables , files etc. but not a complete business function.

check these links

http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_cid558752_tax293481,00.html

http://www.sap-img.com/abap/interview-question-on-bapi-rfc-abap-objects-tables.htm

http://www.sap-img.com/fu033.htm

http://www.sap-img.com/abap/ale-bapi.htm

Regards

Read only

manubhutani
Active Contributor
0 Likes
835

RFC - Remote fn call.

Remote enabled FM can be called from sap only like portal

but not from java or Vb

BAPI is also a RFC but it can be called from

outside SAP like JAVA or VB.

as it is in the BOR(business object repository) of SAP

Please reward points