# COGI Failed Goods Movements Aging Report

> A custom ALV report that groups the backflush and automatic goods receipt errors waiting in COGI by age, error reason and material, and flags which of them can be fixed right now with current stock. Before month end, teams see in one list which records to clear first.

- Type: Report, Custom development, ALV report
- Module: PP
- Estimated effort: S (3–4 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/reports/cogi-failed-goods-movements-aging-report/


## Why is the standard not enough?

COGI lists failed goods movements as a correction inbox; it does not show how many days an error has been waiting, the age bucket, how many lines wait for the same reason or whether current unrestricted stock is now enough to post them. Accumulated COGI records distort stock and WIP values; teams export the list to Excel and age it by hand to decide what to clear first.

### Closest standard alternatives

- COGI: Lists and corrects failed movements; no aging, no totals by reason and no check against current stock.
- MB51: Shows posted goods movements; it does not include the unposted movements waiting in COGI.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| AFFW | Failed goods movements: material, quantity, movement type, error message (driving table) | Read | - | ECC + S/4 |
| T100 | Error message text | Read | T100-ARBGB = AFFW-MSGID AND T100-MSGNR = AFFW-MSGNO AND T100-SPRSL = SY-LANGU | ECC + S/4 |
| MARD | Current unrestricted stock in the storage location | Read | MARD-MATNR = AFFW-MATNR AND MARD-WERKS = AFFW-WERKS AND MARD-LGORT = AFFW-LGORT | ECC + S/4 |
| MAKT | Material description | Read | MAKT-MATNR = AFFW-MATNR AND MAKT-SPRAS = SY-LANGU | ECC + S/4 |
| AFKO | MRP controller and production supervisor of the order | Read | AFKO-AUFNR = AFFW-AUFNR | ECC + S/4 |

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_WERKS | Plant | Range / multiple | AFFW-WERKS | Yes |
| S_LGORT | Storage location | Range / multiple | AFFW-LGORT | No |
| S_MATNR | Material | Range / multiple | AFFW-MATNR | No |
| S_AUFNR | Order | Range / multiple | AFFW-AUFNR | No |
| S_BWART | Movement type | Range / multiple | AFFW-BWART | No |
| S_ERSDA | Created on | Range / multiple | AFFW-ERSDA | No |
| S_MSGNO | Message number | Range / multiple | AFFW-MSGNO | No |
| P_KEYDT | Key date (default: today) | Single value | SY-DATUM | Yes |
| P_FIXAB | Fixable now only | Checkbox | - | No |

## Output columns

| Column | Source |
|---|---|
| Order | AFFW-AUFNR |
| Material | AFFW-MATNR |
| Description | MAKT-MAKTX |
| Plant | AFFW-WERKS |
| Storage location | AFFW-LGORT |
| Movement type | AFFW-BWART |
| Quantity | AFFW-ERFMG |
| Unit | AFFW-ERFME |
| Created on | AFFW-ERSDA |
| Age (days) | Calculated: Key date − AFFW-ERSDA |
| Age bucket | Calculated: 0–1, 2–7, 8–30 or 30+ days |
| Error message | Calculated: T100-TEXT with AFFW-MSGV1 inserted |
| Unrestricted stock | MARD-LABST |
| Fixable now | Calculated: For a stock deficit error, MARD-LABST ≥ AFFW-ERFMG after older lines are deducted |

## How does the report work?

1. All failed goods movements in the selection are read from AFFW (the data source of COGI): order, material, plant, storage location, movement type, quantity and error message.
2. Age = key date − AFFW-ERSDA. Lines are assigned to the 0–1, 2–7, 8–30 and 30+ day buckets.
3. The error text is read from T100 in the logon language with MSGID + MSGNO, and the MSGV1 variable is inserted, so errors with the same reason are grouped together.
4. Current unrestricted stock (LABST) at the plant and storage location of the movement is read from MARD. When the error is a stock deficit, lines of the same material and storage location are consumed from stock starting with the oldest; lines covered by stock are flagged as fixable now.
5. MRP controller and production supervisor of the order are added from AFKO. ALV shows the number of lines and the quantity total per error message and material.

## Authorization objects

- C_AFFW_TWK: Display failed goods movements by plant
- M_MSEG_BWA: Goods movement authorization by movement type

## Frequently asked questions

### Does the report correct the movements itself?

No, the report only reads and prioritizes. Correction is done in COGI; optionally a button can be added that passes the fixable lines to COGI in one step.

### Why do COGI records matter at month end?

Unposted consumption shows stock quantity and value too high and the actual cost of the order too low. If these records are not cleared before WIP and variance calculation at month end, cost results are wrong.

### Does it work on S/4HANA?

Yes. AFFW is still the data source of COGI in S/4HANA; reading MARD is served from material documents through a compatibility view.

---
Let us build this report for your system: https://nekuhub.com/en/request-a-quote/?report=pp-cogi-failed-goods-movements-aging
