Register Login

Use of BAPI, RFC and IDOC in SAP XI

Could any one tell me why we some time use BAPI, and some times use RFC and some times use IDOC while communicating with the SAP systems.

Is there any differences while using the same.

RFC and BAPI are same as per the technical point of view both are remote enabled function module..

BAPI is provided by SAP while RFC is created by a developer..

IDoc is another proprietary technology of SAP for exchnaging messages .

Difference lies here :

1. For RFC/BAPI you need to use RFc adapter while for IDoc you need to use IDoc adapter..

2. For RFC you need to create RFC destinations not for Idoc

3. For Idoc you also need to manage Partners Profiles..inn R3..

These are few differences in using RFC/BAPI and Idoc...not the only ones..

RFCs are used when the caller and the called function module run in the same system.

In the SAP system, these functions are provided by the RFC interface system. The RFC interface system enables function calls between two SAP systems, or between an SAP system and an external system.We get information in response to RFC no functional acknowledgement will b received.

IDOC is just a predefined structure like where in u would post them to your peer in distributed environment.As a response u can get functional acknowledgement for the IDOC which is being sent.

RFC is used when we need to get the details from the Rs system.

For example you have a company number coming from the file and you need to get the company information from R3 system for that company number that time you use the RFC. SO you send a request to R3 system and you get the response back from R3 system to XI.

As said IDOC is async its intermidiate doucments which has the predetrmined strucutre and which holds data for transfer between systems.



  • 02 Aug 2008 12:21 am Guest
    I think you have missed the point. RFC is for remote connectivity. IDOC is for remote connectivity through the ALE layer.

    End app --> RFC layer --> Application layer


    End app --> RFC layer --> ALE layer (Idoc) --> Application layer

    The value over RFC is the ALE framework is best suited to reliable asynchronous communication. It is tru that tRFC and qRFC manage a reliable exchange of messages, but thay are not messaging frameworks like ALE. ALE is full featured messaging framework, not just asynchronous communication.

    sRFC (the default approach to RFC) is not considered reliable but a "best effort" communication approach. With best effort you must accept that your message can go missing without a trace, or accidentally be delivered twice depending on the implementation.

    If you cannot accept those side effects, then you need a reliable approach, such as tRFC or qRFC. But in that case you are better off with the full featured ALE layer (IDoc).