SAPFree generatorPDF, Excel, Word exportSAP ECC / S/4HANA

SAP MBEW Material Valuation ABAP SELECT Generator

MBEW is the SAP material valuation table, and almost every inventory value question a controller asks ends up there. This generator writes a clean ABAP SELECT that joins MBEW to MAKT and filters by plant, valuation class and price control.

Fill in

BWKEY. Equals the plant when valuation is at plant level.

BKLAS, for example 3000 raw materials or 7900 finished goods in a typical chart.

S is standard price, V is moving average price.

Rows with SALK3 below this are skipped.

Generated code
Download:

ABAP report snippet

REPORT zmbew_stock_value.

TYPES: BEGIN OF ty_val,
         matnr TYPE mbew-matnr,
         maktx TYPE makt-maktx,
         bwkey TYPE mbew-bwkey,
         bklas TYPE mbew-bklas,
         vprsv TYPE mbew-vprsv,
         stprs TYPE mbew-stprs,
         verpr TYPE mbew-verpr,
         peinh TYPE mbew-peinh,
         lbkum TYPE mbew-lbkum,
         salk3 TYPE mbew-salk3,
       END OF ty_val.

DATA lt_val TYPE STANDARD TABLE OF ty_val WITH EMPTY KEY.

SELECT m~matnr, t~maktx, m~bwkey, m~bklas, m~vprsv, m~stprs, m~verpr, m~peinh, m~lbkum, m~salk3
  FROM mbew AS m
  INNER JOIN makt AS t ON t~matnr = m~matnr AND t~spras = @sy-langu
  WHERE m~bwkey = '1000'
    AND m~bklas = '3000'
    AND m~vprsv = 'S'
    AND m~bwtar = ''
    AND m~lbkum > 0
    AND m~salk3 >= 10000
  ORDER BY m~salk3 DESCENDING
  INTO CORRESPONDING FIELDS OF TABLE @lt_val
  UP TO 500 ROWS.

IF sy-subrc <> 0.
  WRITE: / 'No valuation records found'.
  RETURN.
ENDIF.

LOOP AT lt_val ASSIGNING FIELD-SYMBOL(<ls>).
  WRITE: / <ls>-matnr, <ls>-maktx, <ls>-lbkum, <ls>-salk3.
ENDLOOP.

Verify on your release: in S/4HANA the material ledger and the MBEW compatibility behavior differ by version, and with actual costing active the periodic unit price is in CKMLCR, not MBEW. MBEW holds current-period valuation data only; history is in MBEWH. BWTAR is blank when split valuation is not used. Test in a sandbox before scheduling.

Ask SAP inventory value questions in plain language

Optional: a short review of how a read-only assistant could answer valuation questions from your SAP data.

Optional. The tool and every export work without this. No spam.

How to use the generator

Enter the valuation area, valuation class and price control, then copy the code into a new report in SE38 or an ADT project. Adjust the minimum value and row limit to keep the output manageable. The code reads current valuation data only, so run it at a stable point such as after the month-end close if you need numbers that tie to the balance sheet.

  • BWKEY is the valuation area, usually the plant
  • BKLAS drives account determination, so filtering on it groups stock by GL account
  • LBKUM is total valuated stock, SALK3 is total value
  • Run in a quality or sandbox system first

What the key MBEW fields mean

VPRSV is the price control indicator: S means the material is valued at STPRS, V means it is valued at the moving average VERPR. PEINH is the price unit, so a price of 120.00 with PEINH 100 means 1.20 per unit. SALK3 is the total value of valuated stock, which is what you reconcile to the GL inventory accounts. BKLAS is the valuation class. Ignoring PEINH is the most common reason homemade reports overstate value by a factor of ten or one hundred.

Reconciling to the general ledger

Sum SALK3 by BKLAS and plant, then compare with the inventory account balances mapped to those valuation classes in OBYC. Differences usually come from postings in transit, goods receipts not yet invoiced, price changes posted mid period, or materials valued in a different company code currency. Document the timing of your extract, because MBEW changes with every goods movement.

Common mistakes

Using MBEW for historical values instead of MBEWH, forgetting split valuation rows where BWTAR is filled, reading VERPR on materials under standard price control, and ignoring the material ledger when actual costing is active. Also remember that SELECT without authority checks exposes cost data, so wrap production reports in the right AUTHORITY-CHECK objects.

Frequently Asked Questions

Which SAP table holds the standard price of a material?

The standard price is in MBEW field STPRS, and the moving average price is in VERPR. VPRSV tells you which of the two the system uses to value the material. The price unit PEINH must be applied to get a unit value.

How do I get inventory value by plant in SAP?

Sum MBEW SALK3 grouped by BWKEY. In S/4HANA you can also use standard stock value apps, but the table query is useful when you need a specific valuation class filter or a reconcilable extract.

Why does my MBEW total not match the GL?

Typical causes are goods receipts not yet invoiced, postings after your extract, split valuation rows you filtered out, manual GL postings to inventory accounts, and differences between valuation class mapping in OBYC and your filter.

Does this work in S/4HANA?

MBEW remains readable as a compatibility view in S/4HANA, but the underlying data model uses MATDOC and the universal journal. Check your release notes and use the CDS views for new development.

If you want finance to ask inventory value questions in plain language instead of waiting for ABAP, we can connect a read-only assistant to your SAP data, on-prem if required.