Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

doubt in using replace statement

Former Member
0 Kudos

Hi all,

I have a requirement where user will enter more than 1 label no in a screen, which will be populated internally in a table by SAP with ## for every ENTER button pressed by the user. the internal table populated by SAP will be having values like this. 11111111111##22222222222##3333333333

I need to separate the values from ## and move it to another internal table. I used replace statement to replace ##. But its not working. I dont know what could be the problem. Can any one suggest me in doing this.

POINTS PROMISED

Regards,

Buvana

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You will need to use the replace, but you need to be searching for cl_abap_char_utilities=>CR_LF in the REPLACE statement, the ## is an internal representation of the CR_LF, so use

replace  cl_abap_char_utilities=>CR_LF  with .....

Regards,

RIch Heilman

2 REPLIES 2

Former Member
0 Kudos

Hi

Use the command

OVERLAY instead of Replace

Replace will do only for the first occurance where as OVERLAY will replace all occurances

<b>Reward points for useful Answers</b>

Regards

Anji

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You will need to use the replace, but you need to be searching for cl_abap_char_utilities=>CR_LF in the REPLACE statement, the ## is an internal representation of the CR_LF, so use

replace  cl_abap_char_utilities=>CR_LF  with .....

Regards,

RIch Heilman