bodsexpert
bodsexpert

Download IDoc Data from SAP Table

By Imran, Mohammad | March 02, 2022 | under SAP ECC/S4HANA


We often need to check the data passed in an IDoc, but sometimes we're unsure which specific IDoc was used. Checking each IDoc one by one in transaction WE02 can be very time-consuming, especially if many IDocs were posted on the same day. Instead, you can browse relevant IDoc tables to filter and identify the correct IDoc more efficiently.

Run the table EDIDC using transaction SE16N and fill in the required fields to fetch specific IDocs based on your criteria.

  • Status – Enter 51 in the IDoc Status field (or any other status such as 51, 64, or 53) to fetch relevant IDocs. Typically, we extract failed IDocs, so 51 is used for IDocs with errors.
  • CREDAT – It's important to enter a from date and to date to filter IDocs based on the date range. This ensures you only retrieve IDocs posted within that time frame.
  • Message Type – Make sure to enter the correct Message Type. If not provided, the system may return a large list of IDocs from various objects, making it difficult to identify the relevant ones.
Download IDoc

On the next screen, you'll see a list of IDocs that match your criteria. You can export this list to Excel and copy the IDoc numbers as needed.

Download IDoc Step

Now, run another table called EDID4. This table holds the contents of the IDocs.

  • Copy all the IDoc numbers from your previous export and paste them into the DOCNUM field.
  • Check the Segment field to identify which segment contains the data you're looking for. Once identified, enter that segment number in the SEGNUM field.
  • The SDATA field contains the actual IDoc content. Since all data is stored in a single field, you’ll need to use Excel’s Text to Columns feature to split the data across columns.
Download IDoc SDATA

Open Excel and use the Text to Columns feature under the Data tab to convert the single-field data into multiple columns, as shown below.

Excel Text to Columns
Note:

If you have a very large volume of IDocs, I recommend using BODS. You can import these two tables and extract data from EDIDC by applying certain filters. Then join it with EDID4 to fetch the SDATA. This way, you will have all your IDocs with SDATA in a table or in a file format (e.g., .txt). You can even apply the substr function on SDATA to truncate unnecessary data.