Skip to Content

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

Special Character Replacement.

Hello Gurus,

I have a requirement where in i have to replace the special character.

EG:

TEXT : Vendor & is not defined in company code &

Value1 E3008991

Value2 1101

i need to replace the '&' with specific value. if there are 3 '&''s in a text i need to replace all the 3 with different values.

I want the final output like this :

Vendor E3008991 is not defined in company code 1101

Can any one plz guide me....

Former Member
replied

Hi Saikanth ,

Try this code :

data : lv_text(100) VALUE 'Vendor & is not defined in company code &' ,

        Value1(8) value  'E3008991' ,

        Value2(4) VALUE  '1101'.

WRITE : lv_text.

REPLACE FIRST OCCURRENCE OF '&' IN lv_text WITH Value1.

REPLACE FIRST OCCURRENCE OF '&' IN lv_text WITH Value2.

WRITE : lv_text.



Regards


Yogendra Bhaskar

0 View this answer in context

Helpful Answer

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