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: 

Difference between Function Modules, RFCs and BAPIs...

Former Member
0 Kudos

Hi,

Can you please clear me the difference between

1. Function modules,

2. RFCs,

3. BAPIs..

Please provide me some examples..

BR,

Thiru

5 REPLIES 5

former_member583013
Active Contributor
0 Kudos

<b>Function Modules</b> --> A reuseable piece of code.

Ex. SD_DATETIME_DIFFERENCE.

<b>RFC</b> --> The same a Function Module but allow external connection.

Ex. RFC_READ_TABLE.

<b>BAPI</b> --> Function Modules used for high traffic of for invoice transacctions.

Ex. GL_POSTING_POST.

Greetings,

Blag.

0 Kudos

Function modules are modularzation elements in the ABAP programming language. The encapsulate some function that can be reused. They provide an interface or signature in which to pass data to and from the function module. RFC is a remote enabled function module. All you need to do is set the flag on the attributes tab of the function module and you have an RFC. A BAPI is nothing more than a function module. BAPIs usualy contain the logic for some business function, like "Create Sales Order", or "Change Purchase Order". Again they provide an interface to pass data to and get data from the BAPI. You will never see "Exceptions" in a BAPI as they are designed to be called from other systems, and may no be able to handle exceptions. Also, you will never see a BAPIs signature change. If SAP feels the need to change the signature of the BAPI, then will create a new bapi. Example, is BAPI_SALESORDER_CREATEFROMDAT1 and BAPI_SALESORDER_CREATEFROMDAT2. They won't change the signature, but they will create a new one and incorporate the change.

REgards,

Rich Heilman

Former Member
0 Kudos

All of them are function modules in their implementation except that BAPI's can rarely be something other than a function module.

RFC and BAPI are callable remotely(from a system other than from within SAP).

BAPI is the implementation of the method of a business object.

So, BAPIs are RFCs and RFCs are function modules if you look at it that way.

Srinivas

Former Member
0 Kudos

Well, according to BAPI help, a BAPI is a:

Standardized programming interface enabling external applications to access business processes and data in the R/3 System.

BAPIs are defined in the BOR as methods of SAP business object types that carry out specific business functions.

BAPIs are implemented as RFC-enabled function modules and are created in the Function Builder of the ABAP Workbench.

BAPIs are a subset of RFC enabled function modules in that they are released to the customer and correspond to a logical unit of work.

RFC enabled FMs are a subset of general function modules, but are able to access other R3 systems.

Rob

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please mark your post as a question, and remember to award points for helpful answers and mark you posts as solved when answered completely.. Thanks.

Regards,

Rich Heilman