Skyline view of New York City, this is to show the breadth of buildings similar to the complexity of SAP S4 HANA master data Management MDM

Simplify Your SAP S4 HANA Master Data Experience

The complex world of SAP S4 Hana Master Data

SAP S4 HANA IDOCs for Master Data Consultants

Today I want to help you learn everything you need to know about SAP IDOCs from a functional consultant perspective. We aren’t going to dive into the technical or how to add fields to IDOCs in SAP. What we will do is give an overview of what an IDOC is & what you need to know about it especially for master data work. Then we will go into how to navigate from a functional consultant perspective.

In this article we will explore the following topics related to IDOCs in SAP S4 HANA:

What is an IDOC in SAP S4 HANA?

Without getting technical an IDOC in SAP is a means for SAP to send data from SAP to another system or from another system to SAP. It stands for Intermediate Document. The IDOC usually has all or most of the required data for a specific object such as a customer/vendor/material/sales order/purchase order etc. In this post we will discuss mainly around master data IDOCs in SAP. An SAP IDOC has a structure that is usually similar to the underlying tables of the IDOC.

First let’s go over the basics of an SAP IDOC

  1. SAP IDOC Basic Type: This determines what type of object is relevant along with the structure in which that object will be stored
    1. Example: DEBMAS07 is customer master data distribution IDOC (the 07 represents the 7th edition based on upgraded SAP systems)
  2. SAP IDOC Segment: This is a grouping of fields that typically represents an underlying table or subset of a table
    1. Example: E1KNA1M is Master Customer Master Basic Data (KNA1 table)
  3. SAP IDOC Segment Fields: This is similar to the fields in a table and each segment has a list of relevant fields
    1. Example: Within the E1KNA1M segment there is a NAME1 field that represents the name of the customer
  4. SAP IDOC Message Type: Higher level grouping of IDOC basic types representing an object
    1. Example: DEBMAS represents customer master as an object (there can be multiple IDOC basic types assigned to this single object. For example a version for the standard SAP system and a version for the retail extension)

Okay let’s make this visual with a quick walk through of an IDOC structure using Tcode WE30. The Tcode WE30 in S4 HANA will give a view of the structure of any IDOC. First we select an IDOC type then click the glasses IDOC to view. In this case DEBMAS07 is the IDOC BASIC TYPE

This is a view in SAP S4 HANA with TCODE WE30 to view an SAP IDOC basic structure
WE30 transaction showing the structure of an IDOC in SAP S4 HANA
This shows all the segments within an IDOC example DEBMAS07 in SAP S4 HANA
Example of WE30 Tcode viewing the DEBMAS07 IDOC type in SAP S4 HANA

As you can see in the screenshot the segment names often correspond with the underlying table name for example E1KNB1 segment is representative of the KNB1 table in SAP. You can also see the hierarchical nature of the IDOC with E1KNA1M as what’s called the header segment. This is representative of the main object table in this case KNA1 which is the general customer master data. Let’s take a look inside one of the IDOC segments so we can see the list of fields available. Double click on a segment and then select the segment editor field

In SAP S4 HANA this is the DEBMAS07 IDOC type and we are selecting the E1KNB1M segment of the IDOC
Display of selecting the E1KNB1M segment in the DEBMAS07 IDOC
This is a view of the E1KNB1M segment of the DEBMAS07 IDOC and shows the list of example available fields that matches the KNB1 table in SAP
View of the E1KNB1M segment fields within SAP IDOC

Here you can see within the IDOC segment E1KNB1M you can see the list of IDOC segment fields that if you are familiar with the customer master data object will be the same as the field names in the KNB1 table. Additionally, to the far right you can see the length of this field. If you’d like additional information on the IDOC, the Tcode WE60 can be used to get additional information

Now that you are familiar with the structure of the IDOC, let’s take a look at an example of an IDOC with data in the system. In order to view IDOCs either in to SAP or outbound from SAP utilize the Tcode WE02. WE02 Tcode will allow you to have a selection criteria to view IDOCs in your system. The WE02 Tcode also allows you to view the data within the IDOCs

This is the initial view of tcode WE02 in SAP S4 HANA in order to find IDOCs. There are a number of different search options available on the initial screen
Tcode WE02 in SAP S4 HANA

In order to filter in WE02 you can include a basic type or a direction, make sure to update the created on date if it is an IDOC in the past. After the list of IDOCs becomes available double click on an IDOC to get a view of the data within that IDOC. On the left hand side you will see all the segments in hierarchal fashion that have data included. In this example I will double click on the E1KNA1M segment of the IDOC.

