‎2007 Jul 18 12:30 PM
I want to move the internal tables to final internal table how pls let me know
urgent
‎2007 Jul 18 12:31 PM
hi,
Use
MOVE itab to Final_itab.
or
itab[] = final_itab[].
Message was edited by:
Roja Velagapudi
‎2007 Jul 18 12:32 PM
Hello,
Try this and <b>reward if found helpfull
</b>
itab1[ ] = itab2[ ].
Regards,
Rakesh.
‎2007 Jul 18 12:32 PM
Hi,
if the table are equal in structure do itab0[] = itab[].
regards, dieter
‎2007 Jul 18 12:33 PM
If the internal tables and final internal table structure are similar
then do the following.
append lines of itab1 to itab_final.
append lines of itab2 to itab_final.
‎2007 Jul 18 12:33 PM
Hi,
You can use Append line of itab to itab-final.
refer help for syntax .
other wise you can directly append like
itabfinal[] = itab[].
bye,
satya.
‎2007 Jul 18 12:33 PM
hi,
Chk this sample.
data : begin of itab1 occurs 0. "itab with work area.
key_field1 like ztable1-key_field1,
field1 like ztable1-field1,
field2 like ztable1-field2,
endof itab1.
data : begin of itab2 occurs 0. "itab with work area.
key_field2 like ztable2-key_field2,
field3 like ztable2-field3,
field4 like ztable2-field4,
endof itab2.
data : begin of itab_final occurs 0.
key_field like ztable1-key_field1,
field1 like ztable1-field1,
field2 like ztable1-field2,
field3 like ztable2-field3,
field4 like ztable2-field4,
endof itab_final.
LOOP AT ITAB1.
MOVE-CORRESPONDING TO ITAB1 to ITAB_FINAL.
READ TABLE ITAB2 WITH KEY FILED1 = ITAB1-FIELD1.
if sy-subrc = 0.
MOVE-CORRESPONDING TO ITAB2 to ITAB_FINAL.
endif.
append itab_final.
clear itab_final.
endloop
<b>Reward points if useful</b>
Regards
Ashu
‎2007 Jul 18 12:35 PM
Hi,
Consider this Example.
Im going to move the two internal tables to the final internal table.
Loop the 1st internal table.
Use read table table itab2.
ex.
loop at it_bkpf.
read table it_with_item with key belnr = it_bkpf-belnr.
it_final-belnr = it_bkpf-belnr.
it_final-field2 = it_bfpf-budat.
it_final-field3 = it_with_item-with.
..........
........
append it_final.
Endloop.
Thanks,
Reward If Helpful.
‎2007 Jul 18 12:35 PM
Hi,
U can copy the tablename into ur namespace but u can copy the table records only by using programming:
Move itab1[] to itab2[].
Pls reward helpful points.
Regards,
Ameet
‎2007 Jul 18 12:36 PM
If both the internal tables are of the same structure then u can use itab1[] = itab2[].
If they are of different strucures then u should use the code as shown below.
LOOP AT itab2.
MOVE-CORRESPONDING itab2 TO itab1.
APPEND itab1.
ENDLOOP.
Reward if helpful.
Cheers,
Sharadendu
‎2007 Jul 18 12:38 PM
hi ramesh
it is simple jus try this
<b>select single * from table into corresponding fields of table <final itab> where <cond>.</b>
REWARD IF USEFUL............!!!
‎2007 Jul 18 12:41 PM
Hi
I think you have to apply nested loops on internal tables in which u have data
and at last append them to final table.
Rewards points if useful.
Regards,
shiv.
‎2007 Jul 18 12:48 PM
<b>Example</b>
The structure struc1 contains the components:
<b>struc1-comp1
struc1-struci-comp1
struc1-struci-comp2-col1
struc1-struci-comp2-col2</b>
The structure struc2 contains the components:
<b>struc2-struci-comp1
struc2-struci-comp2
struc2-struci-comp3</b>
Over the length of the shorter path, the components struci-comp1 and struci-comp2 have the same name. These are assigned from struc1 to struc2. In struc1, struci-comp2 is self-structured, in struc2, struci-comp2 is elementary. In the assignment of struc1-struci-comp2 to struc2-struci-comp2, the source field is documented as an elementary field of type c in accordance with the conversion rules for structures. The components struc1-comp1 and struc2-struci-comp3 do not have any equivalents with the same name and are not taken into account in the assignment.
DATA: BEGIN OF struc1,
comp TYPE c LENGTH 1 VALUE 'U',
BEGIN OF struci,
comp1 TYPE c LENGTH 1 VALUE 'V',
BEGIN OF comp2,
col1 TYPE c LENGTH 1 VALUE 'X',
col2 TYPE c LENGTH 1 VALUE 'Y',
END OF comp2,
END OF struci,
END OF struc1.
DATA: BEGIN OF struc2,
BEGIN OF struci,
comp1 TYPE string,
comp2 TYPE string,
comp3 TYPE string,
END OF struci,
END OF struc2.
MOVE-CORRESPONDING struc1 TO struc2.
reward points if it is usefull ....
Girish