‎2007 Jul 18 1:15 PM
can u just send the syntax
moving three internal tables into final internal table its urgent
‎2007 Jul 18 1:17 PM
Hi!
If the field names are the same in the target and destination tables, you can use the MOVE-CORRESPONDING command for this.
For example:
target is wa_main and gt_main
REFRESH gt_main.
LOOP AT gt_mard INTO wa_mard.
READ TABLE gt_marc INTO wa_marc
WITH KEY matnr = wa_mard-matnr
werks = wa_mard-werks.
READ TABLE gt_mara INTO wa_mara
WITH KEY matnr = wa_mard-matnr.
CLEAR wa_main.
MOVE-CORRESPONDING wa_mara TO wa_main.
MOVE-CORRESPONDING wa_marc TO wa_main.
MOVE-CORRESPONDING wa_mard TO wa_main.
APPEND wa_main TO gt_main.
ENDLOOP.
Regards
Tamás
Message was edited by:
Tamás Nyisztor
‎2007 Jul 18 1:19 PM
‎2007 Jul 18 1:24 PM
Hi
You can use Append, modify itab1 to itab2, move-corresponding, insert...
You have to keep a loop ont he 1st internal table and u have to fetch that data and pass that values to second and after that apply loop on 2nd and pass that values to 3rd
Reward all helpfull answers
Regards
Pavan
‎2007 Jul 18 1:19 PM
if the 3 internal tables are of same type and you want to move that to internal table of same type then....
append lines of itab1 to itab.
append lines of itab2 to itab.
append lines of itab3 to itab.
if they are different then
loop and move-corresponding internal table to final table and append .
this case you have to loop 3 times. for each one once.
Regards
Vijay
‎2007 Jul 18 1:19 PM
Hi,
You can do this way.
loop at itab1 into wa1.
wa-f1 = wa1-f1.
wa-f2 = wa1-f2.
and so on.
append wa to itabfinal.
endloop.
Now for the second internal table.
loop at itab2 into wa2.
wa-f1 = wa2-f1.
and so on.
append wa to itabfinal.
endloop.
Do the same for the third internal table to move its content to the final internal table.
Hope it will be useful.
Thanks,
Sandeep.
‎2007 Jul 18 1:21 PM
hi..
Loop at it1.
Loop at it2_item where item = it1-item.
Loop at it3_item where item = it1-item.
Move-corresponding it1 to it_final.
Move-corresponding it2 to it_final.
Move-corresponding it3 to it_final.
Append it_final.
Endloop.
Endloop.
Endloop.
<b>Reward points if useful</b>
regards
Ashu
‎2007 Jul 18 1:21 PM
Hi,
Try like this...
LOOP AT ITAB1.
MOVE-CORRESPONDING ITAB1 TO ITAB.
APPEND ITAB.
ENDLOOP.
LOOP AT ITAB2.
MOVE-CORRESPONDING ITAB2 TO ITAB.
APPEND ITAB.
ENDLOOP.
LOOP AT ITAB3.
MOVE-CORRESPONDING ITAB3 TO ITAB.
APPEND ITAB.
ENDLOOP.
REGARDS,
NAGARAJ
‎2007 Jul 18 1:22 PM
Hi,
Loop at each of the tables from which you want to move the contents to the final internal table.
Remember to move the correct fields from the internal tables to the final internal table fields.
Thanks,
Sandeep.
‎2007 Jul 18 1:22 PM
Hello,
It depends on the key fields of the 3 internal tables.
If all the keys used have multiple records then u have to use a Loop else u can use a read statement.
Considering u have multiple records :-
Loop at itab1 into wa_tab1.
Move-corresponding wa_tab1 to wa_final.
Loop at itab2 into wa_tab2 where field1 = wa_tab1-field1.
Move-corresponding wa_tab2 to wa_final.
Loop at itab3 into wa_tab3 wher field1 = wa_tab1-field1 and field2 = wa_tab1-field2.
Move-corresponding wa_tab3 to wa_final.
Append wa_final to gt_final.
clear wa_final.
endloop.
endloop.
endloop.If unique records r there then use 2 Reads instead of the 2 inner loops .
Regards,
Deepu.K
Regards,
Deepu.K
‎2007 Jul 18 1:24 PM
hello,
Try this and don't forget to reward all helpfull answers
append lines of itab1 to itab.
append lines of itab2 to itab.
append lines of itab3 to itab.
Regards,
Rakesh.