Screen showing WE02 tcode with example IDOC
SAP IDOC in WE02

After selecting the E1KNA1M segment lets take a look at some of the data that is included

This shows an example of the data included in the E1KNA1M segment of an IDOC
Example view of the E1KNA1M segment of an IDOC in SAP

This now shows by field what data is included within this IDOC. Currently to view the data you need to go segment by segment. However there are two navigation options of either printing the IDOC which will allow you to download to excel or the data display icon will allow you to navigate quickly throughout the data contained.

IDOC Basic Types relevant for MDM

Now that you’re comfortable with what an IDOC is, let’s go over some of the basic types of SAP IDOCs that are relevant for MDM

DomainIDOC Basic TypeDescription
MaterialMATMAS04Material Master IDOC
MaterialCLFMAS02Material Master Classification Ddata
CustomerDEBMAS07Customer Master IDOC
VendorCREMAS06Vendor Master IDOC
Customer/VendorADRMAS03Address data for customer/vendor (ADRC)
Business PartnerBUPAFS_FS_CREATE_FRM_DATA201Business Partner Create IDOC
Main Master Data Objects and Their Relevant IDOCs

Now that we have the key IDOCs for MDM let’s get into the processing & status of IDOCs in the system

IDOC status & processing

Without getting into the technical settings of IDOC set up which is a topic for a future post there are basically two options for inbound and outbound IDOC processing. Either the IDOCs are posted/sent immediately (there are a lot of drawbacks to this method for large processing) or the IDOCs are put into a holding status for in order to be processed in a batch. Let’s first go over the potential status of an IDOC. I will not go over the exhaustive list, assuming your system is configured properly the below status are the common status’s for an IDOC

Let’s take a look at the key outbound status & how to proceed. As a note remember any program can be performed using the Tcode SA38 and entering the program name

IDOC statusIDOC status descriptionNext Step
30IDOC ready to be passed to ALE (The IDOC is in a holding status waiting for a batch job to run in order to push it outbound from the system)Run the program RSEOUT00 and push the IDOCs from the system
3IDOC has been successfully pushed outbound from the systemN/A
Common outbound status for an IDOC

Now let’s take a look at the key inbound status & how to proceed

IDOC StatusIDOC status descriptionNext Step
64IDOC ready to be transferred to application (The IDOC is in a holding status waiting for a batch job to run in order to process the inbound idoc)Run the program RBDAPP01 to process the IDOCs (BD20 Tcode)
53Application Document Posted (The IDOC has been processed and data has been updated in the system)N/A
51Appli­cation doc­ument not pos­ted (the IDOC has moved into an error status)Review the reason for error. Once the root cause issue has been resolved, it can be reprocessed using the program RBDMANI2
Common inbound status for an IDOC

In order to check the status of an IDOC navigate to the Tcode WE02 and double click on an IDOC, the status will be displayed on the left hand side. It includes all the previous status as well as the current which will be the one displayed at the top. In the example below 64 is the current status.

View of how to determine the status of an IDOC in SAP S4 HANA
View of Status of an IDOC in SAP S4 HANA

What if you want to manually change the status of an IDOC? Be careful with this transaction, the best use case is often failed inbound IDOCs that shouldn’t be reprocessed can be changed to 68 status which is archived. In order to perform this activity utilize the following program RC1_IDOC_SET_STATUS. The program is fairly simple, make sure they you have the current IDOC status along with the proposed status and the IDOC numbers. Make sure to turn off test mode

View of the how to change IDOC status in SAP S4 HANA using program RC1_IDOC_SET_STATUS
How to change the status of an IDOC in SAP S4 HANA using RC1_IDOC_SET_STATUS

IDOC Processing

Let’s take a quick look at IDOC processing and how to fine tune this process to increase performance. The standard option in the program RBDAPP01 (Tcode BD20) is sequential processing. Tcode BD20 is the primary tcode used in order to process IDOCs that are awaiting in status 64. In this case the system will process the IDOCs one after another in packets which is relative to the pack size field which in the below screenshot is 5

IDOC inbound processing screen in SAP S4 HANA. This shows Tcode BD20 which is program RBDAPP01
IDOC inbound processing screen in SAP S4 HANA. This shows Tcode BD20 which is program RBDAPP01

