# Failed IDocs Aging Report by Partner and Message Type

> A custom ALV report that lists inbound and outbound IDocs in an error status or waiting too long for processing, with partner, message type, last status message and age in hours, and counts the IDocs failing with the same error. In the morning the integration team sees on one screen which error is piling up at which partner and starts with the oldest IDoc.

- Type: Report, Custom development, ALV report
- Module: BASIS
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/reports/failed-idocs-aging-report-by-partner-and-message-type/


## Why is the standard not enough?

WE02/WE05 list IDocs by status and date and BD87 offers reprocessing; but neither calculates the age of an IDoc in hours, groups and counts IDocs with the same error message for the same partner and message type, or flags IDocs stuck in status 30 or 64 for too long. Emailing the error summary to the partner owner is not available either.

### Closest standard alternatives

- WE02: Lists IDocs by status and date; no age, count of the same error or flag for stuck IDocs.
- BD87: Reprocesses failed IDocs; it does not give an error summary per partner or email distribution.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| EDIDC | IDoc control record: status, direction, message type, partners, creation time (driving table) | Read | - | ECC + S/4 |
| EDIDS | IDoc status records: last error message and date | Read | EDIDS-DOCNUM = EDIDC-DOCNUM | ECC + S/4 |
| EDP21 | Inbound partner profile: process code | Read | EDP21-SNDPRN = EDIDC-SNDPRN AND EDP21-SNDPRT = EDIDC-SNDPRT AND EDP21-MESTYP = EDIDC-MESTYP | ECC + S/4 |
| EDP13 | Outbound partner profile: receiver port and basic type | Read | EDP13-RCVPRN = EDIDC-RCVPRN AND EDP13-RCVPRT = EDIDC-RCVPRT AND EDP13-MESTYP = EDIDC-MESTYP | ECC + S/4 |

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_CREDT | Creation date | Range / multiple | EDIDC-CREDAT | Yes |
| S_STAT | IDoc status (blank = error list) | Range / multiple | EDIDC-STATUS | No |
| S_MESTY | Message type | Range / multiple | EDIDC-MESTYP | No |
| S_SNDPRN | Sender partner | Range / multiple | EDIDC-SNDPRN | No |
| S_RCVPRN | Receiver partner | Range / multiple | EDIDC-RCVPRN | No |
| P_STUCK | Add IDocs stuck in status 30 and 64 | Checkbox | - | No |
| P_MINAGE | Stuck threshold (hours) | Single value | - | No |
| P_SUMM | Show partner + message type + error summary | Checkbox | - | No |

## Output columns

| Column | Source |
|---|---|
| IDoc number | EDIDC-DOCNUM |
| Direction | EDIDC-DIRECT |
| Status | EDIDC-STATUS |
| Message type | EDIDC-MESTYP |
| Basic type | EDIDC-IDOCTP |
| Sender partner | EDIDC-SNDPRN |
| Receiver partner | EDIDC-RCVPRN |
| Created on | EDIDC-CREDAT |
| Created at | EDIDC-CRETIM |
| Last status date | EDIDS-LOGDAT |
| Message class | EDIDS-STAMID |
| Message number | EDIDS-STAMNO |
| Status text | EDIDS-STATXT |
| Age (hours) | Calculated: Now − EDIDC-CREDAT/CRETIM |
| IDocs with same error | Calculated: Number of IDocs in the same partner + message type + STAMID/STAMNO group |

## How does the report work?

1. IDocs in error statuses within the selected creation date range are read from EDIDC: outbound 02, 04, 05, 25, 26, 29; inbound 51, 56, 60, 61, 63, 65 (the list is configurable).
2. Depending on the selection, stuck IDocs are added: status 30 (outbound, ready for dispatch) and 64 (inbound, ready to be processed) older than the hour threshold.
3. The status record with the highest counter (COUNTR) of each IDoc is read from EDIDS: message class (STAMID), message number (STAMNO), first variable (STAPA1), status text and date.
4. Age (hours) = now − CREDAT/CRETIM. The number of IDocs in the same partner + message type + STAMID/STAMNO group is calculated.
5. The process code is added from EDP21 for inbound IDocs and the port from EDP13 for outbound IDocs; IDocs without a partner profile are flagged separately.
6. In summary mode one row = partner + message type + error; in detail mode one row = IDoc. Double-clicking the IDoc number opens WE02, an action button opens BD87 for the selected IDocs.

## Authorization objects

- S_IDOCMONI: IDoc monitoring: display by message type and partner
- S_IDOCCTRL: Access to the IDoc control record and partner profiles

## Frequently asked questions

### Does the report reprocess IDocs automatically?

No, the report only lists and passes the selected IDocs to BD87. Reprocessing should be a deliberate decision, for example after master data has been corrected. If needed, a scheduled automatic retry for specific error messages can be added as a separate job.

### Is the business data inside the IDoc shown?

The basic version reads only control and status records; order or invoice segments are not read. This keeps the report fast and only monitoring authorization is needed.

### Can it be used on S/4HANA as well?

Yes. EDIDC, EDIDS and the partner profile tables are the same in S/4HANA. Even when integration comes through middleware (e.g. SAP Integration Suite), the report covers it as long as it is processed as an IDoc.

---
Let us build this report for your system: https://nekuhub.com/en/request-a-quote/?report=basis-failed-idocs-aging
