WM Report Custom development ALV report

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.

TableRoleJoinSystem
RESBReservation/Dependent RequirementsOrder component requirement and withdrawn quantity—ECC + S/4
MATDOCMaterial Documents (S/4HANA)ERP consumption movements; corrections write new consumption or reversalsMATDOC-RSNUM = RESB-RSNUM AND MATDOC-RSPOS = RESB-RSPOSECC + S/4
AFFWGoods Movements with Errors from ConfirmationsFailed goods movements (COGI)AFFW-RSNUM = RESB-RSNUM AND AFFW-RSPOS = RESB-RSPOSECC + S/4
/SCWM/ORDIM_CEWM Confirmed Warehouse TasksQuantity staged to the PSA—ECC + S/4
/SCWM/AQUAEWM Available QuantityStock left in the PSA and EWM stock types—ECC + S/4
MARDStorage Location Data for MaterialERP stock types: unrestricted, quality, blockedMARD-MATNR = RESB-MATNR AND MARD-WERKS = RESB-WERKSECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_WERKSPlantSingle valueMATDOC-WERKSYes1000
P_LGNUMWarehouse numberSingle value/SCWM/AQUA-LGNUMYesW100
S_BUDATPosting dateRange / multipleMATDOC-BUDATYes01.11.2026 – 17.11.2026
S_AUFNRProduction orderRange / multipleRESB-AUFNRNo1000400 – 1000499
S_MATNRMaterialRange / multipleRESB-MATNRNo*
P_MODEMode: consumption reconciliation / stock type comparisonRadio button—YesTüketim
P_TESTTest mode for correctionsCheckbox—NoX

Output columns

#ColumnSource
1OrderRESB-AUFNR
2MaterialRESB-MATNR
3RequiredRESB-BDMNG
4Staged to PSACalculated Σ /SCWM/ORDIM_C-NISTA
5ERP consumptionCalculated Σ MATDOC 261 − 262
6PSA stock (EWM)Calculated Σ /SCWM/AQUA-QUAN, PSA storage types
7DifferenceCalculated (Staged − ERP consumption) − PSA stock
8Failed movementsCalculated Number of AFFW records
9FindingCalculated Duplicate, missing consumption, failed movement, stock type difference or matched
10StatusCalculated Open, test OK, corrected or error

Sample output

OrderMaterialRequiredStaged to PSAERP consumptionPSA stock (EWM)DifferenceFailed movementsFindingStatus
1000418VDA-M61,2001,2002,4000-1,2000DuplicateTest OK
1000420KRT-110606000600Missing consumptionCorrected
1000425GVD-3002424120121Failed movementOpen
1000427SAC-2MM3503503005000Matched
A view built with fictional sample data; not real system data.

How does the report work?

  1. Components of the orders in the selected plant and date range are read from RESB (BDMNG, ENMNG).
  2. 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.
  3. Items reversed with 262 but not consumed again with 261, while the order has confirmations, are flagged as ‘missing consumption’.
  4. Failed movements from AFFW (MSGID, MSGNO) are added per order and material.
  5. 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.
  6. 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.
  7. 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

WM Report Custom ALV report

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 …

T320 · MARD · LQUA · LTAP

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.

Related report: EWM to ERP Production Consumption and Stock Type Reconciliation Report