QM Report Custom development ALV report

Batches Due for Re-Test or Shelf-Life Expiry Report

Short answer: A custom ALV report that lists batches in stock with their next inspection (re-test) date and shelf-life expiry date, the days remaining and any open recurring inspection lot. Quality and warehouse teams see expired or soon-to-expire stock before it is used.

Estimated effort
S · 2–4 working days
System
ECC and S/4HANA
Tables
5
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

Why is the standard not enough?

QA07 creates recurring inspection lots in the background for batches whose next inspection date has arrived, but it does not give a list of batches that will fall due in the coming weeks. MB5M shows the shelf-life expiry date but does not show the re-test date, quality stock and the open inspection lot on the same line. Tracking both dates together with stock needs a custom report.

Who uses it? Quality control and quality assurance teams, warehouse supervisors and production planning, especially in chemicals, food and pharma.

Closest standard alternatives

  • QA07 Trigger Recurring Inspection. Creates recurring inspection lots for batches that are due; gives no forward-looking list.
  • MB5M BBD/Prod. Date List. Shows the shelf-life expiry date; does not show the re-test date or the open inspection lot.

Tables used

The tables the report reads and their join fields. ECC and S/4HANA differences are marked separately.

TableRoleJoinSystem
MCHBBatch StocksBatch stock: unrestricted, quality and blocked (driving table)—ECC + S/4
MCHABatches (Plant Level)Batch dates at plant levelMCHA-MATNR = MCHB-MATNR AND MCHA-WERKS = MCHB-WERKS AND MCHA-CHARG = MCHB-CHARGECC + S/4
MCH1Batches (Cross-Plant Batch Management)Batch dates at material or client levelMCH1-MATNR = MCHB-MATNR AND MCH1-CHARG = MCHB-CHARGECC + S/4
QALSInspection Lot RecordOpen recurring inspection lotQALS-MATNR = MCHB-MATNR AND QALS-CHARG = MCHB-CHARG AND QALS-WERK = MCHB-WERKS (HERKUNFT = 09)ECC + S/4
MAKTMaterial DescriptionsMaterial descriptionMAKT-MATNR = MCHB-MATNR AND MAKT-SPRAS = SY-LANGUECC + S/4

S/4HANA notes

  • MCHB → MATDOC: In S/4HANA batch stock quantities are calculated from MATDOC through a compatibility view; reads work, but test performance on large selections.

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_WERKSPlantRange / multipleMCHB-WERKSYes1000
S_LGORTStorage locationRange / multipleMCHB-LGORTNo0001
S_MATNRMaterialRange / multipleMCHB-MATNRNoRM-3100
S_CHARGBatchRange / multipleMCHB-CHARGNoB260815
P_KEYDTKey dateSingle value—Yes17.11.2026
P_DAYSDays ahead for warningSingle value—No30
P_STOCKOnly batches with stockCheckbox—NoX

Output columns

#ColumnSource
1MaterialMCHB-MATNR
2Material descriptionMAKT-MAKTX
3Storage locationMCHB-LGORT
4BatchMCHB-CHARG
5Unrestricted stockMCHB-CLABS
6Quality stockMCHB-CINSM
7Blocked stockMCHB-CSPEM
8Next inspection dateMCHA-QNDAT
9Days to re-testCalculated QNDAT − key date (a negative value means overdue)
10Shelf-life expiryMCHA-VFDAT
11Days to expiryCalculated VFDAT − key date
12Open inspection lotQALS-PRUEFLOS
13StatusCalculated Expired, re-test overdue (no lot), re-test overdue (lot open), due soon or OK

Sample output

MaterialMaterial descriptionStorage locationBatchUnrestricted stockQuality stockBlocked stockNext inspection dateDays to re-testShelf-life expiryDays to expiryOpen inspection lotStatus
RM-3100Resin type A0001B2608151,2000011/10/2026-702/15/202790Re-test overdue (no lot)
RM-3100Resin type A0001B2609020800011/14/2026-303/02/2027105090000004512Re-test overdue (lot open)
RM-3240Additive K20002B2606113500012/05/20261812/11/202624Due soon
FG-8020Paint base 20 L0001B2603040014009/30/2026-4811/01/2026-16Expired
A view built with fictional sample data; not real system data.

How does the report work?

  1. Batch stocks in the selected plants and storage locations are read from MCHB; optionally only batches with unrestricted, quality or blocked stock above zero are taken.
  2. Batch dates are read according to the batch level: from MCHA at plant level, from MCH1 at material or client level. The next inspection date is QNDAT, the shelf-life expiry date VFDAT and the production date HSDAT.
  3. Days remaining = date − key date, calculated separately for both dates.
  4. For the same material, batch and plant an inspection lot with origin 09 (recurring inspection) and no usage decision (QALS-STAT35 blank) is searched and its number is shown.
  5. Status: shelf life expired, re-test date passed and no lot (QA07 did not run or no lot was created), due within the days in the parameter, or OK. The material description is added from MAKT.

Performance notes

Read MCHB with the plant and material filters and drop zero-stock batches in the database. Read QALS in bulk with HERKUNFT = 09 and the material list.

Features

  • ALV list (sort, filter, subtotals)
  • User-specific layout variants
  • Double-click drill-down to the document Double-clicking the batch opens MSC3N; clicking the inspection lot opens QA03.
  • Export to Excel
  • Runs as a background job
  • Send the result by email Batches due within the next 30 days can be sent weekly to the quality team.

Authorization objects

  • M_MSEG_WMBStock display authorization by plant
  • Q_INSPTYPEInspection lot authorization by inspection type

Frequently asked questions

Why are batch dates sometimes in MCHA and sometimes in MCH1?

It depends on the batch level setting of the system. At plant level the dates are kept in MCHA; at material or client level in MCH1. The report reads this setting at installation and uses the right table.

Can the report create the recurring inspection lot itself?

The standard version only lists; creating lots is the job of QA07. "Re-test overdue, no lot" lines usually mean the QA07 job is not scheduled or recurring inspection is not active for the material.

What changes on S/4HANA?

On S/4HANA MCHB can still be read as a compatibility view and stock is calculated from material documents; the batch date fields do not change. The report logic stays the same.

Related reports

MM Report Custom ALV report

Stock Aging Report

A custom ALV report that shows how many days each material has been in stock since its last goods receipt and which age bucket (0–30, 31–90, 91–180, …

MARD · MARA · MAKT · MBEW

Let us build this report 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: Batches Due for Re-Test or Shelf-Life Expiry Report