Skip to content
SAP Reference

MI04

Create S/4HANA status: Active

Enter Inventory Count with Document

Notes

Mapped here to MARD/MCHB/MARA — the stock the count is taken against. The physical-inventory document itself (header IKPF, item ISEG) is not in this catalog.

What the badges mean
S/4HANA status: Active
Active and unchanged in S/4HANA.
S/4HANA status: Deprecated
Still readable today, but no longer SAP's strategic path — plan around it.
S/4HANA status: Replaced
Replaced by a new persistence in S/4HANA; the classic name may still answer reads (see read mechanism).
S/4HANA status: Migrating to IBP
Planning scope is moving from APO toward IBP.
S/4HANA status: Active (StRM) · Replaced (EWM)
Path-dependent: active with SAP Stock Room Management, replaced where EWM is the warehouse path.
S/4HANA status: Replaced · Compat View
Compatibility view: the classic table name is redirected to a view over the new persistence — see how the physical model moved.
S/4HANA status: Active · Proxy View
Proxy view: reads route through NSDM proxy/CDS views — see how the physical model moved.
master
Data class: what the table holds — master data, transaction documents, org structure, config, or texts (one row per language — see the quirks guide).
In field listings, K marks a primary-key field, and linked type codes in the Type column jump to the matching quirks-guide section.

Boilerplate SQL

Databricks SQL

Starting point for querying the tables behind this transaction. Set your Unity Catalog location and filter values below — they’re substituted into the SQL and the copy button.

Query parameters

6 parameters not filled: <catalog>, <schema>, <MANDT>, <MATNR>, <WERKS>, <LGORT>

-- ============================================================
-- T-Code : MI04 Enter Inventory Count with Document
-- Purpose: Enter Inventory Count with Document — auto-generated boilerplate from tcode-table-map
-- Grain  : One row per MARD joined to MARD, MCHB, MARA
-- Tables : MARD, MARD, MCHB, MARA
-- Notes  : Auto-generated skeleton. Add MAKT/T001W/LFA1/KNA1 enrichment joins as needed for the business question. Set catalog/schema to your Unity Catalog location; fill remaining placeholders (<...>) for your tenant.
-- ============================================================
SELECT
  m.MANDT  AS "Client",
  m.MATNR  AS "Material Number",
  m.WERKS  AS "Plant",
  m.LGORT  AS "Storage Location",
  mc.CHARG AS "Batch Number"
FROM <catalog>.<schema>.mard m
LEFT JOIN <catalog>.<schema>.mard m
  ON m.MANDT = m.MANDT
 AND m.MATNR = m.MATNR
 AND m.WERKS = m.WERKS
 AND m.LGORT = m.LGORT
LEFT JOIN <catalog>.<schema>.mchb mc
  ON mc.MANDT = m.MANDT
 AND mc.MATNR = m.MATNR
 AND mc.WERKS = m.WERKS
 AND mc.LGORT = m.LGORT
LEFT JOIN <catalog>.<schema>.mara ma
  ON ma.MANDT = m.MANDT
 AND ma.MATNR = m.MATNR
WHERE
  m.MANDT = '<MANDT>'
  AND m.MATNR = '<MATNR>'
  AND m.WERKS = '<WERKS>'
  AND m.LGORT = '<LGORT>'
ORDER BY m.MATNR;

Tables Used by This Transaction

A curated list of the main business tables behind this transaction, drawn from this reference’s catalog. Tables a query joins only for names and descriptions may be left out.

More Materials Management t-codes