{"audience":"Incoming quality inspection teams, warehouse supervisors, purchasing, quality assurance managers.","authorization_objects":[{"note":"Inspection lot processing authorization","object":"Q_INSPLOT"},{"note":"Usage decision code authorization","object":"Q_UD_CODE"},{"note":"Logistics follow-up action authorization","object":"/SCWM/QFUP"},{"note":"EWM inspection document authorization","object":"/SCWM/QDOC"}],"components":[],"countries":[],"effort_days_max":22,"effort_days_min":15,"effort_size":"L","faq":[{"a":"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.","q":"Does the enhancement need to be rebuilt when the rules change?"},{"a":"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.","q":"How is partial acceptance handled?"},{"a":"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.","q":"Can it be used with ECC?"}],"features":[{"code":"log","label":"Line-by-line result and error log","note":"Every rule decision and follow-up action is logged with the inspection lot."},{"code":"email","label":"Send the result by email","note":"Rejections notify purchasing and quality."},{"code":"drilldown","label":"Double-click drill-down to the document","note":"The inspection lot, delivery and warehouse task can be opened from the monitor."}],"functions":[{"name":"BAPI_INSPLOT_GETDETAIL","role":"Reads status and decision data of the inspection lot"},{"name":"SO_NEW_DOCUMENT_ATT_SEND_API1","role":"Sends an email to purchasing and quality on rejection"}],"gap":"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.","id":"ewm-quality-inspection-follow-up","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-18","logic":"1. 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.\n2. 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.\n3. 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.\n4. 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.\n5. 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.\n6. 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.","module":"WM","object_type":"enhancement","output_columns":[{"calculated":false,"formula":"","label":"Inspection lot","source_field":"PRUEFLOS","source_table":"QALS"},{"calculated":false,"formula":"","label":"Material","source_field":"MATNR","source_table":"QALS"},{"calculated":false,"formula":"","label":"Batch","source_field":"CHARG","source_table":"QALS"},{"calculated":false,"formula":"","label":"Supplier","source_field":"LIFNR","source_table":"QALS"},{"calculated":false,"formula":"","label":"Supplier name","source_field":"NAME1","source_table":"LFA1"},{"calculated":false,"formula":"","label":"Lot quantity","source_field":"LOSMENGE","source_table":"QALS"},{"calculated":true,"formula":"Matching row in the rule table: inspection required, sample or no inspection","label":"Applied rule","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Decision code","source_field":"VCODE","source_table":"QAVE"},{"calculated":true,"formula":"Action chosen from the decision code: unrestricted, blocked + returns area, conditional acceptance area","label":"Follow-up action","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Destination bin","source_field":"NLPLA","source_table":"/SCWM/ORDIM_O"},{"calculated":false,"formula":"","label":"Warehouse task","source_field":"TANUM","source_table":"/SCWM/ORDIM_O"},{"calculated":true,"formula":"Awaiting decision, follow-up complete or error","label":"Status","source_field":null,"source_table":null}],"parameters":[{"example":"W100","kind":"parameter","label":"Warehouse number","name":"P_LGNUM","ref_field":"/SCWM/LAGP-LGNUM","required":true},{"example":"1000","kind":"select_option","label":"Plant","name":"S_WERK","ref_field":"QALS-WERK","required":true},{"example":"HM-1001","kind":"select_option","label":"Material","name":"S_MATNR","ref_field":"QALS-MATNR","required":false},{"example":"300045","kind":"select_option","label":"Supplier","name":"S_LIFNR","ref_field":"QALS-LIFNR","required":false},{"example":"X","kind":"checkbox","label":"Only items with incomplete follow-up","name":"P_OPEN","ref_field":"","required":false}],"part_of":[],"performance":"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.","process":"INV","quote_url":"https://nekuhub.com/en/request-a-quote/?report=ewm-quality-inspection-follow-up","related":["qm-inspection-lots-pending-ud-aging","qm-mass-usage-decision","qm-material-inspection-setup-check"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Records the usage decision; the follow-up action is tied to the decision code in a fixed way.","tcode":"QA11"},{"note":"Lists and processes inspection lots; does not decide whether a lot is opened.","tcode":"QA32"},{"note":"Changes the stock type manually; no automatic routing based on the usage decision.","tcode":"/SCWM/POST"}],"summary":"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.","tables":[{"access":"read","join_on":"","role":"EWM inbound delivery header","table":"/SCDL/DB_PROCH_I","variant":"both"},{"access":"read","join_on":"/SCDL/DB_PROCI_I-DOCID = /SCDL/DB_PROCH_I-DOCID","role":"EWM inbound delivery items: product, batch, quantity","table":"/SCDL/DB_PROCI_I","variant":"both"},{"access":"read","join_on":"","role":"Active inspection types of the material","table":"QMAT","variant":"both"},{"access":"read_write","join_on":"","role":"Inspection lot: material, batch, supplier, lot quantity","table":"QALS","variant":"both"},{"access":"read","join_on":"QAVE-PRUEFLOS = QALS-PRUEFLOS","role":"Usage decision and decision code","table":"QAVE","variant":"both"},{"access":"read","join_on":"LFA1-LIFNR = QALS-LIFNR","role":"Supplier name (rule and monitor)","table":"LFA1","variant":"both"},{"access":"read","join_on":"","role":"Quality stock and stock type after the follow-up action","table":"/SCWM/AQUA","variant":"both"},{"access":"read","join_on":"","role":"Inspected handling unit","table":"/SCWM/HUHDR","variant":"both"},{"access":"write","join_on":"","role":"Putaway or returns area task created by the follow-up action","table":"/SCWM/ORDIM_O","variant":"both"}],"title":"EWM–QM Integration: Rule-Based Inspection Lots and Automatic Stock Routing After the Usage Decision","url":"https://nekuhub.com/en/programs/ewm-qm-integration-rule-based-inspection-lots-and-automatic-stock-routing/","vendor_id":"nekudos"}