Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: String character replacement manipulation

$
0
0

Hi Chris,

 

Try the below code.

 

data: lv_hash(1) value '#',
        lv_spch(1) value '~',
        lv_cnt type i.
data: lv_char(2).


loop at itab.
replace all OCCURRENCES of lv_hash in itab-str with lv_spch replacement count lv_cnt.
do lv_cnt times.
lv_char = lv_hash && sy-index.
replace lv_spch in itab-str with lv_char.
enddo.

endloop.

 

Make sure the special character you use, will not be in the string.

 

Thanks,
Vamshi


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>