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

RFM and BAPI

Former Member
0 Likes
2,330

Hi All,

I am Confused with difference between RFM and BAPI,

I know Both are Function Modules which are RFC enabled.

Since we can call both RFM's and BAPis from Jco program,

For a given functionality, On what Factors does it depend whether :

i have to create just a RFM

OR

Register the same RFM a an API method to some Business Object.

please help me understand..

Thanks

-Ravi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,726

Hi ravi,

RFM: RFC-enabled Function Module

A RFM is an ABAP function module (similar to function or subroutine in other languages) that can be remotely invoked. An RFM takes some parameters as input, and after execution, returns some output parameters. You can view a RFM in the SAP system via transaction SE37.

BAPI: Business Application Programming Interface

A BAPI is a method of a business object defined in the Business Object Repository (BOR). For example, in the BOR, you can find a business object called SalesOrder, which conceptually represents a sales order in the system. A business object typically has several methods that can be used to read, create, modify a particular instance of the business object, or list instances of the business object matching certain selection criteria. These methods are BAPIs. Technically, a BAPI is implemented using a RFM. But, unlike the non-BAPI RFMs, a BAPI is usually well documented, has nicer parameter names, and is supported by SAP for several SAP software releases. You can browse Business objects and BAPIs in the SAP system using transaction BAPI.

RFM and BAPI are typically invoked synchronously. The caller initiates the RFM/BAPI call, the called system (typically a SAP system) executes the RFM/BAPI, and returns the results back to the caller. The SAP RFC protocol is used for RFM/BAPI invocation.

below links might give u more information.

/people/sap.user72/blog/2004/07/19/navigating-the-maze-of-integration

http://snvworld.net/StartPage/documents/integration/3.html

if it helps you reward with points and close the thread.

regards

venu.

7 REPLIES 7
Read only

Former Member
0 Likes
1,727

Hi ravi,

RFM: RFC-enabled Function Module

A RFM is an ABAP function module (similar to function or subroutine in other languages) that can be remotely invoked. An RFM takes some parameters as input, and after execution, returns some output parameters. You can view a RFM in the SAP system via transaction SE37.

BAPI: Business Application Programming Interface

A BAPI is a method of a business object defined in the Business Object Repository (BOR). For example, in the BOR, you can find a business object called SalesOrder, which conceptually represents a sales order in the system. A business object typically has several methods that can be used to read, create, modify a particular instance of the business object, or list instances of the business object matching certain selection criteria. These methods are BAPIs. Technically, a BAPI is implemented using a RFM. But, unlike the non-BAPI RFMs, a BAPI is usually well documented, has nicer parameter names, and is supported by SAP for several SAP software releases. You can browse Business objects and BAPIs in the SAP system using transaction BAPI.

RFM and BAPI are typically invoked synchronously. The caller initiates the RFM/BAPI call, the called system (typically a SAP system) executes the RFM/BAPI, and returns the results back to the caller. The SAP RFC protocol is used for RFM/BAPI invocation.

below links might give u more information.

/people/sap.user72/blog/2004/07/19/navigating-the-maze-of-integration

http://snvworld.net/StartPage/documents/integration/3.html

if it helps you reward with points and close the thread.

regards

venu.

Read only

Former Member
0 Likes
1,726

BAPIS are implemented as RFC enabled FMs. The difference to a "normal" RFC enabled FM is that a BAPI has to (should) adhere to certain development standards, like naming conventions, exception handling, commit handling and so on. Also official BAPIs from SAP are guaranteed to have a stable parameter interface and are supported.

If you develop your own functionality to use with a JCo call it is of less importance if the FM are registered AS BAPIs or not.

Some external tools reads the BAPI metadata though...

Read only

0 Likes
1,726

HI,

Thanks for your Repsonse, I see in the WEBLOG that was post sent in the earlier that :

"BAPIs are supported by SAP for several SAP software releases".

How are they Supported? Can i get a Better Understanding or can i get a link to any Document which can explain me the same. Does it mean that RFMs are not supported.

I have a couple of RFMs which work perfectly from JCo, but when i try to assign the RFM as a API method for a Business Object, it does'nt. It only works when i change some import parameters data types and remove exceptions etc .... Why is the BAPI definition stricter than RFM, even though both can be called externally doing the same JOB.

Thanks.

Ravi.

Read only

0 Likes
1,726

check this out

<a href="http://help.sap.com/saphelp_47x200/helpdata/en/a5/3ec81b4ac011d1894e0000e829fbbd/frameset.htm">BAPI Programming Guide</a>

Regards

Raja

Read only

0 Likes
1,726

HI

I have a bunch of RFMs Developed for the functionality to be used from the JCo. Should i release them as BAPIs or just leave them as RFMs.

If i had to Deploy these RFMs or BAPIs onto VARIOUS SAP systems(totally different R/3 Installation) and then test my JAVA application. What are the Pros/Cons if i deploy them as RFMs or if i deploy them as BAPIs.Which is better?

Thanks

Ravi.

Read only

0 Likes
1,726

Hi Ravi,

I don't think you should worry yourself about this. As far as accessing from Jco is concerned RFC/BAPI are the same. Only added value I get from BAPI is that it guarantees a standard behaviour from SAP, e.g. If I am using BAPI_PO_CREATE, I am sure that it will create the PO in the same way regardless of the version of SAP Application (R3). The benefit I get is if with SAP newer versions, responsibility of making sure this BAPI (RFC for me) works with the new system is with SAP not with Me. But when we talk about custom developed RFC/BAPI, we can not expect that benifit. So if I do anything additional to register this RFC as BAPI, it is a waste of effort.

Cheers,

Sanjeev