‎2008 Dec 04 9:57 AM
Hi,
I am using below code, but it is not replacing correctly.
data DWORK_VAL(510) type C.
DWORK_VAL = 'DWORK_VAL ~~~efghijklmnopqrstuvxyz~~~'.
loop at text_content assigning <fs>.
search <fs> for DWORK_VAL.
if sy-subrc = 0.
replace DWORK_VAL in <fs> with 'ABCDE...ashdalkjhsd----
888*****'.
modify text_content from <fs> index sy-tabix.
endif.
Thanks,
‎2008 Dec 04 10:01 AM
If you are using field symbol , there is no need to use MODIFY.
You code should work properly.
Regards,
Mohaiyuddin
‎2008 Dec 04 9:59 AM
‎2008 Dec 04 10:03 AM
‎2008 Dec 04 10:01 AM
If you are using field symbol , there is no need to use MODIFY.
You code should work properly.
Regards,
Mohaiyuddin
‎2008 Dec 04 10:04 AM
‎2008 Dec 04 10:06 AM
Yes, you are using field symbol and it will change your table content directly.
Regards,
Mohaiyuddin
‎2008 Dec 04 11:47 AM
‎2008 Dec 05 12:16 PM
I think it should work.
Can you post you complete code. (Along with internal table definition and definition of <fs>).
Moreover, it will be helpful if you can give test scenario in which you think data should get replaced.
Regards,
Mohaiyuddin
‎2008 Dec 05 12:12 PM
example:-
Data : var1(6) type c.
Data : var2(6) type c.
Data : var3(15) type c.
Data : len type i.
var1 = 'GO'.
var2 = 'GONE'.
var3 = 'ABCDGOEFGH'.
len = strlen( var1 ).
REPLACE var1 LENGTH len WITH var2 INTO var3.
condense var3 no-gaps.
write:var3.
no need modify
‎2008 Dec 05 12:28 PM
Hi:
Instead of Field symbol, please use an internal table.
Regards
Shashi