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.
BAPI: sap.com/saphelp_nw04/helpdata/en/7c/3ce38765ba11d395fe00a0c94260a5/frameset.htm