Code: Alles auswählen.
parameters zeichenk(50) type c.
data: string(50) type c,
string2 like string,
laenge type i value 0.
string = zeichenk.
laenge = strlen( string ).
while string np space.
if string(1) = 0 OR string(1) = 1 OR string(1) = 2
OR string(1) = 3 OR string(1) = 4 OR string(1) = 5
OR string(1) = 6 OR string(1) = 7 OR string(1) = 8 OR string(1) = 9.
string(1) = '*'.
write string(1).
shift string.
else.
write string(1).
shift string.
endif.
endwhile.
Write: / 'Länge',laenge,string.
Code: Alles auswählen.
REPORT zrep_stern.
PARAMETERS p_str(50) DEFAULT 'H4ll0 W3lt'.
DATA z_str TYPE string.
DATA z VALUE 0.
START-OF-SELECTION.
z_str = p_str.
DO 10 TIMES.
REPLACE ALL OCCURRENCES OF z IN z_str WITH '*'.
ADD 1 TO z.
ENDDO.
WRITE: / p_str, / z_str.
Code: Alles auswählen.
data: gv_string type string value 'H4ll0 W3lt'.
write / gv_string.
TRANSLATE gv_string USING '1*2*3*4*5*6*7*8*9*0*'.
write / gv_string.
Code: Alles auswählen.
REPLACE ALL OCCURRENCES OF REGEX '/d' IN gv_string with '*'.