2007 Jul 16 2:16 PM
hi all,
i have a problem in moving a field from one internal table to other internal table , both are declared as with out header line. i have declared workareas for both internal tables , when iam trying to move name field from second internal table which have two fields,, to first internaltable having values in itand empty name field, the first internal table is overwritten and only name field is populated
please could any one help me in this issue. i have tried using modify append and other keyword. thanks in advance.
sre
2007 Jul 16 2:25 PM
loop at itab1 into wa1.
move wa1-fld1 to wa2-fld1.
<i>" corresponding fields... MOVE-CORRESPONDING should be avoided</i>
append wa2 to itab2.
endloop.
Reward if helpful
Regards
Prax
2007 Jul 16 2:20 PM
move-corresponding wa_itab1 to wa_itab2.
append it_iotab2 from wa_itab2.
clear wa_itab2.
2007 Jul 16 2:21 PM
hi
try
append wa2 to corresponding fields of itab1.
regards
ravish
reward if useful
2007 Jul 16 2:24 PM
thanks for the reply but when i used move-corresponding , its giving error like these are not internal tables with header line, i want to move structure valuse to internal
2007 Jul 16 2:24 PM
Hi,
Use the below logic. Hope it wil help.
Loop at itab1 into wa1.
read table itab2 into wa2 with key primary = wa1-primary.
if sy-subrc = 0 .
wa1-name1 = wa2-name1.
wa1-name2 = wa2-name2.
endif.
modify itab1 from wa1.
endloop.
the above logic will definitely wrk in ure case.
Reward if helpful,
Cheers,
Sharadendu
2007 Jul 16 2:25 PM
loop at itab1 into wa1.
move wa1-fld1 to wa2-fld1.
<i>" corresponding fields... MOVE-CORRESPONDING should be avoided</i>
append wa2 to itab2.
endloop.
Reward if helpful
Regards
Prax
2007 Jul 16 2:36 PM
Hi,
Please try this.
loop at itab1 into wa1.
wa2-f1 = wa1-f1
wa2-f2 = wa2-f2.
append wa2 to itab2.
clear wa2,wa1.
endloop.
Thanks,
Sandeep.
2007 Jul 16 2:40 PM
2007 Jul 16 3:04 PM