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: 

RFC and BAPI

Former Member
0 Kudos

Hi ABAP experts

can u please tell me the difference between RFC and BAPI.and how it used in real time.

5 REPLIES 5

former_member181962
Active Contributor
0 Kudos

Hi Vijaya,

This is a generic query. Please search the forum and you can find lots of answeres.

Regards,

Ravi Kanth Talagana

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.

Serch in Forum there are lot of theards with the same....

Refer

https://forums.sdn.sap.com/click.jspa?searchID=10869618&messageID=3784167

https://forums.sdn.sap.com/click.jspa?searchID=10869618&messageID=2842881

Regards

Kiran Sure

Former Member
0 Kudos

Hi,

BAPIs are RFCs, the only difference is that BAPIs usually encapulate some complete business object. For example, creating a sales order, the BAPI would do all of the steps required to create a sales order

RFC is Remote Function Call - a function module, which can be called remotely from outside

BAPI is also a Remote enabled function module but the difference between BAPI and RFC is in BAPI there is a bussiness object attached to it which calls SAP application internally.

Regards,

Raj

Former Member
0 Kudos

Till now so many people ask this question but noboday can give appropriate answer to this one..i will give exact answer:

1)RFC is a direct system call means whenever you declare RFC FM within your program you must add destination 'dest name' ...so here you directly call the remote system.

But in BAPI you never call system directly..instead you just created one FM and add that one as API method in business object builder..so SAP.COMPONENT.1 will take care of this one.

2)In RFC you can handle errors using exceptions..but in BAPI you cannot handle exceptions instead you should declare one return parameter as BAPIRET2 for to get the errors.

3)Naming conventions are very important in BAPI like FM should alwalys start with 'BAPI_'.but there is no naming conventions in RFC.

4)COMMITWORK may work in RFC.butin BAPI it cannot work...instead use BAPI_TRANSACTION_COMMIT for the same.

I hope it is very helpful to you...

Reward if it helpful.

Dara.

former_member556603
Active Contributor
0 Kudos

Hi Vijaya,

BAPI

http://help.sap.com/saphelp_nw04/helpdata/en/3e/ecf226942511d2ad4b080009b0fb56/frameset.htm

BAPI,,,

Definition

The BAPI Explorer is the working environment for developing BAPIs themselves and for developing with BAPIs in an SAP System.

Use

Prerequisites

The BAPI Explorer is available as of Release 4.6A and enhances or replaces the BAPI Browser used in earlier releases. The BAPI Explorer uses the latest HTML control technology. For this reason to work with the BAPI Explorer, you must be using a SAPgui of version 4.6A.

If you are using a SAPgui from an earlier release, the BAPI Browser (Transaction BAPI45) is automatically called instead of the BAPI Explorer. For information about working in the BAPI Browser see BAPI Browser in the BAPI User Guide.

Purpose

In the BAPI Explorer, application developers can get an overview of the status of BAPIs in the BOR. The BAPIs can be determined either by the position of the associated object or interface type in the component hierarchy in the BOR, or from an alphabetical list. All information required to use a particular BAPI is provided in the BAPI Explorer.

The BAPI Explorer is used internally in SAP to develop BAPIs, but can also be used by customers and partners. The BAPI Explorer provides all the tools used to create BAPIs and the required development objects in an integrated programming environment. The entire development process of a BAPI takes place in the framework of form-controlled "projects" to achieve maximum quality, stability and usability of the BAPI.

Structure

The BAPI Explorer is divided into two areas:

Hierarchy display

Here all the business object types or interface types for which BAPIs have been defined are displayed. For further information see Working with Display Functions.

Work area

Here the details and documentation of the development object selected in the hierarchy display can be viewed.

The tools used to develop BAPIs are also available in the work area. For further information see Working with Tools and Projects.

Integration

To call the BAPI Explorer, choose Tools ® Business Framework ® BAPI Explorer. To call it directly, use transaction BAPI.

RFC HELP...

http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5b6a85b11d6b28500508b5d5211/content.htm

RFC

Purpose

Communication between applications in different systems in the SAP environment includes connections between SAP systems as well as between SAP systems and non-SAP systems. Remote Function Call (RFC) is the standard SAP interface for communication between SAP systems. RFC calls a function to be executed in a remote system.

Synchronous RFC

The first version of RFC is synchronous RFC (sRFC). This type of RFC executes the function call based on synchronous communication, meaning that the systems involved must both be available at the time the call is made.

Transactional RFC (tRFC)

Transactional RFC(tRFC, previously known as asynchronous RFC) is an asynchronous communication method that executes the called function module just once in the RFC server. The remote system need not be available at the time when the RFC client program is executing a tRFC. The tRFC component stores the called RFC function, together with the corresponding data, in the SAP database under a unique transaction ID (TID).

If a call is sent, and the receiving system is down, the call remains in the local queue. The calling dialog program can proceed without waiting to see whether the remote call was successful. If the receiving system does not become active within a certain amount of time, the call is scheduled to run in batch.

tRFC is always used if a function is executed as a Logical Unit of Work (LUW). Within a LUW, all calls

· are executed in the order in which they are called

· are executed in the same program context in the target system

· run as a single transaction: they are either committed or rolled back as a unit.

Implementation of tRFC is recommended if you want to maintain the transactional sequence of the calls.

Disadvantages of tRFC

· tRFC processes all LUWs independently of one another. Due to the amount of activated tRFC processes, this procedure can reduce performance significantly in both the send and the target systems.

· In addition, the sequence of LUWs defined in the application cannot be kept. It is therefore impossible to guarantee that the transactions will be executed in the sequence dictated by the application. The only thing that can be guaranteed is that all LUWs are transferred sooner or later.

Queued RFC (qRFC)

To guarantee that multiple LUWs are processed in the order specified by the application, tRFC can be serialized using queues (inbound and outbound queues). This type of RFC is called queued RFC (qRFC).

qRFC is therefore an extension of tRFC. It transfers an LUW (transaction) only if it has no predecessors (based on the sequence defined in different application programs) in the participating queues.

Implementation of qRFC is recommended if you want to guarantee that several transactions are processed in a predefined order.

Data transfer

All RFC types are transferred by means of CPI-C or TCP/IP. They represent a kind of Gateway Communication.

Security

Thanks,

Satya ..

Reward points if it is useful