Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

abap st.

Former Member
0 Likes
666

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
624

hi

DATA: STR2(10) VALUE 'RRRRRRRRRR',

STRING(10).

IF ITAB-FIELD2 = 'ABCDF' .

REPLACE ITAB-FIELD2 WITH STR2 INTO STRING.

ENDIF.

regards,

madhu

4 REPLIES 4
Read only

Former Member
0 Likes
624

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

Read only

Former Member
0 Likes
624
loop at itab.
v_tabix = sy-tabix.
   if itab-field2 CS 'ABCD'.
       itab-field2 = 'RRRRRRRRRR'.
       modify itab index v_tabix.
  endif.
endloop.
Read only

Former Member
0 Likes
625

hi

DATA: STR2(10) VALUE 'RRRRRRRRRR',

STRING(10).

IF ITAB-FIELD2 = 'ABCDF' .

REPLACE ITAB-FIELD2 WITH STR2 INTO STRING.

ENDIF.

regards,

madhu

Read only

Former Member
0 Likes
624

Use the below code...

loop at itab.

if itab-field2 CS 'ABCD'.

itab-field2 = 'RRRRRRRRRR'.

modify itab index sy-tabix.

endif.

endloop.