Application Development and Automation 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: 
Read only

doubt in using replace statement

Former Member
0 Likes
403

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
379

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
Read only

Former Member
0 Likes
379

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

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
380

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