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

Replace # with space

Former Member
0 Likes
539

Hi All

Here is my query

when i am execute this prg

REPORT ZTEST4.

DATA STR(100) TYPE c VALUE <b>'1#02.11.2006#02.11.2006#1061#AUD##7#SA#Legacy data transfer1#Reference1'.</b>DATA: SPL TYPE C VALUE '#'.

REPLACE ALL OCCURRENCES OF SPL IN STR WITH ' '.

IF SY-SUBRC = 0.

WRITE:/ STR.

ENDIF.

I am getting the following output

<b>OutPut:102.11.200602.11.20061061AUD7SALegacy data transfer1Reference1</b>

Here i want to display this output with space in place of # symbols.

how to do this

Rgds

Raghav T

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
497

Pleae try using translate instead.

<b>translate  str using  '# '.
*REPLACE ALL OCCURRENCES OF SPL IN STR WITH ' '.</b>
IF SY-SUBRC = 0.
WRITE:/ STR.
ENDIF.

Regards,

Rich Heilman

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
498

Pleae try using translate instead.

<b>translate  str using  '# '.
*REPLACE ALL OCCURRENCES OF SPL IN STR WITH ' '.</b>
IF SY-SUBRC = 0.
WRITE:/ STR.
ENDIF.

Regards,

Rich Heilman

Read only

0 Likes
497

Thank you Rich

Read only

Former Member
0 Likes
497

hi Raghav,

you can use REPLACE ALL OCCURRENCES OF SPL IN STR WITH <b>SPACE</b>

hope this helps.

Sajan.