# Automatic Consumption Posting on EWM Production Staging, Partial Consumption and Consumption Reversal from Handhelds

> 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.

- Type: Program, Custom development, Enhancement
- Module: WM
- Estimated effort: L (18–28 working days)
- Last updated: 2026-11-18
- URL: https://nekuhub.com/en/programs/ewm-automatic-production-consumption-and-handheld-consumption-reversal/


## 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.

### Closest standard alternatives

- /SCWM/RFUI: Standard RF staging and return transactions; does not consume automatically or offer consumption reversal by bin.
- /SCWM/MON: PSA stock and warehouse tasks are monitored; consumption and reversal are done manually.
- COGI: Processes failed backflush postings; does not cover consumption triggered by staging.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| /SCWM/ORDIM_C | Confirmed staging warehouse tasks (trigger) | Read | - | ECC + S/4 |
| AFKO | Production order header | Read | - | ECC + S/4 |
| AFPO | Order item and plant | Read | AFPO-AUFNR = AFKO-AUFNR | ECC + S/4 |
| RESB | Component reservation: requirement, withdrawn quantity, backflush flag | Read / write | RESB-AUFNR = AFKO-AUFNR | ECC + S/4 |
| /SCWM/AQUA | Stock in the PSA and remainder after partial consumption | Read | - | ECC + S/4 |
| /SCWM/HUHDR | Scanned handling unit | Read | /SCWM/HUHDR-HUIDENT = /SCWM/AQUA-HUIDENT | ECC + S/4 |
| /SCWM/LAGP | PSA bin and putaway destination bin | Read | - | ECC + S/4 |
| /SCWM/ORDIM_O | Putaway task created after consumption reversal | Write | - | ECC + S/4 |
| MATDOC | 261 consumption and 262 reversal documents (S/4HANA) | Write | MATDOC-AUFNR = AFKO-AUFNR | S/4HANA only |

## BAPIs and functions used

- BAPI_GOODSMVT_GETDETAIL: Reads the items of the consumption document in the reversal screen

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_LGNUM | Warehouse number | Single value | /SCWM/LAGP-LGNUM | Yes |
| S_WERKS | Plant (rule) | Range / multiple | RESB-WERKS | Yes |
| S_AUFNR | Production order (retry job) | Range / multiple | AFKO-AUFNR | No |
| P_TEST | Test run (no posting) | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Bin (PSA) | /SCWM/LAGP-LGPLA | Yes |
| Handling unit | /SCWM/HUHDR-HUIDENT | No |
| Production order | AFKO-AUFNR | No |
| Return / used quantity | MATDOC-MENGE | Yes |

## Result list columns

| Column | Source |
|---|---|
| Production order | AFKO-AUFNR |
| Component | RESB-MATNR |
| Requirement quantity | RESB-BDMNG |
| Withdrawn quantity | RESB-ENMNG |
| Bin | /SCWM/LAGP-LGPLA |
| Handling unit | /SCWM/HUHDR-HUIDENT |
| Movement type | MATDOC-BWART |
| Quantity | MATDOC-MENGE |
| Material document | MATDOC-MBLNR |
| Status | Calculated: Consumed automatically, partially consumed, reversed and put away, or error |

## How does the program work?

1. 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.
2. 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.
3. 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.
4. 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.
5. 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.
6. 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.

## Authorization objects

- /SCWM/TOCR: Create the putaway warehouse task
- M_MSEG_BWA: Goods movements with movement types 261/262
- C_AFKO_AWK: Production order authorization by order type
- /SCWM/RFAD: Run 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.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=ewm-production-auto-consumption-reversal
