Variante 1 (FuBa)
DATA: lv_matnr_18 TYPE char18 VALUE '000000001234567890'.
DATA: lv_matnr_10 TYPE char10.
* Prüft Länge, Datentyp, entfernt führende Nullen
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = lv_matnr_18
IMPORTING
output = lv_matnr_10.
WRITE: / |{ lv_matnr_10 }|.
Variante 2 (SHIFT)
DATA: lv_matnr TYPE char18 VALUE '000000001234567890'.
* Führende Nullen nach links schieben
SHIFT lv_matnr LEFT DELETING LEADING '0'.
WRITE: / |{ lv_matnr }|.
Variante 3 (String-Template)
DATA: lv_matnr TYPE string VALUE '000000001234567890'.
* Führende Nullen aus dem String entfernen
lv_matnr = |{ lv_matnr ALPHA = OUT }|.
WRITE: / |{ lv_matnr }|.