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

move corresponding query

Former Member
0 Likes
636

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

6 REPLIES 6
Read only

Former Member
0 Likes
600

Your move statement is fine. Are you sure you have data in itab?

Read only

Former Member
0 Likes
600

Hi,

THis should work..Check if there is any value in the internal table itab.

Thanks,

Naren

Read only

Former Member
0 Likes
600

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

Read only

abdul_hakim
Active Contributor
0 Likes
600

hi

your statement is fine.ensure you have data in itab.

Cheers,

Abdul Hakim

Read only

shishupalreddy
Active Contributor
0 Likes
600

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

Read only

anversha_s
Active Contributor
0 Likes
600

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