How can I highlight the erroneous segment of an IDoc error?

In segment type E1MBXYI "Add goods movement from external system: Item", regardless of which segment an error occurs, the first item segment is always the one that is highlighted in red. For example, I have an IDoc for a goods receipt that contains 10 items. I know that an error is contained in item 6 but after attempting to process the IDoc, item 1 within E1MBXYI is highlighted in red. Can this be amended so that the item segment that the actually contains the error is highlighted?

The segments of an IDoc that contain errors are marked up in the IDoc status table EDIDS. For every erroneous segment there should be an entry in EDIDS with the same error code as the EDIDC-STATUS ('51' or '56'). The number of the erroneous segment is recorded in field EDIDS-SEGNUM. E.g. the following excerpt from EDIDS marks the segments '2' and '4' as in error and displays them red.


0000000000004451 50 000000
0000000000004451 64 000000
0000000000004451 62 000000
0000000000004451 51 000002
0000000000004451 51 000004

If your application does not make proper entries in EDIDS they will not be displayed in red in the IDoc tree of WE05 or WE02. When dealing with a standard app there might a user exit that you can use to set the necessary information by adding an additional EDIDS record with status '51' for every segment determined as being erroneous. If this is possible depends on the individual handler.

Dig Deeper on SAP Basis