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

> 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.

- Type: Report, Custom development, ALV report
- Module: QM
- Estimated effort: S (2–4 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/reports/batches-due-for-retest-or-shelf-life-expiry-report/


## 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.

### Closest standard alternatives

- QA07: Creates recurring inspection lots for batches that are due; gives no forward-looking list.
- MB5M: Shows the shelf-life expiry date; does not show the re-test date or the open inspection lot.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| MCHB | Batch stock: unrestricted, quality and blocked (driving table) | Read | - | ECC + S/4 |
| MCHA | Batch dates at plant level | Read | MCHA-MATNR = MCHB-MATNR AND MCHA-WERKS = MCHB-WERKS AND MCHA-CHARG = MCHB-CHARG | ECC + S/4 |
| MCH1 | Batch dates at material or client level | Read | MCH1-MATNR = MCHB-MATNR AND MCH1-CHARG = MCHB-CHARG | ECC + S/4 |
| QALS | Open recurring inspection lot | Read | QALS-MATNR = MCHB-MATNR AND QALS-CHARG = MCHB-CHARG AND QALS-WERK = MCHB-WERKS (HERKUNFT = 09) | ECC + S/4 |
| MAKT | Material description | Read | MAKT-MATNR = MCHB-MATNR AND MAKT-SPRAS = SY-LANGU | ECC + S/4 |

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_WERKS | Plant | Range / multiple | MCHB-WERKS | Yes |
| S_LGORT | Storage location | Range / multiple | MCHB-LGORT | No |
| S_MATNR | Material | Range / multiple | MCHB-MATNR | No |
| S_CHARG | Batch | Range / multiple | MCHB-CHARG | No |
| P_KEYDT | Key date | Single value | - | Yes |
| P_DAYS | Days ahead for warning | Single value | - | No |
| P_STOCK | Only batches with stock | Checkbox | - | No |

## Output columns

| Column | Source |
|---|---|
| Material | MCHB-MATNR |
| Material description | MAKT-MAKTX |
| Storage location | MCHB-LGORT |
| Batch | MCHB-CHARG |
| Unrestricted stock | MCHB-CLABS |
| Quality stock | MCHB-CINSM |
| Blocked stock | MCHB-CSPEM |
| Next inspection date | MCHA-QNDAT |
| Days to re-test | Calculated: QNDAT − key date (a negative value means overdue) |
| Shelf-life expiry | MCHA-VFDAT |
| Days to expiry | Calculated: VFDAT − key date |
| Open inspection lot | QALS-PRUEFLOS |
| Status | Calculated: Expired, re-test overdue (no lot), re-test overdue (lot open), due soon or OK |

## 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.

## Authorization objects

- M_MSEG_WMB: Stock display authorization by plant
- Q_INSPTYPE: Inspection 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.

---
Let us build this report for your system: https://nekuhub.com/en/request-a-quote/?report=qm-batch-retest-shelf-life-due
