EWM to ERP Production Consumption and Stock Type Reconciliation Report
Short answer: A custom report that compares ERP consumption per production order with the quantity staged to the production supply area in EWM and the quantity left in the PSA, and shows duplicate consumption, consumption missing after a reversal and failed movements in one list. It also compares ERP stock types with EWM stock types per material and storage location; selected differences can be checked in test mode and corrected in bulk.
- Estimated effort
- M · 8–12 working days
- System
- ECC and S/4HANA
- Tables
- 6
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
Consumption differences between EWM and ERP arise from queue errors, the same consumption posted twice, or consumption not reposted after a reversal. COGI shows only failed movements, SMQ2 the queues, and /SCWM/ERP_STOCKCHECK the total stock difference; none of them links the difference to a production order or detects duplicate consumption. Stock type differences (unrestricted, quality, blocked) are investigated separately.
Who uses it? EWM and inventory key users, production control and costing teams, SAP support teams.
Closest standard alternatives
- COGI Postprocess Faulty Goods Movements. Shows failed movements; does not detect duplicate or missing consumption.
- SMQ2 qRFC Monitor (Inbound Queue). Shows queue errors; does not link them to orders or differences.
- /SCWM/MON EWM Warehouse Management Monitor. Shows PSA stock; does not compare it with ERP consumption.
- MB51 Material Document List. Lists consumption documents; does not show the EWM side.
Tables used
The tables the report reads and their join fields. ECC and S/4HANA differences are marked separately.
| Table | Role | Join | System |
|---|---|---|---|
| RESBReservation/Dependent Requirements | Order component requirement and withdrawn quantity | — | ECC + S/4 |
| MATDOCMaterial Documents (S/4HANA) | ERP consumption movements; corrections write new consumption or reversals | MATDOC-RSNUM = RESB-RSNUM AND MATDOC-RSPOS = RESB-RSPOS | ECC + S/4 |
| AFFWGoods Movements with Errors from Confirmations | Failed goods movements (COGI) | AFFW-RSNUM = RESB-RSNUM AND AFFW-RSPOS = RESB-RSPOS | ECC + S/4 |
| /SCWM/ORDIM_CEWM Confirmed Warehouse Tasks | Quantity staged to the PSA | — | ECC + S/4 |
| /SCWM/AQUAEWM Available Quantity | Stock left in the PSA and EWM stock types | — | ECC + S/4 |
| MARDStorage Location Data for Material | ERP stock types: unrestricted, quality, blocked | MARD-MATNR = RESB-MATNR AND MARD-WERKS = RESB-WERKS | ECC + S/4 |
S/4HANA notes
- MARD → MATDOC: In S/4HANA stock quantities are no longer stored physically; reading MARD returns values calculated on the fly from MATDOC through a compatibility view. Reads still work, but test performance on very large selections.
BAPIs and functions used
- BAPI_GOODSMVT_CREATEPost Goods Movement. Posts missing consumption
- BAPI_GOODSMVT_CANCELReverse Goods Movement. Cancels duplicate consumption
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Commits the correction
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_WERKS | Plant | Single value | MATDOC-WERKS | Yes | 1000 |
| P_LGNUM | Warehouse number | Single value | /SCWM/AQUA-LGNUM | Yes | W100 |
| S_BUDAT | Posting date | Range / multiple | MATDOC-BUDAT | Yes | 01.11.2026 – 17.11.2026 |
| S_AUFNR | Production order | Range / multiple | RESB-AUFNR | No | 1000400 – 1000499 |
| S_MATNR | Material | Range / multiple | RESB-MATNR | No | * |
| P_MODE | Mode: consumption reconciliation / stock type comparison | Radio button | — | Yes | Tüketim |
| P_TEST | Test mode for corrections | Checkbox | — | No | X |
Output columns
| # | Column | Source |
|---|---|---|
| 1 | Order | RESB-AUFNR |
| 2 | Material | RESB-MATNR |
| 3 | Required | RESB-BDMNG |
| 4 | Staged to PSA | Calculated Σ /SCWM/ORDIM_C-NISTA |
| 5 | ERP consumption | Calculated Σ MATDOC 261 − 262 |
| 6 | PSA stock (EWM) | Calculated Σ /SCWM/AQUA-QUAN, PSA storage types |
| 7 | Difference | Calculated (Staged − ERP consumption) − PSA stock |
| 8 | Failed movements | Calculated Number of AFFW records |
| 9 | Finding | Calculated Duplicate, missing consumption, failed movement, stock type difference or matched |
| 10 | Status | Calculated Open, test OK, corrected or error |
Sample output
| Order | Material | Required | Staged to PSA | ERP consumption | PSA stock (EWM) | Difference | Failed movements | Finding | Status |
|---|---|---|---|---|---|---|---|---|---|
| 1000418 | VDA-M6 | 1,200 | 1,200 | 2,400 | 0 | -1,200 | 0 | Duplicate | Test OK |
| 1000420 | KRT-110 | 60 | 60 | 0 | 0 | 60 | 0 | Missing consumption | Corrected |
| 1000425 | GVD-300 | 24 | 24 | 12 | 0 | 12 | 1 | Failed movement | Open |
| 1000427 | SAC-2MM | 350 | 350 | 300 | 50 | 0 | 0 | Matched |
How does the report work?
- Components of the orders in the selected plant and date range are read from RESB (BDMNG, ENMNG).
- ERP consumption is totalled from MATDOC per order and reservation item (261 − 262; documents flagged CANCELLED excluded). Two 261 postings of the same quantity on the same reservation item within a short time, and total consumption above both the requirement and the staged quantity, are flagged as suspected duplicates.
- Items reversed with 262 but not consumed again with 261, while the order has confirmations, are flagged as ‘missing consumption’.
- Failed movements from AFFW (MSGID, MSGNO) are added per order and material.
- EWM side: the quantity staged to the PSA is read from /SCWM/ORDIM_C (PSA, NISTA) and the stock left in the PSA from /SCWM/AQUA; the product GUID is resolved through /SAPAPO/MATKEY and the storage location mapping through /SCWM/TMAPSTLOC. Expected PSA stock = staged − ERP consumption; the difference is shown on the line.
- Stock type mode: per material and storage location, MARD (LABST, INSME, SPEME) is compared with the EWM stock types (CAT) in /SCWM/AQUA using the mapping defined during installation.
- Correction: for selected lines missing consumption is posted with BAPI_GOODSMVT_CREATE and duplicate consumption is cancelled with BAPI_GOODSMVT_CANCEL. Test mode only checks; every action is logged.
Performance notes
Limit MATDOC by plant, date and movement type (261/262) and aggregate per order in the database. Read /SCWM/AQUA only for the PSA storage types. For large plants run the report in the background at night.
Features
- ALV list (sort, filter, subtotals)
- Double-click drill-down to the document Lines drill down to the order's consumption documents, COGI entries and the PSA stock in /SCWM/MON.
- Test mode (check without posting)
- Line-by-line result and error log
- Runs as a background job Can run nightly and email the findings to the warehouse and production control teams.
- Send the result by email
Authorization objects
- M_MSEG_BWACorrection authorization for movement types 261/262
- M_MSEG_WWAMaterial document authorization by plant
- C_AFKO_AWKProduction order display
Frequently asked questions
Are duplicate consumptions cancelled automatically?
No. The program flags suspected lines; cancellation is done by user selection and first in test mode. The order's confirmation and costing status (e.g. closed period, technically completed order) is checked.
Which system releases does it run on?
The report is designed for embedded EWM on S/4HANA; ERP consumption is read from MATDOC. With decentralized EWM the EWM tables are in another system, so data is fetched through RFC and the effort grows by about 3 days.
Related reports
EWM Production Staging Cockpit with Pick Lists and Handover Tracking
A custom cockpit that manages picking and staging the components of production and subcontracting orders to the production supply area (PSA) in EWM …
LE-WM to EWM Migration Readiness Check Report (S/4HANA)
A check report that summarizes, before an S/4HANA conversion, the structure and open workload of every warehouse number on one line: storage types, …
WM vs IM Stock Comparison Report
A custom ALV report that compares inventory management stock per storage location (MARD) with the total of warehouse management quants (LQUA) by …
Let us build this report for your system
Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.