‎2006 Sep 22 9:35 PM
hi all,
i have 2 internal tables.
I moving data from internal table 1 to imnternal table 2.
My problems is that the two internal tables have same fields
data: begin of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
end of itab.
data: begin of itab1 occurs 0,
maktx like makt-maktx,
matnr like mara-matnr,
end of itab1.
I have data in itab and trying to move to itab2.
loop at itab.
move-corresponding itab to itab1.
append itab1.
endloop.
I am not getting any values ,i guess the field in itab1 should be in the same order.
I have itab1 as i declared is there any way that i can from itab to itab1.
iam not from programming background and i knew that there was something like move corresponding fields --
pls let me know
thanks
‎2006 Sep 22 9:39 PM
Your move statement is fine. Are you sure you have data in itab?
‎2006 Sep 22 9:39 PM
Hi,
THis should work..Check if there is any value in the internal table itab.
Thanks,
Naren
‎2006 Sep 22 9:41 PM
Hi
Change the order of itab1 similar to that of itab.
If you have same structure you can directly use
Move itab[] to itab1[].
Nataraju
‎2006 Sep 22 10:15 PM
hi
your statement is fine.ensure you have data in itab.
Cheers,
Abdul Hakim
‎2006 Sep 25 5:38 AM
Hi ensure that both the internal tables strucutures are same includng the field orders .
use
ITAB2[] = ITAB1[].
Even your statement is fine it should work check whther ur getting data in the first internal table in debugging mode .
Thanks
‎2006 Sep 25 5:54 AM
hi preeti,
one important sugestion.
never use move corresponding. it will result in very low performance.
so alwys declare the 2nd itab in the same order itself.
data: begin of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
end of itab.
data: begin of itab1 occurs 0,
<b>matnr like mara-matnr,</b>
maktx like makt-maktx,
end of itab1.
<b>thn do this.
if itab[] is not initial.
itab1[] = itab[].
else.
write "no data in itab".
endif.
</b>
but what u wrote in ur question correct.
chk ur itab has data. as i did in my code.
rgds
anver
if helped mark points