5 minute read

IDoc Message Type and IDoc Basic Type - IDoc Basics Explained

IDoc – Conceptual differentiation

IDocs are a vital tool for the import and export of data to and from an SAP system. The basic idea behind an IDoc was introduced in a previous blog post.

Unfortunately, the term IDoc is not always used consistently. An ABAP programmer may understand something different when referring to an IDoc, than an SAP consultant or EDI project manager for example. In this post we want to define the following five IDoc terms and take a closer look at their specific concepts.

  1. IDoc Instance
  2. IDoc File
  3. Logical Message Type
  4. IDoc Basic Type
  5. IDoc Extension Type

IDoc Instance

In computer science an instance is an occurrence of an object during the runtime of a program. An IDoc instance is of no difference here — it is a concrete occurrence of a document object.

IDocs are stored internally in a persistent manner in the database in SAP, whereby the following tables are filled:

  • EDIDC
    Contains one Control Record per IDoc with one unique IDoc number.
  • EDID4
    Contains one or more Data Records. The reference to the Control Record is done via the unique IDoc number.
  • EDIDS
    Contains one or more Status Records. The reference to the Control Record is done via the unique IDoc number.

Usually the user will not access the database tables directly but use the appropriate SAP transaction, like BD87. The following image shows IDoc Nr. 1068215 in transaction BD87.


IDoc Instance in transaction BD87
IDoc Instance in transaction BD87

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

File

To exchange an IDoc between SAP and an external system, an IDoc instance will be serialised to an export format and written into a physical file. There are two ways to represent the data – ASCII-based IDocs or XML-based IDocs. Modern SAP systems predominantly make use of XML-based IDocs.

The following image shows an XML IDoc of a delivery forecast. This XML IDoc was sent to the SAP system where it was saved as IDoc Nr. 1068215.


IDoc XML-file
IDoc XML-file

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

The hierarchy of the IDoc as seen in the XML tree is similar to its display in transaction BD87. The following image shows the stored IDoc 1068215 in transaction BD87.


IDoc tree in transaction BD87
IDoc tree in transaction BD87

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

Logical Message Type

The message type describes the type of business document in an SAP system – e.g., an ORDERS IDoc message type is used to describe — as the name already indicates — an order document. A message type can support different use cases. The message type ORDERS for example can be used for an outbound order (sent to a supplier) or an inbound order (received from a customer).

In an IDoc XML, the logical message type can be found in element <MESTYP>, a sub element of <EDI_DC40>. This is also depicted in the XML screenshot of the IDoc further up this post.

The logical message type defines which application logic is being applied to the IDoc in the SAP system. Thus, the logical message type provides the connection between the structure of the information and the application logic.

The structure of the logical message type is further described by the IDoc basic type, which we will present in the next section.

White Paper - EDI Integration in SAP

IDoc Basic Type

The IDoc basic type provides the structure for the logical message type. The following image shows the structure of IDoc Nr. 1068215 in transaction WE19. In this case the utilized IDoc basic type is DELFOR02.


IDoc structure in transaction WE19
IDoc structure in transaction WE19

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

The IDoc basic type can manifest itself in multiple logical message types. An ORDERS05 basic type is the foundation for an order (ORDERS), an order change (ORDCHG), an order response (ORDRSP), a quote request (REQOTE) etc.

In the XML representation of an IDoc, the basic type can be found in element <IDOCTYP>, which is a sub element of <EDI_DC40>.

To get a list of all basic types and their logical message types, one may start a query via the following three tables.

  • EDIMSG (Message types and their assigned IDoc types)
  • EDBAS (Basic types)
  • EDBAST (Short description of the basic type)

It is possible to use the QuickViewer under transaction SQVI to access these tables.


IDoc tables in QuickViewer
IDoc tables in QuickViewer

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

The two logical message types for the IDoc basic type DELFOR02 are for example DELINS (Delivery Schedule) and DELJIT (Delivery Schedule Just-In-Time).

IDoc Extension Type

An IDoc extension type is an IDoc basic type with one or multiple additional segments. Following the SAP naming convention, IDoc extension types begin with a Z.

Any questions?

Do you have any further questions about IDocs, SAP or Electronic Data Interchange? Please do contact us or use our chat — we’re more than happy to help!

 

SAP ERP and SAP S/4HANA are the trademarks or registered trademarks of SAP SE or its affiliates in Germany and in several other countries. 

Subjects

most read

Keep on reading

3 minute read

How to create an SAP transaction code

Want to know how to create an SAP transaction code for an existing ABAP program so that you can easily call the program?

6 minute read

How to Set Up and Manage Automatic SAP Jobs

SAP jobs can be used to automate processes in SAP ERP so they can be carried out without user intervention. We explore the key features.

4 minute read

IDoc Status Change in SAP ERP

IDoc statuses are not always the clearest - particularly when errors occur. In this article we explain how to change IDoc status as required.

5 minute read

How Can I Add an Entry to an SAP Table?

In this article we show how to add entries to an existing SAP table - even if it does not have its own maintenance dialog.

5 minute read

Alternatives to the Seeburger PI Adapter

The end of maintenance for the Seeburger PI Adapter is imminent. What alternatives are there and which is the best suited for your business?

4 minute read

IDocs in SAP S/4HANA: The Differences to SAP ECC 6.0

The change to S/4HANA also impacts the format of IDocs. In this article we explore IDocs in S/4HANA and the new and changed elements.

11 minute read

Migration to SAP S/4HANA - 5 Key Considerations

Are you prepared for migration to SAP S/4HANA? Discover the 5 key questions all businesses looking to upgrade to SAP's new ERP system should consider.

11 minute read

Exchange of Electronic Invoices with the SAP eDocument Framework

Companies have to increasingly implement e-Invoicing for different countries. This blog post explains how the SAP eDocument Framework can help you.

2 minute read

How Can You Save an IDoc from SAP on Your Hard Drive?

Wondering how to export IDocs as a file on your local computer? We created a handy guide!

5 minute read

Create and Process UBL Documents with Attachments in SAP

Enable your SAP solution for UBL based e-Invoicing over Peppol. Click here for an example case based on the XRechnung in Germany.

6 minute read

IDoc Processing in an SAP ERP System with Transaction BD87

Companies utilising SAP ERP and exchanging documents need a central tool to manage, view and search for IDocs. Transaction BD87 is the answer.

12 minute read

Understand and Interpret the SAP IDoc Control Record EDI_DC40

A correctly filled control header is essential for the identification and processing of IDocs. We show what settings are needed in SAP.

We use cookies to provide an optimal website experience. You decide which one you want to allow. Depending on the setting, however, not all functionalities may be available to you. Data protection & imprint.