Automatic Consumption Posting on EWM Production Staging, Partial Consumption and Consumption Reversal from Handhelds
Short answer: An EWM enhancement that consumes staged or picked materials to the production order by rule as soon as staging is complete. Partial consumptions such as cutting and nesting are posted with the used quantity only; unused components are reversed from consumption on a handheld by scanning the bin or handling unit and put back into the warehouse.
- Estimated effort
- L · 18–28 working days
- System
- ECC and S/4HANA
- Tables
- 9
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
Standard EWM production supply stages material to the production supply area (PSA); consumption is posted by backflush at order confirmation or by a separate consumption posting per order. Rule-based automatic consumption when staging is complete, logic that leaves the remainder of partial consumptions such as cutting in the PSA, and consumption reversal by bin or HU from a handheld are not offered as standard. The result is stock that is physically consumed at the PSA but still shown in the system, unexplained order variances at month end, and manual reversals.
Who uses it? Production warehouse teams, production planning, shift supervisors, cost accounting.
Closest standard alternatives
- /SCWM/RFUI EWM RF Framework Logon. Standard RF staging and return transactions; does not consume automatically or offer consumption reversal by bin.
- /SCWM/MON EWM Warehouse Management Monitor. PSA stock and warehouse tasks are monitored; consumption and reversal are done manually.
- COGI Postprocess Faulty Goods Movements. Processes failed backflush postings; does not cover consumption triggered by staging.
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| /SCWM/ORDIM_CEWM Confirmed Warehouse Tasks | Confirmed staging warehouse tasks (trigger) | Read | ECC + S/4 |
| AFKOOrder Header Data for PP Orders | Production order header | Read | ECC + S/4 |
| AFPOOrder Item | Order item and plant | Read | ECC + S/4 |
| RESBReservation/Dependent Requirements | Component reservation: requirement, withdrawn quantity, backflush flag | Read / write | ECC + S/4 |
| /SCWM/AQUAEWM Available Quantity | Stock in the PSA and remainder after partial consumption | Read | ECC + S/4 |
| /SCWM/HUHDREWM Handling Unit Header | Scanned handling unit | Read | ECC + S/4 |
| /SCWM/LAGPEWM Storage Bins | PSA bin and putaway destination bin | Read | ECC + S/4 |
| /SCWM/ORDIM_OEWM Open Warehouse Tasks | Putaway task created after consumption reversal | Write | ECC + S/4 |
| MATDOCMaterial Documents (S/4HANA) | 261 consumption and 262 reversal documents (S/4HANA) | Write | S/4HANA only |
BAPIs and functions used
- BAPI_GOODSMVT_GETDETAILRead Material Document Details. Reads the items of the consumption document in the reversal screen
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_LGNUM | Warehouse number | Single value | /SCWM/LAGP-LGNUM | Yes | W100 |
| S_WERKS | Plant (rule) | Range / multiple | RESB-WERKS | Yes | 1000 |
| S_AUFNR | Production order (retry job) | Range / multiple | AFKO-AUFNR | No | 1000045210 |
| P_TEST | Test run (no posting) | Checkbox | — | No | X |
Input file columns
The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.
| # | Column | Target field | Required |
|---|---|---|---|
| 1 | Bin (PSA) | /SCWM/LAGP-LGPLA | Yes |
| 2 | Handling unit | /SCWM/HUHDR-HUIDENT | No |
| 3 | Production order | AFKO-AUFNR | No |
| 4 | Return / used quantity | MATDOC-MENGE | Yes |
Sample upload file
| 1 | Bin (PSA) * | Handling unit | Production order | Return / used quantity * |
|---|---|---|---|---|
| 2 | PSA-LAZER-01 | 100000000000007711 | 1000045210 | 1 |
| 3 | PSA-MONTAJ-02 | 1000045214 | 12 |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Production order | AFKO-AUFNR |
| 2 | Component | RESB-MATNR |
| 3 | Requirement quantity | RESB-BDMNG |
| 4 | Withdrawn quantity | RESB-ENMNG |
| 5 | Bin | /SCWM/LAGP-LGPLA |
| 6 | Handling unit | /SCWM/HUHDR-HUIDENT |
| 7 | Movement type | MATDOC-BWART |
| 8 | Quantity | MATDOC-MENGE |
| 9 | Material document | MATDOC-MBLNR |
| 10 | Status | Calculated Consumed automatically, partially consumed, reversed and put away, or error |
Sample result list
| Production order | Component | Requirement quantity | Withdrawn quantity | Bin | Handling unit | Movement type | Quantity | Material document | Status |
|---|---|---|---|---|---|---|---|---|---|
| 1000045210 | SAC-3MM-DKP | 6 | 5 | PSA-LAZER-01 | 100000000000007711 | 261 | 5 | 4900031102 | Partially consumed; 1 sheet left in the PSA |
| 1000045214 | VD-M8X25 | 400 | 400 | PSA-MONTAJ-02 | 261 | 400 | 4900031107 | Consumed automatically | |
| 1000045214 | CNT-PLS-40 | 60 | 48 | PSA-MONTAJ-02 | 262 | 12 | 4900031125 | Reversed, putaway task created | |
| 1000045219 | BOYA-RAL7035 | 20 | 0 | PSA-BOYA-01 | 100000000000007740 | 261 | 20 | Error: order locked by another user, will be retried |
How does the program work?
- A setup table holds the plants, order types and material groups for which automatic consumption applies and the moment of consumption (confirmation of the staging warehouse task or order confirmation). Components flagged for backflush are excluded from this logic, so nothing is consumed twice.
- When a staging warehouse task to the production supply area is confirmed (/SCWM/ORDIM_C), the staged order, reservation item, HU and quantity are taken through the /SCWM/EX_MFG_STAGE_INFO BAdI in the EWM enhancement spot /SCWM/ES_MFG_STAGE.
- For items that match the rule, consumption is posted as an EWM goods movement against the reservation (RESB) of the production order; in S/4HANA a 261 movement is created in MATDOC and the withdrawn quantity of the reservation is updated. For cross-order staging the quantity is split across the orders in proportion to their open requirements.
- Partial consumption: for sheets, reels and profiles that are cut or nested, the operator enters the used quantity or it is taken from the nesting result; only this quantity is consumed, the remainder stays in the PSA in the same HU and can be used for the next order.
- Consumption reversal runs as a new RF transaction in /SCWM/RFUI. The operator scans the bin or HU, sees the orders and quantities consumed from it and enters the quantity to return. The system reverses the consumption with 262, takes the stock back to the PSA and creates a putaway task back into the warehouse; destination bin and warehouse process type are enriched with the /SCWM/EX_MFG_STAGE_REV_CO and /SCWM/EX_MFG_STAGE_REV_SO BAdIs.
- Consumptions that cannot be posted, for example because the order is locked or stock is missing, are logged and retried by a background job; remaining errors go to the supervisor as a list.
Performance notes
Do not post consumption synchronously inside the warehouse task confirmation; post it in packages after confirmation through a queue or a short-interval background job. Read reservations once for the list of orders and retry a few times when the order is locked.
Features
- Runs as a background job A job retries failed consumptions at short intervals.
- Line-by-line result and error log Every automatic consumption, partial consumption and reversal is logged per order.
- Test mode (check without posting) The retry job can first run without posting.
Authorization objects
- /SCWM/TOCRCreate the putaway warehouse task
- M_MSEG_BWAGoods movements with movement types 261/262
- C_AFKO_AWKProduction order authorization by order type
- /SCWM/RFADRun the new RF screens in the EWM RF framework
Frequently asked questions
What about components that use backflush?
Components with the backflush flag in the reservation are excluded from the automatic consumption rule and are consumed at order confirmation as standard. The same material is therefore never consumed twice.
How is the remainder of a partial consumption tracked?
The remaining quantity stays as PSA stock in the same handling unit and is proposed for the next order. If the remainder will not be used, it can be put back into the warehouse with the consumption reversal screen.
Does this enhancement work with warehouse management in ECC?
No. The enhancement uses the BAdIs of EWM production integration in S/4HANA. For warehouse management in ECC (LE-WM), similar logic has to be built separately with different exits.
Related reports
EWM to ERP Production Consumption and Stock Type Reconciliation Report
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 …
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 …
Production Order Component Consumption Variance Report (Planned vs Actual Issue)
A custom ALV report that compares, for completed production orders, the consumption each component should have for the delivered quantity with the …
Let us build this program for your system
Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.