Mass Usage Decision for Inspection Lots That Passed All Characteristics
Short answer: A custom background program that sets the usage decision with a chosen code for inspection lots whose characteristics were all accepted and that have no open quality notification, and posts the quality stock to unrestricted stock. Quality teams deal only with problem lots, and clean lots do not wait in stock.
- Estimated effort
- M · 4–6 working days
- System
- ECC and S/4HANA
- Tables
- 5
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
QA11 makes the usage decision for one lot. QA16 offers a collective decision for accepted lots, but it is a dialog and does not apply company-specific checks (open notification, minimum waiting time, selected inspection types). The automatic usage decision setting in the inspection type works with a single code per inspection type and does not report which lot was skipped and why.
Who uses it? Quality control supervisors, laboratory teams, and warehouse and production planners who need quality stock released quickly.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| QALSInspection Lot Record | Candidate inspection lots and quantity to be posted | Read | ECC + S/4 |
| QAMVCharacteristic Specifications for Inspection Processing | Characteristics of the lot | Read | ECC + S/4 |
| QAMRCharacteristic Results During Inspection Processing | Characteristic valuation; all must be accepted | Read | ECC + S/4 |
| QMELNotification Header | Open quality notification linked to the lot (check) | Read | ECC + S/4 |
| QAVEUsage Decision | Usage decision that is set | Write | ECC + S/4 |
BAPIs and functions used
- BAPI_INSPLOT_GETSTATUSRead Inspection Lot Status. Checks the lot status and that results recording is complete
- BAPI_INSPLOT_SETUSAGEDECISIONSet Usage Decision. Sets the usage decision and posts the quality stock
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves the decision permanently
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_WERK | Plant | Range / multiple | QALS-WERK | Yes | 1000 |
| S_ART | Inspection type | Range / multiple | QALS-ART | Yes | 04 |
| S_HERK | Lot origin | Range / multiple | QALS-HERKUNFT | No | 04 |
| S_MATNR | Material | Range / multiple | QALS-MATNR | No | FG-2050 |
| P_CODGRP | Usage decision code group | Single value | QAVE-VCODEGRP | Yes | UD01 |
| P_VCODE | Usage decision code | Single value | QAVE-VCODE | Yes | A1 |
| P_MINAGE | Minimum days since lot creation | Single value | — | No | 0 |
| P_NOTIF | Skip lots with an open quality notification | Checkbox | — | No | X |
| P_TEST | Test mode (list without deciding) | Checkbox | — | No | X |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Inspection lot | QALS-PRUEFLOS |
| 2 | Material | QALS-MATNR |
| 3 | Batch | QALS-CHARG |
| 4 | Posted to unrestricted | QALS-LMENGEZUB |
| 5 | Unit | QALS-MENGENEINH |
| 6 | Decision code | QAVE-VCODE |
| 7 | Status | Calculated Decided, eligible (test) or skipped |
| 8 | Message | Calculated Reason for skipping or the BAPI return message |
Sample result list
| Inspection lot | Material | Batch | Posted to unrestricted | Unit | Decision code | Status | Message |
|---|---|---|---|---|---|---|---|
| 040000001877 | FG-2050 | P2611-15 | 1,200 | KG | A1 | Decided | Usage decision saved, 1,200 KG posted to unrestricted stock |
| 040000001880 | FG-2051 | P2611-16 | 800 | KG | Skipped | Characteristic 0040 is open | |
| 040000001884 | FG-1002 | P2611-17 | 0 | PC | Skipped | Open quality notification exists: 300001275 |
How does the program work?
- Lots without a usage decision (QALS-STAT35 blank) and created at least the set number of days ago are read from QALS with the plant, inspection type, lot origin and material from the selection screen.
- BAPI_INSPLOT_GETSTATUS checks that results recording is complete. Every characteristic in QAMV must have an accepting valuation in QAMR (MBEWERTG = A); lots with open or rejected characteristics are skipped.
- If selected, lots with an open quality notification linked to the lot (QMEL-PRUEFLOS) are skipped.
- BAPI_INSPLOT_SETUSAGEDECISION is called with the code group and code from the selection screen; the quantity still to be posted (LMENGEZUB) is posted to unrestricted stock.
- In test mode only the eligible lots are listed; in a real run BAPI_TRANSACTION_COMMIT follows each lot. Decided and skipped lots are logged with their reasons and a summary is sent by email.
Performance notes
Schedule the program as a background job that runs hourly or at the end of each shift. Read QAMV and QAMR once with the list of candidate lots; committing per lot isolates locked lots.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Runs as a background job
- Send the result by email After each run, a summary of decided and skipped lots is sent to the quality supervisor.
Authorization objects
- Q_INSPTYPEInspection lot authorization by inspection type
- Q_GP_CODEAuthorization for the usage decision code group
- M_MSEG_WMBMaterial document authorization by plant for the stock posting
Frequently asked questions
Which lots get a decision?
Only lots whose characteristics are all valuated as accepted, whose results recording is complete and, if selected, that have no open quality notification. All other lots are skipped and the reason is logged.
Can stock be posted to a stock type other than unrestricted?
Yes. A target stock type (e.g. keep in quality stock, blocked stock) can be added to the selection screen, or the target can be set per inspection type.
Can this program be used on S/4HANA?
Yes. BAPI_INSPLOT_SETUSAGEDECISION is supported on S/4HANA and the QM tables keep the same structure.
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 …
Inspection Results Upload from Laboratory File Program
A custom interface program that records the measured values in a CSV/XLSX file produced by laboratory instruments or a laboratory information system …
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.