10-17-2008 7:12 AM
hi,
i want to update one field of internal table from field from some another internal table whose key field matches.
10-17-2008 7:15 AM
hi,
do the following:
loop at IT_A into WA_A.(internal table whose field value is to
be updated)
read table IT_B into WA_B with key abc = WA_A-abc.(internal
table which contains the field value to be assigned )
if sy-subrc = 0.
move WA_B-field to WA_A-field.
modify IT_A index sy-tabix from WA_A transporting field.
endif.
endloop.
try this....
10-17-2008 7:15 AM
hi,
do the following:
loop at IT_A into WA_A.(internal table whose field value is to
be updated)
read table IT_B into WA_B with key abc = WA_A-abc.(internal
table which contains the field value to be assigned )
if sy-subrc = 0.
move WA_B-field to WA_A-field.
modify IT_A index sy-tabix from WA_A transporting field.
endif.
endloop.
try this....
10-17-2008 7:17 AM
Hi
u can modify the itab
in follwing ways
Modify in a LOOP.
LOOP AT inttab.
MOVE ... TO inttab-field1.
MODIFY inttab.
ENDLOOP.
MODIFY BY index
MODIFY inttab INDEX int_index.
MODIFY BY condition
MODIFY inttab WHERE field1 = ....
Edited by: srinivasu bv on Oct 17, 2008 8:17 AM
10-17-2008 7:17 AM
Hi,
loop ur final table, in this loop read another table based on key
and move to ur final table.
loop at it_final.
read table it_req with key ........
if sy-subrc = 0.
move required fields to it_final.
modify it_final.
endif.
endloop.
i hope u can understand.
10-17-2008 7:34 AM
Folllowing Code may help u:
Itab_1 - First internal table.
Wa_1 - Work Area for first internal table.
Itab_2 - Second internal table.
Wa_2 -> WorkArea for second internal table.
key - Field common to both the table.
loop at ITab_1 into WA_1.
read table ITab_2 into WA_2 with key abc = WA_1-abc .
if sy-subrc = 0.
move WA_2-field to W1_A-field.
modify ITab_1 index sy-tabix from WA_1 transporting field.
endif.
endloop.