Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ASCII Character Processing in ABAP


I have to remove the special characters (+/-, Ø) from the Text and process the same with out the Special Characters in it. The General requirement is that, I need to remove the special characters, which fall between the ASCII Values 32 to 128. Is there a Standard Function Module or Function available in SAP. Can you please suggest me a good solution for this requirement. Thanks for your Help in Advance.

Thanks and Regards,


Message was edited by: Kannan SA

Former Member
Former Member replied

THe following codereplaces special chars ( < 33 and > 127 ) with space.

data: len type i,
      off type i,
      hex1 type x value '1F',
      hex2 type x value '80'.

data asci_str(100) type c.

field-symbols <fs> type any.

len = strlen( asci_str ).

while off lt len.
  assign asci_str+off(1) to <fs> casting type x.
  if <fs> le hex1 or <fs> ge hex2.
    asci_str+off(1) = ' '.
  add 1 to off.

write:/ asci_str.



1 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question