‎2009 Jan 05 2:33 PM
hi folks,
i have 2 internal tables like itab1 and itab2.
itab1 say zkna1 with 5 fields one field say kunnar
itab2 say zkna2 with one field say zkna2-kunnner.
i would like to get the all data for kunnr data from zkna1
put into zkna2.
here both are internal tables.
how can we solve this problem.
thank u
advance
‎2009 Jan 05 2:41 PM
Hi Sailaja,
do the following:
1) select data from the kna1 into it_kna1
2) loop it_kna1 into wa_kna1.
wa_kna2-kunnr2 = wa_kna1-kunnr1.
append wa_kna2 to it_kna2.
clear wa_kna1.
endloop.
Solves your problem.
Thanks!!
‎2009 Jan 06 9:33 AM
‎2009 Jan 05 3:44 PM
‎2009 Jan 05 3:52 PM
HI sailiaja,
Aparna solution will solve u r problem.
I am agrre with aparna.
Thanks,
‎2009 Jan 05 6:44 PM
Hi,
You can try this statement..
insert lines of itab1 <condition> into itab2 <condition>.
Regards
Vasavi Kotha
‎2009 Jan 06 9:40 AM
Hi
No need to fetch data into another internal table
Straight away loop at zkna1 into wa_kna1.
wa_kna2=wa_kna1.
append wa_kna2 to zkna2.
clear wa_kna2.
endloop.
this will help and will improve performance.
regards
prashant.
‎2009 Jan 06 9:46 AM
Loop on the 1st internal table and move the kunnr filed values from 1st internal table to second internal table, you will get the entire data of kunnr from 1st internal table to 2nd internal table.
‎2009 Jan 06 10:01 AM
Hi,
Try this,
Loop i_kna1 into wa_kna1.
wa_kna2-kunnr = wa_kna1-kunnr.
append wa_kna2 to i_kna2.
clear: wa_kna1, wa_kna2.
endloop.
Regards,
Joan