Application Development 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: 

itab1 to itab2

Former Member
0 Kudos

hi,

i am having values in one itab1.in another itab2 i am having same fields plus few extra fields with values.i want to move the values in first itab to itab2.

when i used this query i am not getting values in itab2.

loop at itab1.

move-corresponding wa1 to wa2.

modify itab2 from wa2 transporting .....

endloop.

if anyone knows kindly help me.thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

It is not clear whether itab1 and itab2 will contain same no. of records? If so, if you want to modify itab2, on what basis you want to do it. No index specified nor condition.

Give some example how you want, so that you can get proper suggestion.

9 REPLIES 9

Former Member
0 Kudos

Hi,

In your code, there is no values specify from itab1. write like this and try,

loop at itab1 into wa1.

modify itab2 from wa1.

endloop.

Suku

Former Member
0 Kudos

Try this.

loop at itab1 into wa1.

move wa1 into corresponding fields of wa2.

modify itab2 from wa2.

endloop.

awrd points if helpful

Bhupal

arpit_shah
Contributor
0 Kudos

in this u r not store data in wa1.

try like this,

loop at itab1 into wa1.

move-corresponding wa1 to wa2.

append wa2 to itab2. "or modify itab2 from wa2 transporting .....

endloop.

or

append lines of itab1 to itab2.

this directly append itab1 into itab2.

Regards,

Arpit

kesavadas_thekkillath
Active Contributor
0 Kudos

loop at itab1 into wa1.

move-corresponding wa1 to wa2.

append wa2 to itab2.

clear wa2.

endloop.

Former Member
0 Kudos

Hi,

Change ur code like this and try.

loop at itab1 into wa1.

move-corresponding wa1 to wa2.

append wa2 to itab2.

clear wa2.

endloop.

Regards,

Srinivas

Former Member
0 Kudos

Hi,

It is not clear whether itab1 and itab2 will contain same no. of records? If so, if you want to modify itab2, on what basis you want to do it. No index specified nor condition.

Give some example how you want, so that you can get proper suggestion.

0 Kudos

Thanks for ur replies.

I hav to select data's from three tables without using innerjoin.by using for all entries in i got values in two itabs.i hav to move itab1 to itab2.but i am not getting itab1 values in itab2 instead getting 0.

0 Kudos

Kavi,

check whether the itab1 and itab2 has same fields or not. please give your sample code here which u written. also check manually itab1 and itab2 has values.

Suku

Former Member
0 Kudos

Hi Kavitha

Try this code.

First Declare the work area and internal table.

Retrieve the records using the select query and put it into WA.

finally move the WA into internal table.

select phcode wpcode actcode tascode actstdate valedate tasstdate tasenddate from zse_projmethod1 into corresponding

fields of wa_execution where phcode = i_variable and wpcode = ' ' and actcode = ' ' and tascode = ' '.

endselect.

wa_execution-actstdate = sy-datum.

wa_execution-actendate = '31/12/9999'.

append wa_execution to tab_execution.

EXP_execution[] = tab_execution[].

Hope this will help you.

reward if help.