Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

how to replace special characters in string

$
0
0

Hi all.

 

I am having a problem that I am trying to replace special characters

in a string with hash. in 4.5 there is no function module to resolve this issue,

I have checked.

 

We do not know the complete set of special characters., even if we did,

I want a flexible way to replace the special characters in a string..

 

I tried one approach, to find special characters in string and

use offset to replace them with hash. but 4.5 does NOT allow

use of variable offset, only constant.

 

here is the code :

do total_length times.

   lw_position = sy-index - 1.

   concatenate 't_bkpf-xblnr+' lw_position '(1)'

               into lc_special_char.

   if lc_special_char na c_valid_chars.

     lw_special_char = lc_special_char.

     replace lw_special_char into lc_special_char

                           with lv_space.

   endif.

enddo.

 

Any solutions?

 

Thanks,

Regards,

Nirav


Viewing all articles
Browse latest Browse all 8332

Trending Articles



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