Skip to Content

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

How to replace a char?

Hi experts ... my problem is this:

Input: L'Belstar

Output: L Belstar

How I can replace this char?? ... thanks for your help and sry for my bad english =P

Tags:
replied

Hello,

You need one quote to open the literal, two to represent the quote character and one more to close the literal:

DATA:
  lv_test TYPE c LENGTH 10 VALUE 'L''BELSTAR'.

REPLACE ALL OCCURRENCES OF '''' IN lv_test WITH ' ' IN CHARACTER MODE.

or

DATA:
  lv_test TYPE c LENGTH 10 VALUE 'L''BELSTAR'.

TRANSLATE LV_TEST USING ''' '.

Regards.

0 View this answer in context

Helpful Answer

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