Pad an article number (MATNR) with leading zeros
Your article shows as "4711" but SAP expects "000000000000004711"? Here's why, and how to add the leading zeros automatically, on a single value or a whole list.
Why these leading zeros?
The SAP article number (MATNR) is stored in a fixed-length field, often 18 characters, right-aligned and padded with zeros when the article is purely numeric. Depending on where you work (SE16 on the raw table, a load, an extraction), you sometimes have to provide the "padded" value: 4711 becomes 000000000000004711.
By hand: tedious and error-prone
Counting the digits, adding the right number of zeros, doing it again for every reference in a list… it's a classic chore, and a single missing zero breaks the search. On a list of thirty articles, doing it manually is simply unmanageable.
With MyToolKit: a padding shortcut
MyToolKit offers a transformation that pads each value with leading zeros up to the target length (18 by default for a MATNR, adjustable). You can apply it to a single value, or to a whole list in one move, every line padded at once.
- Copy your value or your list of articles.
- Trigger the "pad with zeros" shortcut (target length: 18).
- Every reference is padded:
4711→000000000000004711.
You can even chain it in a pipeline with other rules (remove duplicates, split into a column) before pasting the whole thing into SE16.
MATNR padding in one shortcut
MyToolKit is in free early access. Pad your article numbers automatically.
↓ Download MyToolKitFrequently asked questions
Do I always need leading zeros before a MATNR?
No, only in contexts that handle the fixed-length internal value (for example SE16 on the raw table, some loads). On the user screen, SAP often handles the conversion for you.
What if the article isn't purely numeric?
An alphanumeric article is generally not zero-padded. Padding applies to numeric references; MyToolKit leaves the others unchanged.
Can I change the length (other than 18)?
Yes, the target length is a parameter, you can pad to 10, 12 or 18 characters, as needed.