MKPF table — Material Document Header Table MKPF
MKPF stores the header of a material document: one row per posted goods movement document, holding the document number, fiscal year, posting date, document date, entry date/time, the user who posted it, and the transaction that triggered it. Every line item detail such as material, quantity, plant and movement type sits in MSEG, linked back to MKPF by document number and year.
MKPF is the header table behind every material document created in MM inventory management, covering goods receipts, goods issues, transfer postings and stock corrections. This page covers how to join it to line items, how to read it without a runaway selection, and the pitfalls consultants hit when they try to answer a stock movement question from MKPF alone.
Published 15 Sept 2026· 1,142 words
What it stores
A row in MKPF represents the header of one material document, the object created every time an MM goods movement is posted, whether through a goods receipt against a purchase order, a goods issue to a cost center or reservation, a transfer posting between plants or storage locations, or a physical inventory difference posting. The header carries information common to the whole document: who posted it, when it was posted, when it was entered into the system, what reference document or external document number was attached, and which transaction or process triggered the posting. It does not carry material, quantity, plant or movement type; those live one level down, in the material document item table. A material document can have many items under one header, so MKPF is always the smaller, coarser-grained table of the pair, and querying it alone tells you a movement happened and who caused it, not what actually moved.
Key fields
- MANDT - client
- MBLNR - material document number, the primary key shared with the item table
- MJAHR - material document year, part of the key because document numbers recycle by year
- BLDAT - document date, the date printed on the external document such as a delivery note
- BUDAT - posting date, the date the movement hits the stock and accounts, this is the date used for period control
- CPUDT - entry date, when the document was actually created in the system
- CPUTM - entry time
- USNAM - user name who posted the document
- TCODE2 - transaction code used for the posting
- XBLNR - reference document number, often the vendor delivery note or customer document number
- BKTXT - document header text
- VGART - transaction/event type, distinguishes goods movement from other document origins
How it joins the data model
- MKPF-MBLNR = MSEG-MBLNR and MKPF-MJAHR = MSEG-MJAHR, the standard join to reach the movement line items, quantities, materials and plants
- MSEG-EBELN = EKPO-EBELN and MSEG-EBELP = EKPO-EBELP, to trace a goods movement back to the purchase order line it was posted against
- MSEG-EBELN/EBELP = EKBE-EBELN/EBELP, to reconcile the movement against the purchase order history record it generated
- MKPF-USNAM against user master tables when investigating who posted a suspicious or duplicate document
- MKPF-XBLNR against the vendor invoice reference fields in RBKP/RSEG when tracing a three-way match discrepancy back to the physical receipt
How to read it safely
MANDT is always the first restriction. After that, MKPF is only ever usefully queried with a document number and year, or a posting date range plus another restriction such as user or transaction code, because on any live productive system it accumulates one row per goods movement across every plant and every material, which on a mature system means many millions of rows. Never select from MKPF on BUDAT alone across a wide date range without a second filter; it will scan the whole table. If the requirement is to find movements for a given material or plant, that filter exists on MSEG, not MKPF, so start the query there and join up to MKPF for the date and user, rather than starting in MKPF and joining down.
How to prove it in the data
Symptom: a warehouse team claims goods receipt 5000012345 was never posted, but stock on hand looks correct. Selection: read MKPF on MBLNR and MJAHR for the document number quoted; if a row exists, the document was posted, note BUDAT, CPUDT and USNAM. Then join to MSEG on the same key to confirm which plant, storage location and material actually received quantity, since the header alone cannot confirm what moved, only that something was posted and by whom.
ECC vs S/4HANA
MKPF continues to exist as a transparent table in S/4HANA and is still written by standard goods movement postings, so existing reports and joins against it keep working. Under the covers, S/4HANA consolidates material document header and item data into the universal journal-adjacent table MATDOC, and MKPF/MSEG are exposed as compatibility views over that structure for classic ABAP programs and custom code. New developments are generally steered toward MATDOC or the corresponding CDS views rather than direct MKPF/MSEG selects, but nothing in a functional consultant's day-to-day analysis changes.
Common pitfalls
- Treating MKPF as if it holds quantity or material information; every field a consultant actually needs to answer a stock question, such as movement type, quantity, plant, storage location or batch, is on MSEG, not MKPF
- Assuming BUDAT and BLDAT are the same date; BLDAT is the external document date and can be days or weeks earlier than BUDAT, which drives period and stock valuation, mismatches between the two are normal and expected, not an error
- Filtering only on BUDAT to reconcile a period-end stock discrepancy and missing documents posted late into a closed period with a backdated BUDAT; CPUDT (actual entry date) is the field that reveals late postings, not BUDAT
- Assuming one MKPF row means one stock movement; a single material document header can cover many item lines with different movement types and even different plants, so counting MKPF rows to count movements undercounts activity
- Confusing TCODE2 with the transaction the end user actually typed; background postings from IDocs, batch jobs or interface programs can populate this field with a generic or unexpected value, so it is not reliable evidence of manual intervention on its own
- Trying to reverse-engineer a cancelled document's effect from MKPF alone; a cancellation creates its own new material document header referencing the original, it does not delete or flag the original row
Whose problem this is
A question about a specific document header, such as who posted it or on what date, is a functional MM inventory management question, owned by whoever configured goods movement processes. Questions about the underlying table structure, indexing, or migration behavior into MATDOC belong to the technical/Basis or ABAP development side, particularly during an S/4HANA conversion project.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-tables/mkpfERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.