Sub topic 3
Material Number Assignment and Lifecycle in SAP S/4HANA
Assume you know SAP organizational units such as plants and company codes, and understand basic procurement, production, sales, and inventory processes.
Material number assignment
A material number identifies a material across SAP processes. The material type determines the allowed number range.
- Internal assignment: SAP assigns the next available number when you save the material.
- External assignment: The user enters a number. SAP checks that it is valid and unused.
Use internal assignment when the business does not need meaningful numbers. Use external assignment when existing product codes must remain visible. Number ranges must prevent duplicates.
Creating and extending a material
Use MM01 or the Fiori product app to create a material. Select the material type, industry sector, views, and organizational levels. Then enter the required data.
Creating a material at one level does not automatically create every possible view. For example, plant-specific purchasing or MRP data may not exist until you extend the material to that plant. Use MM01 to extend it, and MM02 or the corresponding Fiori app to change it.
Field and view control
Customizing controls which views and fields appear. Material type, industry sector, transaction, and organizational level influence this screen sequence. A field can be required, optional, displayed only, or hidden.
Status, blocking, and deletion
Material status can apply across the client or only to a plant, sales area, or other level. A status can block purchasing, sales, production, or other uses. A deletion flag marks data for later archiving; it does not immediately remove the material.
S/4HANA changes
S/4HANA supports material numbers up to 40 characters, although connected systems may still expect shorter values. Fiori apps provide role-based maintenance. Inventory document data uses the MATDOC model, while classic material master tables remain important for master data.
Storage and programmatic access
Material data is split by purpose and organizational level:
| Data | Main table |
|---|---|
| General material data | MARA |
| Plant data | MARC |
| Storage-location data | MARD |
| Descriptions | MAKT |
Read data with ABAP SQL. Maintain it through released APIs where available, or through BAPI_MATERIAL_SAVEDATA. A BAPI is a standardized function interface. Its matching X structures identify fields that should be changed, and a successful change requires a commit.
REPORT z_read_materials.
SELECT mara~matnr, makt~maktx, marc~werks, marc~dismm
FROM mara
INNER JOIN makt ON makt~matnr = mara~matnr
AND makt~spras = @sy-langu
INNER JOIN marc ON marc~matnr = mara~matnr
WHERE marc~werks = '1010'
INTO TABLE @DATA(materials)
UP TO 100 ROWS.
LOOP AT materials INTO DATA(material).
WRITE: / material-matnr, material-maktx,
material-werks, material-dismm.
ENDLOOP.Exercise
Why might a material number be assigned internally instead of entered by a user?
Show answer
Internal assignment prevents duplicate numbers and lets SAP manage the number range consistently.