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.