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.
cancel
Showing results for 
Search instead for 
Did you mean: 

what is tne main difference between bapi and function module and bdc ?

Former Member
0 Kudos

hi,

i am having high confusion in diffrences amoung the bapi , function module and bdc.

plz send the differences amoung those if possible give simple examples regarding those topics

5 REPLIES 5

Former Member
0 Kudos

Difference between BAPI and FM:

BAPI stands for Business API(Application Program Interface).

A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface. You can make your function module remotely enabled in attributes of Function module but BAPIs are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).

Both Function Modules and BAPIs can be Remote Enabled and we can create both custom BAPIs and custom Function Modules. The Main difference between a BAPI and a Normal Function module is that a BAPI does a specific Business Process, for example creating sales orders, while Function module performs specific functions, which forms a part of a Business Process.

Another difference will be that the BAPI will return the Status of the Execution using the "Return" table and for Function modules we use the sy-subrc check to determine the Status.

While accessing an SAP system through an RFC, BAPI is preferred to a Function module, as the External user will be more aware of the Business Processes in SAP rather than the Business Functions.

The most important BAPI-specific requirements for function module coding are as follows:

A BAPI must not execute a COMMIT-WORK command.

The database can only be changed by updating.

A BAPI cannot display anything on the screen, that is, it cannot create lists, queries or dialog boxes. This is valid not just for the BAPI itself, but also for all function modules called indirectly from the BAPI.

You cannot use exceptions in a BAPI. Instead, all error messages are returned to the calling program using the standardized parameter Return.

A BAPI itself cannot cause program termination, it can only return the corresponding message (message type A, termination message) in the return parameter.

Difference between BAPI and BDC:

BAPI is used only when it is available for the particular transaction like Delivery Sales order. but BDC can be used for any transaction which have screen and fields.

BAPI is directly updated the database instead BDC run through the screen flow.

So BAPI can't handle all the flow logic checking and enhancement put by programmer to faciliate the user requirement.

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

I hope it helps.

Thanks,

Vibha

Please mark all the useful answers

Former Member
0 Kudos

Hi,

1)

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

In BDC we need to specify (while recording) all the standard validation in all the screens, exclusively in program.And a note of all screen data is also to be given in BDC (i.e Dynrpro,fnam,fval etc).

But all these can be avoided in BAPI. BAPI will skip all the screen data and includes all the default validations by itself without any need of Explicit specification.

Using BDC screen Flowlogics must be specified(Dynpros Program FNAM and FVAL).

But BAPI's having it's defined structure in it's separate Function Modules.

2)

BAPI methods 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.BAPI is having all Key fields, methods, interfaces etc.These are the main differences which I know.

Reward if it useful.

Thanks in advance.

Lakshmi

Former Member
0 Kudos

Hi,

RFC and BAPIs are remote enabled function modules. They are practicly the same. A BAPI is one step further as it usually is a self contained business function, such as "Create Purchase Order", or "Change Sales Document". BAPIs interface is very well defined and documented. BAPIs can be found in the BAPI browser via transaction BAPI. RFCs are just remote enabled function modules.

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.

Regards

Kiran Sure

Former Member
0 Kudos

Hi,

BAPIs are RFC enabled funtion modules and are published in transaction BAPI. They usually do an end-to-end business transaction, such as "Create a PO". Also BAPIs will not RAISE exceptsion like other FM, the errors are pass baced via the RETURN parameter. This is because they are designed to be called outside the system as well as internally.

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.

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

. Which is better to use BAPI or BDC?

BAPI is always better.

2. a) Very easy to use (Just like FM)

b) In future, if screen sequence changes, then we have to change BDC,

whereas sap guarantees the corresponding compatibilty/change

in BAPI.

c) Recording/screen sequence/programname/screen fieldname,

--- all these things are not required to be explored & recorded.

Regards,

Raj.

Former Member
0 Kudos

BAPI is used only when it is available for the particular transaction like Delivery Sales order. but BDC can be used for any

transaction which have screen and fields.

BAPI is directly updated the database instead BDC run through the screen flow.

So BAPI can't handle all the flow logic checking and enhancement put by programmer to faciliate the user requirement.

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

Rewards would be Appreciated