Monday, November 14, 2011

Replace Characters using ABAP

REPLACE ALL OCCURRENCES OF <Text to be replaced> IN <Original Text> WITH <Text to replace>.

if the material description consist special characters like "--", that will causing the output excel file out of alignment. 

Using above code to replace all the "--" to blank or space:

For example:

gv_text = 'Material--ABC is a Raw material'.

REPLACE ALL OCCURRENCES OF '--' IN gv_text WITH ' '.

Output:

Material ABC is a Raw material.

2 comments:

  1. hi there,

    i get:
    MaterialABC is a Raw material

    without spaces....

    what's wrong?

    Thanks
    Davide

    ReplyDelete
    Replies
    1. You can try

      REPLACE ALL OCCURRENCES OF '--' IN gv_text WITH space.

      Delete