‎2007 May 08 9:28 AM
Dear Friends,
I have seen a few thread explaining the difference between BAPI and RFM(Remote-enabled function Modules) from functional point of view. I know that there are cases when both are available in BOR. Both can be implement using Object Oriented Technology.
Can any tell me how they differ from techincal point of view ? OR Are they same techinically ?
Thanks in advance,
Rajesh
‎2007 May 08 9:33 AM
Hello Rajesh
Technically BAPIs and RFC-enabled function modules are the same. Importantly, both have absolutely NOTHING to do with object-oriented technology.
There are a few differences between BAPIs and RFCs:
- BAPI does not throw any exceptions but returns the collected (error) messages
- BAPI usually does not do COMMIT WORK -> if no error message is returned call BAPI_TRANSACTION_COMMIT afterwards (in case of error BAPI_TRANSACTION_ROLLBACK)
Furthermore, BAPIs are much more scrupulous in validating the incoming data. For example, you may be able to find a RFC-function module that allows you to create a SAP user with a wrong title key that does not exist in the customizing tables. Although this is a minor error the BAPI will not allow you to create such a user but return an error message that the title key does not exist.
Regards
Uwe
‎2007 May 08 9:33 AM
1.Execptions not BAPI.
2.Comming work not in BAPI.
Regards
Prabhu
‎2007 May 08 9:33 AM
Hello Rajesh
Technically BAPIs and RFC-enabled function modules are the same. Importantly, both have absolutely NOTHING to do with object-oriented technology.
There are a few differences between BAPIs and RFCs:
- BAPI does not throw any exceptions but returns the collected (error) messages
- BAPI usually does not do COMMIT WORK -> if no error message is returned call BAPI_TRANSACTION_COMMIT afterwards (in case of error BAPI_TRANSACTION_ROLLBACK)
Furthermore, BAPIs are much more scrupulous in validating the incoming data. For example, you may be able to find a RFC-function module that allows you to create a SAP user with a wrong title key that does not exist in the customizing tables. Although this is a minor error the BAPI will not allow you to create such a user but return an error message that the title key does not exist.
Regards
Uwe
‎2007 May 08 9:45 AM
Dear Uwe,
Thank you for your answer.
Not having Exceptions and COMMIT WORK are standards followed in BAPI, but techinically one can create exceptions and COMMIT WORK in BAPIs, right ?
I mean does SAP stop us from doing them if we tried to do so ?
Thanks,
Rajesh
‎2007 May 08 10:04 AM
Hello Rajesh
The usual way of calling a BAPI is:
(1) Call BAPI on remote system -> if successful then -> Call 'BAPI_TRANSACTION_COMMIT'
(2) Call BAPI on remote system -> if failed then -> Call 'BAPI_TRANSACTION_ROLLBACK'
If you intend to create your own BAPI (which, I believe, is nonsense) you can COMMIT WORK within your BAPI and you can raise exceptions but you should not do either of them because
- BAPIs are supposed to NOT commit work themselves
- the RFC connection will break down if you raise an exception within the BAPI
Regards
Uwe
‎2007 May 08 10:06 AM
hi,
Remote Function Call:
RFC is an SAP interface protocol.
Based on CPI-C, it considerably simplifies the programming of communication processes between systems.
RFCs enable you to call and execute predefined functions in a remote system - or even in the same system.
RFCs manage the communication process, parameter transfer and error handling.
http://help.sap.com/saphelp_47x200/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm.
BAPI
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 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.
Regards
Reshma
‎2008 Jun 04 2:57 PM
Hi Rajesh
Some of the idifferences between BAPIs and RFM are:
1) BAPI can be invoked from anywhere while a RFM cannot.
2) BAPI does not COMMIT WORK.
3) BAPI doesn't throw an exception. Instead it collects error messages.
Regards
Harsh