# Shop Floor (MES) Confirmation Interface Log and Error Monitor

> A monitoring report that shows on one screen which production confirmations from the shop floor system (MES) were posted in SAP, which failed and which are pending. Failed messages are grouped by cause, the user can correct the data and reprocess the confirmation from the report; posted confirmations are matched to the order and confirmation number.

- Type: Report, Custom development, ALV report
- Module: PP
- Estimated effort: M (7–10 working days)
- Last updated: 2026-11-18
- URL: https://nekuhub.com/en/reports/shop-floor-mes-confirmation-interface-log-and-error-monitor/


## Why is the standard not enough?

If MES confirmations arrive as IDocs their status is visible in WE02 and BD87; if they arrive through direct function calls they appear only in the application log (SLG1); goods movement errors after the confirmation are in COGI. None of these shows the message with its production order and operation in business terms, and reprocessing differs by channel. The custom report combines the three sources and offers one reprocessing path.

### Closest standard alternatives

- WE02: Shows IDocs and their status; does not match them with order and operation in business terms.
- BD87: Reprocesses failed IDocs; does not cover confirmations received through direct calls.
- COGI: Corrects failed goods movements after confirmation; does not show the interface message.
- SLG1: Shows the application log; does not group messages or offer reprocessing.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| EDIDC | IDoc control record: message type, time, current status (driving table on the IDoc channel) | Read | - | ECC + S/4 |
| EDIDS | IDoc status history and error text | Read | EDIDS-DOCNUM = EDIDC-DOCNUM | ECC + S/4 |
| BALHDR | Application log header on the direct call channel | Read | BALHDR-EXTNUMBER = MES message ID / mesaj kimliği | ECC + S/4 |
| AFRU | Confirmation created in SAP: quantities, confirmation number, reversal flag | Read | AFRU-AUFNR, AFRU-VORNR ↔ MES message / mesaj | ECC + S/4 |
| AFFW | Failed goods movements after confirmation | Read | AFFW-RUECK = AFRU-RUECK AND AFFW-RMZHL = AFRU-RMZHL | ECC + S/4 |
| AFKO | Order header and material | Read | AFKO-AUFNR = AFRU-AUFNR | ECC + S/4 |
| CRHD | Work center | Read | CRHD-OBJTY = 'A' AND CRHD-OBJID = AFRU-ARBID | ECC + S/4 |

## BAPIs and functions used

- BAPI_PRODORDCONF_CREATE_TT: Creates a confirmation from a corrected message
- BAPI_TRANSACTION_COMMIT: Commits a successful reprocessing
- IDOC_READ_COMPLETELY: Reads the data of a failed IDoc for the correction screen

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_DATE | Receipt date | Range / multiple | EDIDC-CREDAT | Yes |
| P_WERKS | Plant | Single value | AFRU-WERKS | Yes |
| S_AUFNR | Production order | Range / multiple | AFRU-AUFNR | No |
| P_STAT | Status: all / failed / pending / posted | Radio button | - | Yes |
| P_TEST | Test run when reprocessing | Checkbox | - | No |

## Output columns

| Column | Source |
|---|---|
| Received at | Calculated: EDIDC-CREDAT/CRETIM or the receipt time in the log table |
| Message / IDoc | EDIDC-DOCNUM |
| Order | AFRU-AUFNR |
| Operation | AFRU-VORNR |
| Work center | CRHD-ARBPL |
| Yield | AFRU-LMNGA |
| Scrap | AFRU-XMNGA |
| Status | Calculated: Posted, failed, pending or confirmation OK / movement failed |
| Error text | EDIDS-STATXT |
| Confirmation no. | AFRU-RUECK |
| Attempts | Calculated: Number of attempts in the log table |

## How does the report work?

1. Every incoming MES message is written to an interface log table: message ID, receipt time, order, operation, work center, yield/scrap quantity, times, status and number of attempts. If the existing interface uses IDocs, the log can be filled from EDIDC/EDIDS; if it uses direct calls, from the BALHDR application log; the choice is made during installation according to the interface design.
2. For the IDoc channel, the message type, creation time and current status are read from EDIDC and the latest status text from EDIDS; status 53 is classified as posted, 51 and 56 as failed, 64 as pending.
3. Posted messages are matched to the confirmation in AFRU (order, operation, posting time and quantity; directly via RUECK/RMZHL if the log table holds the confirmation number); reversed confirmations are flagged separately.
4. If the confirmation was saved but the automatic goods movement failed, the AFFW record is matched by order and confirmation and the status 'confirmation OK, movement failed' is set.
5. Error messages are grouped by message class and number (e.g. order locked, operation finally confirmed, insufficient stock) and the count per group is shown.
6. Reprocessing: on the IDoc channel the IDoc is reprocessed; on the direct channel BAPI_PRODORDCONF_CREATE_TT is called with the corrected data and saved with BAPI_TRANSACTION_COMMIT. An automatic retry job can be scheduled for lock errors; each attempt is written to the log table.

## Authorization objects

- C_AFRU_AWK: Display confirmations and create them when reprocessing
- S_IDOCMONI: IDoc monitoring and reprocessing
- S_APPL_LOG: Display the application log

## Frequently asked questions

### Do we need to change our existing MES interface?

If the interface uses IDocs, no change is needed; the report reads the IDoc records. If it uses direct function calls, a small addition writes every incoming message to the log table. This addition usually takes one day and is included in the effort range.

### How is the same confirmation prevented from being posted twice?

The unique ID of every MES message is kept in the log table and a posted message cannot be reprocessed. Before reprocessing, the report also checks whether a recent confirmation exists for the same order, operation and quantity and warns the user.

### Is it different on S/4HANA?

Confirmation and IDoc structures are the same. In S/4HANA goods movements after confirmation are written to MATDOC, and failed movements still stay in COGI. If MES integration is done with SAP Digital Manufacturing, the report shows the SAP side in addition to that solution's own monitor.

---
Let us build this report for your system: https://nekuhub.com/en/request-a-quote/?report=pp-mes-confirmation-interface-monitor
