Hi Krishna,
DATA : str TYPE STRING VALUE '@1test;"{}]input+',
char,
length TYPE i,
index TYPE i.
length = STRLEN( str ).
WHILE length > index.
char = str+index(1).
WRITE char.
if char CA '+-*/!`@#$%^&()_=[]{};'. " Add/Remove here to include numbers
REPLACE ALL OCCURRENCES OF char in str WITH ''.
REPLACE ALL OCCURRENCES OF '"' in str WITH ''. " characters "{}[] are not comparable
REPLACE ALL OCCURRENCES OF '{' in str WITH ''.
REPLACE ALL OCCURRENCES OF '}' in str WITH ''.
REPLACE ALL OCCURRENCES OF '[' in str WITH ''.
REPLACE ALL OCCURRENCES OF ']' in str WITH ''.
length = STRLEN( str ).
ENDIF.
add 1 to index.
ENDWHILE.
WRITE str.
Add or remove special char from '+-*/!`@#$%^&()_=[]{};' in if part as per your requirement.
Hope it meets your requirement.
Do not forget to mark helpful/correct if ma answer is useful
.
Thanks,
Karthik