2007 Jan 26 8:53 AM
Hi all
This will be a simple question. But I wish to know is there anyway that i can do other than having to loop IT_REP to workarea then append each record of workarea into IT_REP_NEW.
It will be troublesome if i have many fields to move.
LOOP AT IT_REP INTO WA_REP.
WA_REP_NEW-VKORG = WA_REP-VKORG.
WA_REP_NEW-VTWEG = WA_REP-VTWEG.
WA_REP_NEW-BZIRK = WA_REP-BZIRK.
WA_REP_NEW-BAHNS = WA_REP-BAHNS.
APPEND WA_REP TO IT_REP_NEW.
ENDLOOP.
Thanks for helping.
2007 Jan 26 8:55 AM
If it_rep_new has the same structure or, both the tables have a common set of fields that appear first, then you can simply say:
I mean if itab1 has field1 field2 field3.
and itab2 has fields field1 field2
itab1[] = itab2[].
REgards,
Ravi
Message was edited by:
Ravi Kanth Talagana
2007 Jan 26 8:55 AM
If it_rep_new has the same structure or, both the tables have a common set of fields that appear first, then you can simply say:
I mean if itab1 has field1 field2 field3.
and itab2 has fields field1 field2
itab1[] = itab2[].
REgards,
Ravi
Message was edited by:
Ravi Kanth Talagana
2007 Jan 26 8:56 AM
hi,
do this way
IT_REP_NEW[] = IT_REP[] .
You can move that way provided that the structure of the two tables should be same
Regards,
santosh
2007 Jan 26 8:57 AM
Hi Hui,
Instead of using separate assignments you can use move corresponding fields option.Make sure the source and the target have the same field names.
Pls reward if found useful.
Thanks
Shyam
2007 Jan 26 8:57 AM
2007 Jan 26 8:57 AM
1. LOOP AT IT_REP INTO WA_REP.
move-corresponding WA_REP to WA_REP_NEW.
APPEND WA_REP_NEW TO IT_REP_NEW.
ENDLOOP.
2. If the structures are same then use
APPEND LINES OF IT_REP TO IT_REP_NEW.
2007 Jan 26 8:59 AM
Hi,
Use the following -
APPEND LINES OF it_rep to it_rep_new.
Reward points if found useful...!
Cheers
Abhishek
2007 Jan 26 9:04 AM
2007 Jan 26 9:07 AM
hi Hui,
if u have the 2 tables have the same structure then u can use as mentionded by other above..
i.e..
IT_TAB1[] = IT_TAB2[].
.
If the there is diffence then u have assigne field by field... only.
LOOP AT IT_REP INTO WA_REP.
WA_REP_NEW-VKORG = WA_REP-VKORG.
WA_REP_NEW-VTWEG = WA_REP-VTWEG.
WA_REP_NEW-BZIRK = WA_REP-BZIRK.
WA_REP_NEW-BAHNS = WA_REP-BAHNS.
*APPEND WA_REP TO IT_REP_NEW
APPEND WA_REP_new TO IT_REP_NEW.
ENDLOOP.