Professional Documents
Culture Documents
This article shows a simple ABAP trick to clean a given string by removing all unwanted characters. The ABAP program given below does as shown in the screen shot below:
report data:
zcleanstr.
char1(60) type c, str2 type string, ch(1) type c. field-symbols type c. parameters p_str type string. parameters p_chk type string default '1234567890'. concatenate p_chk space into p_chk respecting blanks. char1 = p_str. *sy-fdpos: Found Location in Byte or Character String while not p_str co p_chk. ch = p_str+sy-fdpos(1).