SAP tableObjectMSEGModuleMM_P2P

MSEG table — MSEG Material Document Line Items

MSEG stores the line items of material documents, one row per material movement within a goods receipt, goods issue, transfer posting, or physical inventory document. Each row carries the movement type, material, plant, storage location, quantity, and value change for that line. The document header, including posting date and document date, lives separately in MKPF.

MSEG is the item-level table behind every goods movement in MM inventory management, from goods receipts against a purchase order to internal transfers and consumption postings. This page covers the fields that actually matter when tracing a movement, the joins into purchasing and material master tables, and the mistakes consultants make when reading quantities and values off this table directly.

Published 15 Sept 2026· 1,151 words

What it stores

One row in MSEG represents a single material movement line within a material document. A material document created by a single posting transaction can contain many lines, for example a goods receipt against a purchase order with ten line items, or a transfer posting moving three different materials at once. Each row records what moved, from where, to where, in what quantity, and the resulting value change to inventory. The movement type on the row determines what kind of event it is: goods receipt, goods issue, stock transfer, physical inventory difference, and so on. MSEG never stands alone; every row belongs to exactly one header row in MKPF, identified by document number and fiscal year. Reversal movements appear as separate rows with an offsetting quantity, not as an update to the original row.

Key fields

  • MANDT - client
  • MBLNR - material document number, joins to MKPF
  • MJAHR - material document year, part of the key together with MBLNR
  • ZEILE - line item number within the document
  • BWART - movement type, drives the accounting and stock logic for the line
  • MATNR - material number
  • WERK - plant
  • LGORT - storage location
  • CHARG - batch number, populated for batch-managed materials
  • MENGE - quantity in the base unit of measure
  • MEINS - base unit of measure for MENGE
  • DMBTR - amount in local currency, the value effect of the movement
  • WAERS - currency key
  • SHKZG - debit/credit indicator, S or H, needed to sign the quantity and value correctly
  • EBELN - purchase order number, populated when the movement is tied to procurement
  • EBELP - purchase order item number
  • LIFNR - vendor number, populated on vendor-related movements
  • SOBKZ - special stock indicator, for consignment, subcontracting, project stock and similar

How it joins the data model

  • MSEG-MBLNR = MKPF-MBLNR and MSEG-MJAHR = MKPF-MJAHR for the document header, posting date, and document date
  • MSEG-EBELN = EKPO-EBELN and MSEG-EBELP = EKPO-EBELP to reach the purchase order line the movement was posted against
  • MSEG-MATNR = MARA-MATNR for material master data that does not vary by plant
  • MSEG-MATNR = MARC-MATNR and MSEG-WERK = MARC-WERK for plant-specific material data such as MRP type and purchasing group
  • MSEG-MATNR, MSEG-WERK, MSEG-LGORT = MARD on the same three fields for storage-location stock
  • MSEG-LIFNR = LFA1-LIFNR for vendor master data on vendor-related movements

How to read it safely

MSEG has no direct posting date field, so any date restriction has to come through MKPF-BUDAT or MKPF-CPUDT joined on MBLNR and MJAHR; selecting MSEG alone by a date range is not possible and pulling the full table to filter in an application layer will time out on any live system. Always restrict by MANDT implicitly through the standard client handling, then narrow by plant, material, and movement type before touching quantity or value fields, since BWART groups behave very differently from each other. MJAHR is part of the key and easy to forget; a query on MBLNR alone across years returns wrong or duplicate-looking rows. For a specific purchase order line, filtering on EBELN and EBELP first is far cheaper than scanning by material across an entire plant.

How to prove it in the data

To confirm that a purchase order line was actually received rather than just showing open quantity on the order, select MSEG where EBELN and EBELP match the order line and BWART is in the goods receipt range for the account assignment category in use, then check SHKZG to confirm the movement was a debit to stock. Join to MKPF on MBLNR and MJAHR to get the actual posting date. If no row is returned, no goods receipt has been posted against that line regardless of what the order status shows.

ECC vs S/4HANA

On S/4HANA, MSEG is no longer a physical transparent table but a compatibility view generated on top of the unified journal table for material documents, commonly referred to by its underlying table name MATDOC. Existing reports, joins, and ABAP code that read MSEG continue to work because the view exposes the same field structure, but new development is expected to read MATDOC directly for better performance on large volumes. The field content and key structure that consultants rely on for MSEG have not materially changed.

Common pitfalls

  • Reading MENGE without SHKZG and drawing a conclusion about net stock movement; the sign is carried separately and a naive sum of MENGE across rows overstates or understates the actual change depending on the mix of debits and credits
  • Treating a missing MSEG row for a purchase order line as proof that nothing happened, when the movement was posted against a different account assignment, split into partial deliveries, or reversed and re-posted with a new document number entirely
  • Assuming DMBTR reflects the current valuation of the material; it reflects the value at the moment that specific movement was posted, and does not update retroactively when standard price or moving average price changes later
  • Forgetting that reversals create new rows with an offsetting BWART rather than deleting or updating the original line, so a raw count of documents against a material overstates real movement activity
  • Joining MSEG to EKBE and expecting a one-to-one match; EKBE is built from goods movement and invoice postings and can aggregate differently, especially where partial deliveries, subsequent adjustments, or invoice-only postings are involved
  • Ignoring batch and special stock indicators when reconciling quantities, which causes stock in one valuation type or special stock category to appear to disagree with unrestricted stock totals
  • Querying MSEG directly for a date range without joining MKPF first, since the posting date sits on the header, not the item

Whose problem this is

A discrepancy traced to MSEG is an inventory management or MM functional consultant question first, since the movement type configuration and account assignment logic determine what got posted and why. If the value fields disagree with the general ledger, it becomes a joint MM and FI question resolved through the material ledger or account determination setup, not by editing the table.

Related SAP objects

Reviewed pages this object connects to in the ERPClimb knowledge graph.

Source: ERPClimb — https://erpclimb.com/sap-tables/msegERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.