EWM–QM Integration: Rule-Based Inspection Lots and Automatic Stock Routing After the Usage Decision
Short answer: An EWM enhancement that decides with company rules when an inspection lot is opened for incoming material and, after the usage decision, routes the stock automatically to unrestricted, blocked or the returns area. Inspection documents are created automatically, the follow-up action is chosen from the decision code and the required warehouse tasks are created on their own.
- Estimated effort
- L · 15–22 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–QM integration determines inspection rules with fixed criteria such as material, inspection type and document type; rules like the supplier's quality history, first delivery, specific batch properties or company-specific exemptions need BAdIs. The logistics follow-up actions after the usage decision are also tied to the decision code in a fixed way; splitting stock for partial decisions, moving conditional acceptances to a separate area and an automatic task to the returns area cannot be set up as standard. This enhancement keeps the rules in one maintenance table and applies them through standard BAdIs.
Who uses it? Incoming quality inspection teams, warehouse supervisors, purchasing, quality assurance managers.
Closest standard alternatives
- QA11 Record Usage Decision. Records the usage decision; the follow-up action is tied to the decision code in a fixed way.
- QA32 Change Data for Inspection Lot. Lists and processes inspection lots; does not decide whether a lot is opened.
- /SCWM/POST Posting Change. Changes the stock type manually; no automatic routing based on the usage decision.
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| /SCDL/DB_PROCH_IEWM Inbound Delivery Header | EWM inbound delivery header | Read | ECC + S/4 |
| /SCDL/DB_PROCI_IEWM Inbound Delivery Item | EWM inbound delivery items: product, batch, quantity | Read | ECC + S/4 |
| QMATInspection Type - Material Parameters | Active inspection types of the material | Read | ECC + S/4 |
| QALSInspection Lot Record | Inspection lot: material, batch, supplier, lot quantity | Read / write | ECC + S/4 |
| QAVEUsage Decision | Usage decision and decision code | Read | ECC + S/4 |
| LFA1Vendor Master (General Section) | Supplier name (rule and monitor) | Read | ECC + S/4 |
| /SCWM/AQUAEWM Available Quantity | Quality stock and stock type after the follow-up action | Read | ECC + S/4 |
| /SCWM/HUHDREWM Handling Unit Header | Inspected handling unit | Read | ECC + S/4 |
| /SCWM/ORDIM_OEWM Open Warehouse Tasks | Putaway or returns area task created by the follow-up action | Write | ECC + S/4 |
BAPIs and functions used
- BAPI_INSPLOT_GETDETAILRead Inspection Lot Details and Usage Decision. Reads status and decision data of the inspection lot
- SO_NEW_DOCUMENT_ATT_SEND_API1SAPoffice: Send New Document with Attachments. Sends an email to purchasing and quality on rejection
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_LGNUM | Warehouse number | Single value | /SCWM/LAGP-LGNUM | Yes | W100 |
| S_WERK | Plant | Range / multiple | QALS-WERK | Yes | 1000 |
| S_MATNR | Material | Range / multiple | QALS-MATNR | No | HM-1001 |
| S_LIFNR | Supplier | Range / multiple | QALS-LIFNR | No | 300045 |
| P_OPEN | Only items with incomplete follow-up | Checkbox | — | No | X |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Inspection lot | QALS-PRUEFLOS |
| 2 | Material | QALS-MATNR |
| 3 | Batch | QALS-CHARG |
| 4 | Supplier | QALS-LIFNR |
| 5 | Supplier name | LFA1-NAME1 |
| 6 | Lot quantity | QALS-LOSMENGE |
| 7 | Applied rule | Calculated Matching row in the rule table: inspection required, sample or no inspection |
| 8 | Decision code | QAVE-VCODE |
| 9 | Follow-up action | Calculated Action chosen from the decision code: unrestricted, blocked + returns area, conditional acceptance area |
| 10 | Destination bin | /SCWM/ORDIM_O-NLPLA |
| 11 | Warehouse task | /SCWM/ORDIM_O-TANUM |
| 12 | Status | Calculated Awaiting decision, follow-up complete or error |
Sample result list
| Inspection lot | Material | Batch | Supplier | Supplier name | Lot quantity | Applied rule | Decision code | Follow-up action | Destination bin | Warehouse task | Status |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 010000004512 | HM-1001 | B2611-04 | 300045 | Örnek Ambalaj A.Ş. | 2,400 | Inspection required (first delivery) | A1 | Unrestricted + normal putaway | A-02-01-05 | 000000081245 | Complete |
| 010000004513 | YM-2040 | B2611-07 | 300112 | Demo Kağıt Ltd. | 800 | Sample only | R1 | Blocked + returns area | IADE-01 | 000000081251 | Complete, email sent |
| 010000004517 | AM-3315 | B2611-09 | 300045 | Örnek Ambalaj A.Ş. | 120 | Inspection required (shelf life) | Awaiting decision | ||||
| 010000004520 | HM-1008 | B2611-12 | 300207 | Deneme Kimya San. | 1,500 | Inspection required | A2 | Conditional acceptance area | Error: no empty bin in destination storage type |
How does the program work?
- A rule table holds the decision ‘inspection required’, ’no inspection’ or ‘sample only’ per plant, material or material group, supplier, first delivery, remaining shelf life and delivery type. The quality team can maintain the rules; changes are tracked with history.
- When an inbound delivery arrives in EWM (/SCDL/DB_PROCH_I, /SCDL/DB_PROCI_I), the /SCWM/EX_QM_INSP_RELEVANCE BAdI applies the rule table. For items that need no inspection, no inspection document is opened; for items that do, and if the inspection type is active for the material (QMAT), the QM inspection lot (QALS) in S/4HANA and the EWM inspection document are created automatically.
- For rules that require a sample, the sample quantity is rounded to the packaging unit with /SCWM/EX_QM_SAMPLE_ROUND_QTY. Stock waiting for inspection is put away as quality stock to the quality waiting area.
- When the usage decision is made (QA11 or Fiori), the /SCWM/EX_QFU_SET_FUCODE BAdI chooses the logistics follow-up action from the decision code in QAVE: on acceptance, change to unrestricted stock and normal putaway; on rejection, blocked stock and a task to the returns area; on conditional acceptance, unrestricted stock but putaway to a separate storage type. For partial decisions the quantity is split by the decision lines.
- The stock type change and the required warehouse tasks (/SCWM/ORDIM_O) are created automatically with the /SCWM/EX_QFU_STOCK_ACTION BAdI. On rejection, the buyer and the quality owner receive an email with batch, quantity and decision code.
- A monitor shows open inspection lots, decisions made, follow-up actions created and tasks in one screen; items whose follow-up action failed can be reprocessed.
Performance notes
Because the inspection relevance decision runs while the delivery is saved, cache the rule table on first read and avoid database reads per item. Create follow-up actions in the step that runs after the decision is saved, not inside the usage decision itself.
Features
- Line-by-line result and error log Every rule decision and follow-up action is logged with the inspection lot.
- Send the result by email Rejections notify purchasing and quality.
- Double-click drill-down to the document The inspection lot, delivery and warehouse task can be opened from the monitor.
Authorization objects
- Q_INSPLOTInspection lot processing authorization
- Q_UD_CODEUsage decision code authorization
- /SCWM/QFUPLogistics follow-up action authorization
- /SCWM/QDOCEWM inspection document authorization
Frequently asked questions
Does the enhancement need to be rebuilt when the rules change?
No. Inspection relevance and follow-up actions are kept in a maintenance table; the quality team can add rows for a new supplier, material group or decision code. Only adding a new kind of criterion (e.g. a new batch property) needs development.
How is partial acceptance handled?
When the usage decision splits quantities across stock types, each decision line gets its own follow-up action: the accepted quantity goes to unrestricted stock and the rejected quantity to blocked stock and the returns area.
Can it be used with ECC?
The enhancement is written for the integration of EWM with QM inspection lots in S/4HANA. With EWM running separately next to ECC the inspection objects differ, so the rules have to be adapted separately.
Related reports
Inspection Lots Awaiting Usage Decision Aging Report
A custom ALV report that lists inspection lots without a usage decision, with how many days they have been waiting, whether they exceed the target …
Mass Usage Decision for Inspection Lots That Passed All Characteristics
A custom background program that sets the usage decision with a chosen code for inspection lots whose characteristics were all accepted and that have …
Materials with Missing or Inconsistent QM Inspection Setup Report
A custom ALV report that checks the QM settings in the material master against rules and lists each finding with a suggested action: expected …
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.