‎2007 Apr 20 12:58 PM
Hi ,
In the internal table i have the following fields .
INTERNAL TABLE
FIELD1 FIELDS2 FIELD3
X1 ABCDF Y1
X2 TRSRT Y2
X3 ANDHT Y3
need to replace field2 'ABCDF' with 'RRRRRRRRRR' where every 'ABCD' text occurs in the internal table.
Thanks,
Vind.
‎2007 Apr 20 1:05 PM
hi
DATA: STR2(10) VALUE 'RRRRRRRRRR',
STRING(10).
IF ITAB-FIELD2 = 'ABCDF' .
REPLACE ITAB-FIELD2 WITH STR2 INTO STRING.
ENDIF.
regards,
madhu
‎2007 Apr 20 1:03 PM
loop at t_Table into fs_table.
if fs_table-field1 cp 'ABCDF'.
fs_Table-field1 = 'RRRRRRRABCDE'.
modify t_table from fs_Table index sy-tabix.
endif.
endloop.
Message was edited by:
vijay pawar
‎2007 Apr 20 1:05 PM
loop at itab.
v_tabix = sy-tabix.
if itab-field2 CS 'ABCD'.
itab-field2 = 'RRRRRRRRRR'.
modify itab index v_tabix.
endif.
endloop.
‎2007 Apr 20 1:05 PM
hi
DATA: STR2(10) VALUE 'RRRRRRRRRR',
STRING(10).
IF ITAB-FIELD2 = 'ABCDF' .
REPLACE ITAB-FIELD2 WITH STR2 INTO STRING.
ENDIF.
regards,
madhu
‎2007 Apr 20 1:07 PM
Use the below code...
loop at itab.
if itab-field2 CS 'ABCD'.
itab-field2 = 'RRRRRRRRRR'.
modify itab index sy-tabix.
endif.
endloop.