‎2008 Mar 14 11:15 AM
hello,
how can tranfer 1 internal table data into another one. when both have different structure and no common field exist between them.
with regard,
parul
‎2008 Mar 14 11:18 AM
HI,
move: itab1-field1 to itab2-field1,
itab1-field2 to itab2-field2,
itab1-field3 to itab2-field3,
append itab2.
clear itab2.
Regards,
S.Nehru.
‎2008 Mar 14 11:18 AM
You can transfer by massive assignment
tab_dest[] = tab_source[].
In your case i would make a loop.
loop at itab_source.
append itab_dest.
endloop.
Please reward if helpful.
Bye
Tony
‎2008 Mar 14 11:20 AM
Hi,
Try joining internal tables if u could bring any third table which is common to these tables.
Then, loop and pass value from one work area to the other individually.
If u specify the database table names, we could help u.
Regards,
Ramya
‎2008 Mar 14 11:29 AM
Hi,
Check this code.
types: begin of tp_itab1,
fld1 type c,
end of tp_itab1.
types: begin of tp_itab2,
fld2 type i,
fld3 type c,
end of tp_itab2.
data: itab1 type standard table of tp_itab1,
wa_itab1 type tp_itab1,
itab2 type standard table of tp_itab2,
wa_itab2 type tp_itab2.
wa_itab1-fld1 = 'A'.
wa_itab2-fld2 = '2'.
append wa_itab1 to itab1.
append wa_itab2 to itab2.
move wa_itab1-fld1 to wa_itab2-fld3.
append wa_itab2 to itab2.
Reward if helpful.
Regards.
‎2008 Mar 14 11:33 AM
Through this login there is some problems :
1) Data are append in last where itab 1 already have some values. new data comes after that values.
2) i have to tranfer all columm value... through this only 1 value of 1 columm is being transfer..
give me some other solution.
‎2008 Mar 14 12:22 PM
Hello
You can make two structures, one for each table.
Then make a loop at table to be copied and in the loop statment use operators MOVE-CORRESPONIDNG FIELDS and APPEND it will look as folows.
LOOP AT itab1 INTO ls_tab1.
MOVE-CORRESPONDING ls_tab1 TO ls_tab2.
APPEND ls_tab2 to itab2.
ENDLOOP.
Hope it helps.
Regards
‎2008 Mar 15 5:07 AM
‎2008 Mar 15 5:19 AM
hai Mittal,
try this Simple Logic.
Loop at itab.
move : itab-f1 to Itab1-f1,
itab-f2 to itab1-f2.
Append Itab2.
End loop
Regards.
Eshwar..
‎2008 Mar 15 5:31 AM
‎2008 Mar 14 12:36 PM
Hi,
If both structures are different, then its impossible except for the case:
Some fields of one are convertible to some fields of the other.
In that case when you are apeending the itab1 to itab2, some records will be populated.
Reward if helpful.