Sub topic 8
The valuation area: where inventory gets its value
This chapter assumes you know what the client, company code, plant and storage location are, and that a plant belongs to one company code. It also assumes you can read a simple Open SQL SELECT with a join. Here you will learn what the valuation area is, why it exists and where its settings and data are stored.
Why a separate valuation area exists
Stock has a quantity and a value. Quantity is tracked per storage location, as the previous chapter showed. Value is tracked at a coarser level: the valuation area. The valuation area is the organisational level at which SAP keeps the accounting data of a material, such as its price and its total stock value.
Valuation must happen at a level that belongs to exactly one company code. Each company code has its own currency and chart of accounts, and its inventory is posted to its own general ledger accounts. Any level you choose for valuation therefore has to sit inside a single company code.
The valuation area is identified by a key called BWKEY. You will see this field in several tables.
The two possible valuation levels
A system uses one of two valuation levels. The choice applies to the whole client.
| Valuation level | What the valuation area is | Typical `BWKEY` | Effect |
|---|---|---|---|
| Plant | Each plant is its own valuation area | Same as the plant key, for example `1000` | A material can have a different price and value in each plant |
| Company code | All plants of a company code share one valuation area | Same as the company code key, for example `1000` for company code `1000` | A material has one price and one value across all plants of that company code |
With plant-level valuation, each plant's stock is valued separately. This is the usual setup, and SAP recommends it. It lets you value the same material differently in a plant in Germany and a plant in Spain, even when both belong to one company code.
With company-code-level valuation, all plants in a company code share one valuation area. It is rarely used because it gives you less control. The material price is the same everywhere in the company code.
The valuation level is set in customizing, in transaction OMWM (Maintain valuation level). The setting is client-wide. You cannot have plant-level valuation for one company code and company-code-level valuation for another in the same client.
How plants connect to company codes through the valuation area
A plant is assigned to a company code, but the system does not store this link directly in the plant table. The link runs through the valuation area:
- The plant (table
T001W) carries a valuation area in fieldBWKEY. - The valuation area (table
T001K) carries the company code in fieldBUKRS.
So the chain is plant, then valuation area, then company code. This is why the first Open SQL example in this tutorial joins T001W to T001K.
Notice what this chain implies. With plant-level valuation, T001K has one row per plant, and BWKEY equals the plant key. With company-code-level valuation, T001K has one row per company code, and several plants carry the same BWKEY.
Reading the assignment with Open SQL
The following report lists plants with their valuation area and company code. It also shows whether a plant has its own valuation area.
REPORT z_plant_valuation_areas.
START-OF-SELECTION.
SELECT w~werks,
w~name1,
w~bwkey,
k~bukrs
FROM t001w AS w
INNER JOIN t001k AS k ON k~bwkey = w~bwkey
ORDER BY w~werks
INTO TABLE @DATA(lt_plants)
UP TO 20 ROWS.
LOOP AT lt_plants ASSIGNING FIELD-SYMBOL(<ls_plant>).
IF <ls_plant>-werks = <ls_plant>-bwkey.
DATA(lv_level) = |plant level|.
ELSE.
DATA(lv_level) = |company code level|.
ENDIF.
WRITE: / <ls_plant>-werks, <ls_plant>-name1, <ls_plant>-bwkey,
<ls_plant>-bukrs, lv_level.
ENDLOOP.In a system with plant-level valuation, every row shows werks equal to bwkey. If a row shows a different bwkey, that plant shares its valuation area with other plants of the company code.
Two details about this code matter. First, INNER JOIN drops plants that have no valuation area assigned. A plant should always have one, so a missing row points to an incomplete customizing setup. Second, the comparison of werks and bwkey is a per-row hint, not proof of the client-wide setting. Use OMWM for the authoritative setting.
Where the value is stored
Quantity and value live in different tables.
| Data | Table | Key fields | Level |
|---|---|---|---|
| Unrestricted-use quantity per storage location | `MARD` | `MATNR`, `WERKS`, `LGORT` | Storage location |
| Valuation data: price, price control, total stock value | `MBEW` | `MATNR`, `BWKEY`, `BWTAR` | Valuation area (and valuation type) |
MBEW is the table behind the Accounting view of the material master. Its main fields are:
VPRSV: price control,Sfor standard price orVfor moving average price.STPRS: standard price.VERPR: moving average price.PEINH: price unit, the quantity to which the price refers.LBKUM: total valuated stock quantity.SALK3: total value of valuated stock.BKLAS: valuation class, which steers the posting to general ledger accounts.BWTAR: valuation type, used for split valuation.
LBKUM is the sum of the stock across all storage locations of the plant, because quantity is held per storage location but valued per valuation area. A storage location has no price of its own. Two storage locations in the same plant always value a material at the same price.
This query reads the valuation data for one valuation area:
DATA lv_bwkey TYPE bwkey VALUE '1000'.
SELECT matnr, bwkey, bwtar, vprsv, verpr, stprs, peinh, lbkum, salk3
FROM mbew
WHERE bwkey = @lv_bwkey
INTO TABLE @DATA(lt_valuation)
UP TO 50 ROWS.You can compare lbkum here with the sum of labst from MARD for the same material and plant. For a material without split valuation, lbkum also includes other stock types such as quality inspection and blocked stock, so it can be larger than the unrestricted-use sum alone.
What the valuation area controls
The valuation area determines several things at once.
- Price and price control. A material has one price control and one price per valuation area. Under plant-level valuation, the same material can have a standard price of 10.00 in plant
1000and 12.50 in plant2000. - Currency. Values are held in the currency of the company code that owns the valuation area.
- Account determination. The valuation class from
MBEW, together with the valuation area, helps the system find the general ledger account for goods movements. - Existence of accounting data. A material can only be valued in a plant if an accounting view exists for that plant's valuation area. If the view is missing, goods movements for that material in that plant fail with an error.
- Valuation of transfers. A stock transfer between two plants with different valuation areas is a posting between two valuations. Transfers between plants in different company codes also create financial postings.
Split valuation
The valuation type BWTAR lets you value the same material in the same valuation area at several prices. Typical cases are the origin of the goods (domestic or imported) or the quality grade. Each valuation type gets its own MBEW row, with the same MATNR and BWKEY. The valuation area stays the same, and only the valuation type separates the rows. Most materials use no valuation type, so BWTAR is blank.
Common mistakes
- Treating the valuation area as a plant synonym. In most systems
BWKEYequalsWERKS, so the confusion goes unnoticed. In a system with company-code-level valuation, joins written asmbew~bwkey = mard~werksreturn wrong or no results. Join throughT001W-BWKEYinstead. - Looking for value in
MARD.MARDholds quantities only. Value belongs toMBEW. - Assuming a storage location has its own price. Storage locations share the valuation of their plant.
- Skipping the accounting view. A material that has a plant view but no accounting view for that plant's valuation area cannot be posted.
- Changing the valuation level in a live system. See the warning above.
Exercise
A client uses company-code-level valuation. Company code 2000 has plants 2100 and 2200. How many rows does T001K hold for these two plants, and what does MBEW hold for one material that exists in both plants?
Show answer
T001K holds one row for the valuation area of company code 2000, because both plants share one BWKEY. MBEW holds one row for the material in that valuation area, with one price and one total stock value. The stock quantities of plants 2100 and 2200 are still separate in MARD, but the value comes from the single MBEW row.
Exercise
You want the total stock value per plant for company code 1000 in a system with plant-level valuation. Which tables do you read, and which fields connect them?
Show answer
Read T001K to select the valuation areas where BUKRS = '1000', and join MBEW on MBEW-BWKEY = T001K-BWKEY. Sum MBEW-SALK3 per BWKEY. Because valuation is at plant level, BWKEY equals the plant key, so each total is also the value for one plant. To show plant names, join T001W on T001W-BWKEY = MBEW-BWKEY.
Exercise
Why does SAP require the valuation area to belong to exactly one company code, and what would break if one valuation area spanned two company codes?
Show answer
Value is held in the currency of one company code and posted to the accounts of one chart of accounts and one legal entity. If a valuation area spanned two company codes, one price and one stock value would have two currencies and two sets of ledgers, so the system could not post inventory consistently.