Inspection Results Upload from Laboratory File Program
Short answer: A custom interface program that records the measured values in a CSV/XLSX file produced by laboratory instruments or a laboratory information system against inspection lot characteristics in bulk. It removes manual results entry and typing errors, checks everything in test mode and can valuate and close the characteristics.
- Estimated effort
- M · 5–7 working days
- System
- ECC and S/4HANA
- Tables
- 4
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
QE51N and QE01 expect results to be keyed in on the screen; there is no standard transaction that reads measured values from a file on a schedule. Certified laboratory interfaces need setup and licences. For laboratories that get a CSV from their instruments, a simple interface that reads the file and records the results through the standard BAPI is enough.
Who uses it? Laboratory analysts and supervisors, quality control engineers and QM consultants.
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 | Inspection lot and usage decision status (check) | Read | ECC + S/4 |
| QAMVCharacteristic Specifications for Inspection Processing | Characteristic definition, unit and tolerance limits (check) | Read | ECC + S/4 |
| QAMRCharacteristic Results During Inspection Processing | Characteristic result and valuation | Write | ECC + S/4 |
| QASEResults Table for the Sample Unit | Single measured values | Write | ECC + S/4 |
BAPIs and functions used
- BAPI_INSPOPER_GETCHARSelect Inspection Characteristics. Reads the characteristics and limits of the lot operation
- BAPI_INSPOPER_RECORDRESULTSRecord Inspection Results. Records the results and optionally valuates and closes them
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back in test mode
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful results permanently
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Results file or folder | Single value | — | Yes | /usr/sap/lab/in/ |
| P_SERVER | Read from application server (background) | Checkbox | — | No | X |
| P_CLOSE | Valuate and close characteristics | Checkbox | — | No | X |
| P_TEST | Test mode (check without saving) | Checkbox | — | No | X |
Input file columns
The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.
| # | Column | Target field | Required |
|---|---|---|---|
| 1 | Inspection lot | QALS-PRUEFLOS | Yes |
| 2 | Operation number | By rule Operation number from the inspection plan (e.g. 0010); passed to the BAPI as the operation | Yes |
| 3 | Characteristic no. | QAMV-MERKNR | No |
| 4 | Master characteristic (instead of no.) | QAMV-VERWMERKM | No |
| 5 | Measured value | QASE-MESSWERT | Yes |
| 6 | Inspector | QASE-PRUEFER | No |
| 7 | Inspection date | QASE-PRUEFDATUV | No |
Sample upload file
| 1 | Inspection lot * | Operation number * | Characteristic no. | Master characteristic (instead of no.) | Measured value * | Inspector | Inspection date |
|---|---|---|---|---|---|---|---|
| 2 | 040000001877 | 0010 | 0010 | 1.04 | LAB01 | 11/16/2026 | |
| 3 | 040000001877 | 0010 | VISKOZITE | 2,350 | LAB01 | 11/16/2026 | |
| 4 | 040000001877 | 0010 | RENK-DELTAE | 1.80 | LAB02 | 11/16/2026 |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Inspection lot | QALS-PRUEFLOS |
| 3 | Characteristic no. | QAMV-MERKNR |
| 4 | Characteristic text | QAMV-KURZTEXT |
| 5 | Value | Calculated Measured value from the file |
| 6 | Valuation | QAMR-MBEWERTG |
| 7 | Status | Calculated From the BAPI return messages: checked, recorded or error |
| 8 | Message | Calculated First error or success message from the BAPI return table |
Sample result list
| Row | Inspection lot | Characteristic no. | Characteristic text | Value | Valuation | Status | Message |
|---|---|---|---|---|---|---|---|
| 2 | 040000001877 | 0010 | Density | 1.04 | A | Recorded | Result recorded |
| 3 | 040000001877 | 0030 | Viscosity at 25 °C | 2,350 | A | Recorded | Result recorded |
| 4 | 040000001877 | 0040 | Colour difference ΔE | 1.80 | Error | Characteristic is already closed |
How does the program work?
- The file is read from the user’s PC or, in a background job, from a folder on the application server; the first row is skipped as the header.
- Each row is split into inspection lot, operation number, characteristic number (or master characteristic), measured value, inspector and date.
- BAPI_INSPOPER_GETCHAR reads the characteristics and tolerance limits of the lot. Checks: the lot exists and has no usage decision (QALS-STAT35 blank), the characteristic is open, and for quantitative characteristics the value is numeric.
- BAPI_INSPOPER_RECORDRESULTS records the results as single values or as a summary; with “Valuate and close” selected, the characteristic is accepted or rejected against its tolerance limits and closed.
- In test mode the change is rolled back with BAPI_TRANSACTION_ROLLBACK; in a real run BAPI_TRANSACTION_COMMIT follows each lot. The processed file is moved to an archive folder and failed rows are written to a separate file.
Performance notes
Group the rows by inspection lot and operation and call the BAPI once per group. For folder monitoring, schedule a background job that runs every 15–30 minutes.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Download failed lines as a separate file Failed rows are written to a separate file and can be loaded again after correction.
- Runs as a background job
- Send the result by email Files with failed rows are reported to the laboratory supervisor by email.
Authorization objects
- Q_INSPTYPEInspection lot authorization by inspection type
- Q_TCODEQM transaction code authorization for results recording
Frequently asked questions
Are different instrument file formats supported?
Yes. The column mapping for each instrument or lab system can be kept in a small maintenance table, so adding a new instrument does not need a code change.
Can qualitative (coded) characteristics be loaded?
Yes. If the file holds a code group and code instead of a value, the program records it as a qualitative result.
Can this program be used on S/4HANA?
Yes. BAPI_INSPOPER_RECORDRESULTS is supported on S/4HANA and the QM tables keep the same structure.
Related reports
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 …
Usage Decisions Made Before All Characteristics Were Recorded Report
A custom ALV report that lists, for inspection lots that already have a usage decision, the characteristics that were never recorded or valuated, with …
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.