WM Program Custom development Enhancement

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.

TableRoleAccessSystem
/SCWM/ORDIM_CEWM Confirmed Warehouse TasksConfirmed staging warehouse tasks (trigger)ReadECC + S/4
AFKOOrder Header Data for PP OrdersProduction order headerReadECC + S/4
AFPOOrder ItemOrder item and plantReadECC + S/4
RESBReservation/Dependent RequirementsComponent reservation: requirement, withdrawn quantity, backflush flagRead / writeECC + S/4
/SCWM/AQUAEWM Available QuantityStock in the PSA and remainder after partial consumptionReadECC + S/4
/SCWM/HUHDREWM Handling Unit HeaderScanned handling unitReadECC + S/4
/SCWM/LAGPEWM Storage BinsPSA bin and putaway destination binReadECC + S/4
/SCWM/ORDIM_OEWM Open Warehouse TasksPutaway task created after consumption reversalWriteECC + S/4
MATDOCMaterial Documents (S/4HANA)261 consumption and 262 reversal documents (S/4HANA)WriteS/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

ParameterDescriptionTypeReference fieldRequiredExample
P_LGNUMWarehouse numberSingle value/SCWM/LAGP-LGNUMYesW100
S_WERKSPlant (rule)Range / multipleRESB-WERKSYes1000
S_AUFNRProduction order (retry job)Range / multipleAFKO-AUFNRNo1000045210
P_TESTTest run (no posting)Checkbox—NoX

Input file columns

The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.

#ColumnTarget fieldRequired
1Bin (PSA)/SCWM/LAGP-LGPLAYes
2Handling unit/SCWM/HUHDR-HUIDENTNo
3Production orderAFKO-AUFNRNo
4Return / used quantityMATDOC-MENGEYes

Sample upload file

1Bin (PSA) *Handling unitProduction orderReturn / used quantity *
2PSA-LAZER-0110000000000000771110000452101
3PSA-MONTAJ-02100004521412
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1Production orderAFKO-AUFNR
2ComponentRESB-MATNR
3Requirement quantityRESB-BDMNG
4Withdrawn quantityRESB-ENMNG
5Bin/SCWM/LAGP-LGPLA
6Handling unit/SCWM/HUHDR-HUIDENT
7Movement typeMATDOC-BWART
8QuantityMATDOC-MENGE
9Material documentMATDOC-MBLNR
10StatusCalculated Consumed automatically, partially consumed, reversed and put away, or error

Sample result list

Production orderComponentRequirement quantityWithdrawn quantityBinHandling unitMovement typeQuantityMaterial documentStatus
1000045210SAC-3MM-DKP65PSA-LAZER-0110000000000000771126154900031102Partially consumed; 1 sheet left in the PSA
1000045214VD-M8X25400400PSA-MONTAJ-022614004900031107Consumed automatically
1000045214CNT-PLS-406048PSA-MONTAJ-02262124900031125Reversed, putaway task created
1000045219BOYA-RAL7035200PSA-BOYA-0110000000000000774026120Error: order locked by another user, will be retried
A view built with fictional sample data; not real system data.

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.

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

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.

Related report: Automatic Consumption Posting on EWM Production Staging, Partial Consumption and Consumption Reversal from Handhelds