Batch Shelf Life Tracking Report (Batches Close to Expiry)
Short answer: A custom ALV report that lists batches close to or past their expiry date with remaining days, remaining shelf life percentage and stock value. Food, pharma and chemical companies can take write-off and discount decisions in time.
- Estimated effort
- S · 3–5 working days
- System
- ECC and S/4HANA
- Tables
- 5
- Scope
- Global · 3 industries
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
MB5M lists batches by expiry date but does not give the remaining shelf life percentage, the stock value or automatic alerts such as "expiring in the next 30 days". Companies that ship with a minimum remaining shelf life calculate this separately every day.
Who uses it? Warehouse and quality teams, sales planning and inventory controllers.
Closest standard alternatives
Tables used
The tables the report reads and their join fields. ECC and S/4HANA differences are marked separately.
| Table | Role | Join | System |
|---|---|---|---|
| MCHBBatch Stocks | Stock per batch (driving table) | — | ECC + S/4 |
| MCHABatches (Plant Level) | Date of manufacture and expiration date | MCHA-MATNR = MCHB-MATNR AND MCHA-WERKS = MCHB-WERKS AND MCHA-CHARG = MCHB-CHARG | ECC + S/4 |
| MARAGeneral Material Data | Total and minimum remaining shelf life, base unit | MARA-MATNR = MCHB-MATNR | ECC + S/4 |
| MAKTMaterial Descriptions | Material description | MAKT-MATNR = MCHB-MATNR AND MAKT-SPRAS = SY-LANGU | ECC + S/4 |
| MBEWMaterial Valuation | Price for stock value | MBEW-MATNR = MCHB-MATNR AND MBEW-BWKEY = değerleme alanı (üretim yeri) | ECC + 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.
- MBEW: In S/4HANA the Material Ledger is mandatory and valuation data is read through a compatibility view. Prices remain readable; validate value calculations against the currency and valuation view in use.
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_WERKS | Plant | Range / multiple | MCHB-WERKS | Yes | 1000 |
| S_LGORT | Storage location | Range / multiple | MCHB-LGORT | No | 0001 |
| S_MATNR | Material | Range / multiple | MCHB-MATNR | No | FG-7001 |
| S_MTART | Material type | Range / multiple | MARA-MTART | No | FERT |
| P_DAYS | Batches expiring within (days) | Single value | — | Yes | 120 |
| P_EXPIRD | Also show expired batches | Checkbox | — | No | X |
Output columns
| # | Column | Source |
|---|---|---|
| 1 | Plant | MCHB-WERKS |
| 2 | Storage loc. | MCHB-LGORT |
| 3 | Material | MCHB-MATNR |
| 4 | Description | MAKT-MAKTX |
| 5 | Batch | MCHB-CHARG |
| 6 | Produced | MCHA-HSDAT |
| 7 | Expires | MCHA-VFDAT |
| 8 | Days left | Calculated MCHA-VFDAT − key date (negative: expired) |
| 9 | Shelf life left % | Calculated Days left ÷ (MCHA-VFDAT − MCHA-HSDAT) × 100 |
| 10 | Unrestricted | MCHB-CLABS |
| 11 | Unit | MARA-MEINS |
| 12 | Stock value | Calculated Unrestricted stock × MBEW price ÷ price unit |
Sample output
| Plant | Storage loc. | Material | Description | Batch | Produced | Expires | Days left | Shelf life left % | Unrestricted | Unit | Stock value |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1000 | 0001 | FG-7002 | Yogurt 500 g | B261102 | 11/02/2026 | 11/23/2026 | 7 | 33.30 | 800 | PC | 9,920 |
| 1000 | 0001 | FG-7001 | Fruit juice 1 L | B261003 | 06/03/2026 | 11/30/2026 | 14 | 7.80 | 1,200 | PC | 22,200 |
| 2000 | 0003 | RM-8010 | Active ingredient X | P2508 | 08/15/2025 | 02/15/2027 | 91 | 16.60 | 35 | KG | 14,700 |
| 1000 | 0002 | FG-7001 | Fruit juice 1 L | B260901 | 03/10/2026 | 09/06/2026 | -71 | 0 | 60 | PC | 1,110 |
How does the report work?
- Batch stocks are read from MCHB for the selected plants and storage locations; batches without stock are skipped.
- Each batch’s date of manufacture and shelf life expiration date come from MCHA (or MCH1 when the batch level is the material).
- Remaining days = expiration date − key date. Remaining shelf life % = remaining days ÷ (expiration date − date of manufacture).
- Only batches expiring within the day limit on the selection screen (optionally also expired ones) are listed.
- Stock value is calculated with the MBEW price; the result can be emailed to the quality team.
Performance notes
Read MCHB by plant and storage location; in S/4HANA batch stocks are calculated from MATDOC, so run very wide selections in the background.
Features
- ALV list (sort, filter, subtotals)
- User-specific layout variants
- Send the result by email Batches expiring soon are sent to the quality and sales teams every morning.
- Runs as a background job
- Export to Excel
Authorization objects
- M_MSEG_WMBStock and material document display authorization by plant
- M_MATE_WRKMaterial master authorization by plant
Frequently asked questions
Does the report work when the batch level is the material?
Yes. When the batch level is the material, the dates are read from MCH1 instead of MCHA; this setting is checked during installation.
Can a customer-specific minimum shelf life rule be added?
Yes. A minimum remaining shelf life per customer or channel can be added as a pre-shipment check; this increases the effort range.
Related reports
Mass Material Master Upload Program
A custom program that creates or updates material master data in bulk from Excel or CSV rows, including the basic data, plant and valuation views. It …
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, …
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.