Sub topic 5
Basic Data: description, units of measure, and groups
This chapter assumes you can navigate SAP GUI and call transactions such as MM01 and MM03. It also assumes you know that a material has client-level data and plant-level data (see the earlier chapters on organizational levels and views). Basic ABAP reading skills help with the code example.
What the Basic Data view holds
The Basic Data view holds the fields that describe the material itself and do not depend on a plant, a sales organization, or a storage location. In MM01 and MM02 it appears as the tabs Basic Data 1 and Basic Data 2. Because these fields sit at client level, one change is visible in every plant and sales area that uses the material.
Every material has this view. The material type decides which of its fields are shown, required, or hidden (see the chapter on field control).
| Field | Meaning | Stored in |
|---|---|---|
| Material description | Short text, up to 40 characters, one per language | MAKT-MAKTX |
| Base unit of measure | Unit in which stock is kept | MARA-MEINS |
| Alternative units | Other units with a fixed conversion to the base unit | MARM |
| Material group | Groups materials for purchasing reports and analysis | MARA-MATKL |
| Division | Product line used in sales organization and reporting | MARA-SPART |
| Old material number | Number from a legacy system | MARA-BISMT |
| Gross weight, net weight, weight unit | Used in shipping and transport planning | MARA-BRGEW, NTGEW, GEWEI |
| Volume, volume unit | Used in shipping and transport planning | MARA-VOLUM, VOLEH |
| EAN/UPC | Barcode number | MARA-EAN11, MEAN |
| Cross-plant material status | Blocks the material in all plants | MARA-MSTAE |
Descriptions
The description is language-dependent. MAKT has one row per material and language key (SPRAS). When you create a material in MM01 you enter the description in your logon language. Other languages are added through the Additional Data button, on the Descriptions tab.
A user who logs on in German sees the German description. If no row exists for that language, the material appears with an empty description in many lists. This is why the first code example in this tutorial joins MAKT on spras = @sy-langu.
Descriptions are limited to 40 characters. For anything longer, use the basic data text (Additional Data, Basic Data Text). Long texts are stored in the text tables, not in MAKT, so you cannot select them with a plain join.
Base unit and alternative units
The base unit of measure (BUoM) is the unit in which the system keeps stock. It is the only unit in which quantities are stored in the inventory tables. Every other unit is converted to the base unit at posting time.
Plan the base unit carefully. Once stock or transaction data exists for the material, you cannot simply overwrite it in MM02. The system blocks the change because existing quantities would be misinterpreted. Changing it later needs a controlled procedure, and in the worst case a new material number.
An alternative unit of measure (AUoM) has a fixed conversion to the base unit. You maintain it through the Additional Data button, on the Units of Measure tab, and it is stored in MARM. The conversion is expressed as a fraction:
quantity in base unit = quantity in alternative unit × UMREZ / UMREN
UMREZ is the numerator and UMREN is the denominator. If one carton (CAR) holds 12 pieces (EA) and EA is the base unit, the MARM row for CAR has UMREZ = 12 and UMREN = 1. In the screen you read this as "1 CAR = 12 EA".
Units appear in different places, and the field that holds each one differs:
- Order unit (purchasing view): the unit on purchase orders, stored in MARA-BSTME.
- Sales unit (sales organization view): stored in MVKE-VRKME.
- Unit of issue (plant data / storage view): stored in MARC-AUSME.
Each of these units must either equal the base unit or have a MARM row. Otherwise the system rejects the entry.
The code below reads the units of a material and converts a quantity to the base unit. It is a complete report.
REPORT zdemo_uom_convert.
PARAMETERS: p_matnr TYPE matnr DEFAULT 'ZDEMO_MAT_001',
p_meinh TYPE meinh DEFAULT 'CAR',
p_qty TYPE p LENGTH 13 DECIMALS 3 DEFAULT 5.
START-OF-SELECTION.
SELECT SINGLE meins
FROM mara
WHERE matnr = @p_matnr
INTO @DATA(lv_base_uom).
IF sy-subrc <> 0.
WRITE / 'Material not found.'.
RETURN.
ENDIF.
SELECT meinh, umrez, umren
FROM marm
WHERE matnr = @p_matnr
INTO TABLE @DATA(lt_units).
WRITE: / 'Base unit:', lv_base_uom.
LOOP AT lt_units INTO DATA(ls_unit).
WRITE: / ls_unit-meinh, ls_unit-umrez, ls_unit-umren.
ENDLOOP.
READ TABLE lt_units INTO ls_unit WITH KEY meinh = p_meinh.
IF sy-subrc = 0.
DATA(lv_base_qty) = p_qty * ls_unit-umrez / ls_unit-umren.
WRITE: / p_qty, p_meinh, '=', lv_base_qty, lv_base_uom.
ELSE.
WRITE / 'No conversion maintained for this unit.'.
ENDIF.MARM also contains a row for the base unit itself, with numerator and denominator both 1. The report therefore lists the base unit among the alternatives.
Fixed and variable conversion
The conversion factor is fixed in MARM, so it applies to every document. For materials whose weight or volume varies by batch, you can maintain the material as a catch weight or use a batch-specific conversion. Those cases are outside this chapter. For standard goods, a wrong factor in MARM causes wrong stock quantities in every document that uses the unit, so check it before you release the material.
Groups and classification fields
Material group (MATKL) is the main grouping field. Purchasing uses it for reporting, for assigning buyers, and for account determination in some cases. It is defined in table T023 and its texts are in T023T. A material has exactly one material group at client level. It is not a hierarchy. Use the product hierarchy in the sales view for that purpose.
Division (SPART) assigns the material to a product line. Sales areas combine a sales organization, a distribution channel, and a division, so the division affects which sales areas can sell the material.
Other grouping fields on the same view are the authorization group (BEGRU), which restricts who may maintain the material, and the general item category group (MTPOS_MARA), which feeds item category determination in sales documents.
Maintaining basic data from code
BAPI_MATERIAL_SAVEDATA, shown earlier in this tutorial, writes the description and the base unit. Alternative units go in the table parameters UNITSOFMEASURE and UNITSOFMEASUREX. The X table carries a flag for each field you want to change. If you fill a value without setting its flag, the BAPI ignores it without an error message. Check the returned messages even when the call appears to work.
Exercise
A material has base unit EA. One carton holds 12 EA, and a purchase order is posted for 5 CAR. What are UMREZ and UMREN in the MARM row for CAR, and how many base units does the order create?
Show answer
UMREZ = 12 and UMREN = 1, because 1 CAR = 12 EA. The order creates 5 × 12 / 1 = 60 EA.
Exercise
A user logs on in French and sees an empty description for a material that has an English description. Which table holds the descriptions, and what is the likely cause?
Show answer
MAKT holds them, with one row per language key. The material has no French row, so you need to add a French description through Additional Data on the Descriptions tab.