‎2008 Jun 12 7:55 AM
I am fetching say 10 fields from database table into internal table INT_TAB1
After this internal table is filled I have another internal table INT_TAB2 with structure same as INT_TAB1 with 2 additional fields.
Before I fill INT_TAB2 with additional fields, I want transfer corresponding fields of INT_TAB1 to INT_TAB2,
How can I do this?
Thanks.
‎2008 Jun 12 7:59 AM
HI,
use the code as below.
loop at INT_TAB1.
move-coresponding INT_TAB1 to INT_TAB2.
append INT_TAB2.
endloop.
rgds,
bharat.
‎2008 Jun 12 7:56 AM
Hello!
Try this:
LOOP AT INT_TAB1.
MOVE-CORRESPONDING INT_TAB1 TO INT_TAB2.
ENDLOOP.
‎2008 Jun 12 7:57 AM
hi,
if the first 10 fields in the both the tables are in same order u can use:
INT_TAB2[] = INT_TAB1[].
if not,
loop at itab1.
move-corresponding itab1 to itab2.
endloop.
regards,
madhu
‎2008 Jun 12 8:05 AM
HI,
if we assign directly itab1[] = itab2[], directly i think it will show a syntax error in ECC as this is not recommended by SAP.Check that before using in ECC.
raj
‎2008 Jun 12 7:59 AM
HI,
use the code as below.
loop at INT_TAB1.
move-coresponding INT_TAB1 to INT_TAB2.
append INT_TAB2.
endloop.
rgds,
bharat.
‎2008 Jun 12 8:05 AM
HI SV,
Take two internal table INT_TAB1,INT_TAB2 both internal talbes.
Assume both tables same structre:
INT_TAB2[] = INT_TAB1[].
First internal table data transters to the second internal table.
Assume second internal table more fields than first internal table.
Move corresponding fields INT_TAB1 to INT_TAB2.
try this one.
SReddy.