The pack size should be related to how large (how many segments and fields of data) each IDOC will be approximately. For example if there are nearly 100 segments in each IDOC or more the parameters should be low if not 1 in order for the system to be most effective. Additionally pack size will determine how many objects are locked in the system during processing. If there are other programs trying to access the same object and the pack size is high it can cause locking issues in the system.

Now let’s look at the fun part to make this processing a whole lot faster. Parallel processing is an option for both the initial processing of an IDOC and the re-processing of failed IDOCs (Program RBDMANI2). Parallel processing allows the system to process multiple packets of IDOCs at the same time. The pack size is still relevant but that will be multiplied by the number of parallel processes to determine how many IDOCs will be processed at the same time. Let’s give a quick example, if you have a packet size of 5 and max number of parallel processes as 10 that means the system will break IDOCs into 10 groups of 5 that will be processed at the same time. Meaning 50 IDOCs being processed at once. If you had a pack size of 1 and parallel processing of 10 that would mean 10 IDOCs get processed at once. You will want to talk with your basis team on how many parallel processes are available when playing with these parameters. Let’s take a quick look at the parallel processing tab

First make sure to check the parallel processing active & the wait for end of processing, then enter a server group (provided by basis) and your max number of processes (this is how many parallel items can happen at the same time)

Example of the settings for parallel processing in SAP S4 HANA program RBDAPP01 (Tcode BD20)
Example of parallel processing settings for SAP IDOC

Now if you want to monitor the performance of IDOC processing it’s a little difficult to get these numbers from the WE02 Tcode to view IDOCs. There is a Tcode BD87 that allows you to view numbers more easily and get a view of the top errors. Let’s take a quick look at this Tcode

In the example below we are going to look at all IDOCs with the message type DEBMAS and I have removed the initial change on date so it will show for all dates.

Tcode BD87 in SAP S4 HANA showing the initial screen selection. In this case we will view message type DEBMAS
Initial screen of the BD87 Tcode to view DEBMAS IDOC

After clicking execute you can view all the IDOCs with summary numbers

BD87 tcode in SAP S4 HANA showing the number of IDOCs in the different status
Number of IDOCs in different status using Tcode BD87

In this tcode you can see the summary of the number of IDOCs per status. You can see which are in outbound and which are inbound. Additionally, by clicking on the drop down arrows you can see summaries of number of IDOCs per error description. Next let’s take a look at some of the key tables involved with IDOCs.

This TCODE also allows for the option to find all IDOCs related to a master data object. For example, if I want to know what IDOCs are relevant based on a customer number you can use the fields within BD87 business object & object key. In the case of customer the business object is customer (KNA1) and the object key is the customer number (including leading zeros).

Key SAP Tables related to IDOCs

The Tcodes above help with the majority of navigation around IDOCs. However, if you want deeper analysis and answers to some common questions the actual background tables will provide the remaining answers.

In order to view the number, status, direction, basic type. message type of an IDOC utilize the table EDIDC (Remember utilize tcode SE16N to view tables). Here is a quick view of the EDIDC table

This is a view of the SE16N tcode for the table EDIDC. This table views the backend data of IDOCs
View in SE16N of the EDIDC table

In order to determine data within an IDOC, it is a bit more tricky. A key issue that arises often with IDOCs is the following question. How do I determine in mass the IDOC numbers based on my object numbers? For example, how do I know the IDOC number that created/changed the following customer number? It is a common question and there is no simple report in order to find this. My go to method is to go to the table EDID4. Here I will enter the header segment that contains the object number in the segment name field which is shown below

This is a view of the SE16N tcode for the table EDID4 in SAP. This table views the backend data of IDOCs including the information stored in segment data fields. The highlighted segment name shows what field to populate
SAP S4 HANA EDID4 Table view Showing Segment Name to find IDOC data

If you look at the very last column, there is an application data field. This field will contain the data that is contained in the segment. From here, you can search your object number to try and find the IDOC number directly in the data display from SE16N or you can download the data to excel and do some manipulation of that column to get the relationship between IDOC number and the related object number.

Hope this helped give you an overview of IDOCs from a functional perspective. If you’d like more information related to the set up of the configuration required to manage IDOCs please subscribe since this will be a topic of a future post! If you have any questions, please feel free to leave a comment below

2 responses to “SAP S4 HANA IDOCs for Master Data Consultants”

  1. This is incredibly helpful, thank you for the detailed explanation. I’m excited to see your other content.

Leave a Reply

Create a website or blog at WordPress.com

Discover more from Simplify Your SAP S4 HANA Master Data Experience

Subscribe now to keep reading and get access to the full archive.

Continue reading