Sub topic 12
Material number assignment: internal and external
This chapter assumes you know the material type concept from earlier chapters and can navigate SAP GUI transactions. Every material needs a unique number, the material number, which is stored in the field MATNR. The system can create that number for you (internal assignment) or accept one you type (external assignment). The material type decides which method applies.
How the number range is chosen
Each material type points to a number range interval. The interval is a block of numbers, such as 1 to 999999. The material type also carries two settings.
- Internal number range: the system picks the next free number in the interval.
- External number range: the user or an interface supplies the number, and it must fall inside the interval.
An external interval can be defined to allow alphanumeric numbers. Several material types can share one interval. The interval is configured in Customizing, under Logistics - General, Material Master, Basic Settings, Define Number Ranges for Each Material Type (transaction MMNR).
Internal versus external
| Aspect | Internal | External |
|---|---|---|
| Who supplies the number | System | User or interface |
| Typical content | Numeric, sequential | Numeric or alphanumeric, meaningful |
| Risk | Numbers carry no meaning | Duplicates and typing errors |
| Typical use | Most standard materials | Migrated legacy numbers, product codes from another system |
An external number is checked for uniqueness only. The system does not check that it follows your naming convention. If you need a convention, enforce it with a validation or a Business Add-In (BAdI).
Working with it in practice
When you create a material with an internal range, leave the number field empty. The system shows the new number in the confirmation message when you save. With an external range, you must enter the number before you can continue.
The material number length matters. In S/4HANA, the field supports up to 40 characters, though many systems still use 18 for compatibility. The extended length is activated by a system setting. Check that interfaces and custom code can handle the longer value before you use it.
Common errors
- Number not in interval: an external number falls outside the permitted interval. Add it to the interval in MMNR or use a different number.
- Interval exhausted: an internal interval has run out of numbers. Extend the interval or assign a new one to the material type.
- Wrong assignment type: a user types a number for a material type with an internal range. The system ignores it or rejects it. Check the type's setting first.
Exercise
A company migrates 50,000 materials from a legacy system and wants to keep the legacy numbers. Which type of number range should the material type use, and what two checks does the system apply to each number?
Show answer
An external number range. The system checks that each number is unique and that it falls inside the interval defined for the material type. It does not check any naming convention.
Exercise
A user creates a material of a type with an internal range and leaves the number field empty. Where do they see the assigned number?
Show answer
In the confirmation message shown after saving. The number cannot be changed afterward.