Skip to Content
0
Apr 21, 2009 at 10:28 AM

REPLACE OFFSET with space

1006 Views

Dear All,

I have this coding

data : w_data(100),w_data1 TYPE string, w_data2 TYPE xstring.

data w_replace(1).

************************************************************************

*START-OF-SELECTION.

START-OF-SELECTION.

w_data1 = 'A A A*R'.

w_replace = ' '.

REPLACE SECTION OFFSET 5 LENGTH 1 OF w_data1 WITH w_replace .

WRITE w_data1.

The idea is to replace the '*' in w_ data1 by a space. In w_replace I put 'ALT+32' and if I look the HEX code w_replace = 20. And it's exactly what I want.

But when I use REPLACE, the '*' is replace by nothing !

w_data1 before REPLACE = 41204120412A52

w_data1 after REPLACE = 412041204152

I want 41204120412052

I have already tried with w_replace = Space , = ' ', = 'ALT+32' For all, same problem

I also tried with 'ALT+255' , the HEX code is A0, and it's correctly replaced in w_data1, but for the rest of the program, I really need a blank corresponding at '20'.

- w_data1 is used to send by mail a PDF .

Idea ???

Thanks

Nathalie