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

RFC vs BAPI

Former Member
0 Likes
587

Hi All,

Can u tell me the big difference between RFC and BAPI.

I know Both are remote enabled.

Both we can call from external applications.

BAPI is stored in BOR.

Almost both are same but what is the difference ? Pls dont copy paste the answers, I have gone through SDN but all are above mentioned answers only.

Pls give some answers which are new and useful !!!!!!!!!!!!!!!!

Regards

RAO

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
561

Hello Rao

I am not sure if you have found some of my answers to this question already.

I like to describe BAPIs as "Dialog without dialog". What does this mean?

BAPIs do the same validations like in the corresponding dialog transaction, e.g. BAPI_USER_CREATE1 and SU01.

Underneath a BAPI you may find RFC-enabled function modules which may also provide the BAPI functionality (e.g. create a SAP user) yet they do not care much about validations.

Example:

BAPI_USER_CREATE1 eventually uses fm SUSR_BAPI_USER_CREATE to create a SAP user.

The function module may allow you to create the SAP user with a wrong title whereas the BAPI won't. The wrong title will cause problems in the dialog transaction (SU01).

Another important aspect is that BAPIs never raise exceptions but return the AEX-messages in a RETURN parameter (e.g. of type BAPIRET2).

Last but not least a BAPI should never do the COMMIT WORK itself but you have to do it after a successful BAPI call (e.g. by calling BAPI_TRANSACTION_COMMIT or BAPI_TRANSACTION_ROLLBACK).

Regards

Uwe

3 REPLIES 3
Read only

Former Member
0 Likes
561

BAPIs are a subset of Remote Function Call enabled function modules i.e. all BAPIs are RFC-enabled function modules... but not all RFC-enable function modules are BAPIs (look at the RFC* named function modules for example). Some sites use the terms interchangeably as to the ABAP coder there is little difference, but there is the extra documentation layer required for true BAPIs to describe the functionality and parameters within the BOR so that these can be "discovered" by an external application. Early BAPIs doing database updates typically did a "commit work" upon invocation, whereas the more recent style requires a second call to the "commit" BAPI to complete the database trasaction thereby faciliating 2-phase commits with an external application.

Jonathan

Read only

uwe_schieferstein
Active Contributor
0 Likes
562

Hello Rao

I am not sure if you have found some of my answers to this question already.

I like to describe BAPIs as "Dialog without dialog". What does this mean?

BAPIs do the same validations like in the corresponding dialog transaction, e.g. BAPI_USER_CREATE1 and SU01.

Underneath a BAPI you may find RFC-enabled function modules which may also provide the BAPI functionality (e.g. create a SAP user) yet they do not care much about validations.

Example:

BAPI_USER_CREATE1 eventually uses fm SUSR_BAPI_USER_CREATE to create a SAP user.

The function module may allow you to create the SAP user with a wrong title whereas the BAPI won't. The wrong title will cause problems in the dialog transaction (SU01).

Another important aspect is that BAPIs never raise exceptions but return the AEX-messages in a RETURN parameter (e.g. of type BAPIRET2).

Last but not least a BAPI should never do the COMMIT WORK itself but you have to do it after a successful BAPI call (e.g. by calling BAPI_TRANSACTION_COMMIT or BAPI_TRANSACTION_ROLLBACK).

Regards

Uwe

Read only

Former Member
0 Likes
561

Hi,

BAPIs are RFCs, the only difference is that BAPIs usually encapulate some complete business object. For example, creating a sales order, the BAPI would do all of the steps required to create a sales order.

Regards

Kiran Sure