idoc

How IDoc are stored/used in SAP


I am struggling to understand how IDoc are used in SAP. What an IDoc is I understand but I have a few questions about how this IDoc are used by SAP (can't find such details on sap blog):

  1. In SAP database all the tables are stored in IDocs? For example, if I create table employees with 4 records, the entire table will be stored in the body of an IDoc?
  2. Is possible to make a query in the database and to receive the information as an IDoc?
  3. In connection with the above question. In SAP are predefined types of IDocs (video to create an IDoc in SAP)? Or we can create various types of IDocs (for example I create an IDoc, in its body I put some text and send it to an SAP system)?
  4. An IDoc has many segments, how should I decide which of them should I use? (like the guy from above video)

PS: I am new with SAP and all these things are new for me.

Thank you for your patience.


Solution

  • If you are still looking for clarification regarding IDocs, I recommend the SAP Learning Hub ebook on ALE (application link enabling). It offers a technical and conceptual summary of IDoc technology and its use in SAP.

    To answer a few of your questions, yes, there are predefined IDoc types. Together, the basic type and message type characterise the structure and data to be sent in the IDoc.

    The IDoc itself consists of:

    1. Control Record: this is the metadata, where information concerning the IDoc type and details of sending and receiving systems are stored.
    2. Data Records: this is where the information (stored in segments) that you are sending can be found.
    3. Status Records: contains information concerning whether the IDoc transfer was successful. If the IDoc fails, you can investigate the potential reason by looking at the status codes here.

    The segments that you use will be defined by the configuration and business requirements of the SAP system you are working in. You can append the segments and create customer defined types, but, as there are so many predefined IDocs, there will likely already exist something you can use. 

    IDocs are intended to be used in integration scenarios. They can be used to send data out of an SAP system or to receive data into an SAP system. IDocs are designed for data exchange between, rather than within, a system. They can be sent to other SAP systems or to non SAP systems, depending on business requirements. This is their main purpose in SAP.

    If you are interested in the process of configuring an ALE scenario for a specific business process, this blog post provides a thorough example:

    https://blogs.sap.com/2012/10/08/ale-distribution-of-cost-center-and-gl-account-master-data-across-sap-systems-through-idocs/