‎2007 Dec 21 6:58 AM
Hi,
with a character variable you can manipulte the contents via
var+5(02) = 'XY'.
With a string variable this is not allowed. Is there any other way of doing this except copying the string to a char variable, doing the change and copy it back? Another way of doing this concatenating the first part, the new chars and the rest together, but this is an ugly solution too....
Why is it syntactically ok to read parts of a string, but not to write? Is it because a string content is shared between several variables all pointing to the same string content?
‎2007 Dec 21 7:02 AM
try this.
REPLACE SECTION [OFFSET off] [LENGTH len] OF text WITH new.
Awrd Points if Useful
bhupal
‎2007 Dec 21 7:02 AM
use REPLACE ...
e.g.
DATA field(10) TYPE C.
MOVE 'ABCB' TO field.
REPLACE 'B' WITH 'string' INTO field.
OR
DATA: pattern(6) TYPE C VALUE 'ABC',
len TYPE I,
repl_string(6) TYPE C VALUE '123456',
field(12) TYPE C VALUE 'abcdeABCDE'.
REPLACE pattern WITH repl_string INTO field.
Edited by: Sharayu Kumatkar on Dec 21, 2007 12:32 PM
‎2007 Dec 21 7:02 AM
try this.
REPLACE SECTION [OFFSET off] [LENGTH len] OF text WITH new.
Awrd Points if Useful
bhupal
‎2007 Dec 21 7:03 AM