Tuesday, July 20, 2010

Difference between RFC and BAPI (Business application programming interface )

RFC :
External programs using RFCs can either make or receive remote function calls to or from an SAP system. Therefore, using RFCs an external program can act as either the client or the server to an SAP system. Conversely, the SAP system can take the role of either the client or the server to the external application.
You can use a combination of SAP Automation tools to incorporate remote function calls into your programming environment. SAP Automation offers several products that make programming RFCs easier. It offers products for programming of RFCs from languages such as C, C++, Java, or COM-compliant languages, such as Visual Basic and applications such as Excel.
SAP Automation also includes tools that help you browse the metadata of RFC function modules, meaning that they allow you to view the syntax of RFC functions, their parameters and fields.
Using RFCs requires knowledge of ABAP programming, because calling a remote function in R/3 is calling an ABAP function. You may also need to extend the existing set of available RFC with your own ABAP code.

BAPI :
R/3 systems contain a set of business objects, which are an object-oriented representation of real-world business objects. Examples of business objects are a purchase requisition, a G/L account, or an employee.
An R/3 system also contains Business Application Programming Interfaces (also called Business APIs, or BAPIs), which provide a programming interface to business objects. BAPIs are a set of methods for working with and manipulating SAP business objects.
Internally, BAPIs are implemented as function modules stored in the R/3 Function Builder. Each BAPI has an equivalent internally-named function module. However, you should use the BAPI and not the function module behind it, because the BAPI provides a stable, object-oriented view of R/3 applications and data. The internal function modules or even the fact that the BAPIs are implemented as function modules are not guaranteed to remain the same in future releases of R/3.
The advantage of using BAPIs over using RFCs is that using BAPIs requires no ABAP programming knowledge. You use BAPIs from standard programming languages such as C++ and Java.
Using BAPIs also offers the most stability to your application, because BAPIs stay consistent over different R/3 releases.
However, business objects and their BAPIs are created by SAP, and you can only use BAPIs that were implemented by SAP. If a certain BAPI for performing a certain application task was not implemented yet, you must seek alternative programming methods.

No comments: