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

  • MB5M BBD/Prod. Date List. Lists batches by expiry date; no remaining shelf life percentage, stock value or automatic alert.
  • MB52 List of Warehouse Stocks on Hand. Shows batch stocks; does not consider the expiry date.

Tables used

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

TableRoleJoinSystem
MCHBBatch StocksStock per batch (driving table)—ECC + S/4
MCHABatches (Plant Level)Date of manufacture and expiration dateMCHA-MATNR = MCHB-MATNR AND MCHA-WERKS = MCHB-WERKS AND MCHA-CHARG = MCHB-CHARGECC + S/4
MARAGeneral Material DataTotal and minimum remaining shelf life, base unitMARA-MATNR = MCHB-MATNRECC + S/4
MAKTMaterial DescriptionsMaterial descriptionMAKT-MATNR = MCHB-MATNR AND MAKT-SPRAS = SY-LANGUECC + S/4
MBEWMaterial ValuationPrice for stock valueMBEW-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

ParameterDescriptionTypeReference fieldRequiredExample
S_WERKSPlantRange / multipleMCHB-WERKSYes1000
S_LGORTStorage locationRange / multipleMCHB-LGORTNo0001
S_MATNRMaterialRange / multipleMCHB-MATNRNoFG-7001
S_MTARTMaterial typeRange / multipleMARA-MTARTNoFERT
P_DAYSBatches expiring within (days)Single value—Yes120
P_EXPIRDAlso show expired batchesCheckbox—NoX

Output columns

#ColumnSource
1PlantMCHB-WERKS
2Storage loc.MCHB-LGORT
3MaterialMCHB-MATNR
4DescriptionMAKT-MAKTX
5BatchMCHB-CHARG
6ProducedMCHA-HSDAT
7ExpiresMCHA-VFDAT
8Days leftCalculated MCHA-VFDAT − key date (negative: expired)
9Shelf life left %Calculated Days left ÷ (MCHA-VFDAT − MCHA-HSDAT) × 100
10UnrestrictedMCHB-CLABS
11UnitMARA-MEINS
12Stock valueCalculated Unrestricted stock × MBEW price ÷ price unit

Sample output

PlantStorage loc.MaterialDescriptionBatchProducedExpiresDays leftShelf life left %UnrestrictedUnitStock value
10000001FG-7002Yogurt 500 gB26110211/02/202611/23/2026733.30800PC9,920
10000001FG-7001Fruit juice 1 LB26100306/03/202611/30/2026147.801,200PC22,200
20000003RM-8010Active ingredient XP250808/15/202502/15/20279116.6035KG14,700
10000002FG-7001Fruit juice 1 LB26090103/10/202609/06/2026-71060PC1,110
A view built with fictional sample data; not real system data.

How does the report work?

  1. Batch stocks are read from MCHB for the selected plants and storage locations; batches without stock are skipped.
  2. Each batch’s date of manufacture and shelf life expiration date come from MCHA (or MCH1 when the batch level is the material).
  3. Remaining days = expiration date − key date. Remaining shelf life % = remaining days ÷ (expiration date − date of manufacture).
  4. Only batches expiring within the day limit on the selection screen (optionally also expired ones) are listed.
  5. 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

MM Program Custom Mass upload

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 …

MARA · MAKT · MARC · MBEW

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: Batch Shelf Life Tracking Report (Batches Close to Expiry)