Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Internal table

Former Member
0 Likes
547

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
532

HI,

use the code as below.


loop at INT_TAB1.
move-coresponding INT_TAB1 to INT_TAB2.
append INT_TAB2.
endloop.

rgds,

bharat.

5 REPLIES 5
Read only

Former Member
0 Likes
532

Hello!

Try this:

LOOP AT INT_TAB1.

MOVE-CORRESPONDING INT_TAB1 TO INT_TAB2.

ENDLOOP.

Read only

Former Member
0 Likes
532

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

Read only

0 Likes
532

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

Read only

Former Member
0 Likes
533

HI,

use the code as below.


loop at INT_TAB1.
move-coresponding INT_TAB1 to INT_TAB2.
append INT_TAB2.
endloop.

rgds,

bharat.

Read only

Former Member
0 Likes
532

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.