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
263

Hi all,

I have 2 internal tables itab1 and itab2.

itab1 contains one more internal table itab1_1 and some other fields.

itab2 is same as itab1_1 table.

i want to copy the itab2 values into the itab1_1 table which is available in the itab1.

can any body help me with the sample code.

thanks in advance

kp

2 REPLIES 2
Read only

Former Member
0 Likes
247

loop at itab2.

move itab2-field to itab1-fields( i mean itab1 has itab1_1).

Move each field one by one .

do not use move-corresponding ( I mean it will have performance issue )

endloop.

Thanks

Seshu

Read only

Former Member
0 Likes
247

Hi,

1. Declare a work area or structure (<b>wa_itab1</b>) of type itab1.

2. Then copy contents of itab2 to wa_itab1-itab1_1,

i.e <b>wa_itab1-itab1_1 = itab2.</b>

3. If u know the index of the row in itab1 where u want to insert itab2, then use

<b>MODIFY itab1 FROM w_itab1 INDEX index_no</b>

OR use

<b>MODIFY TABLE itab1 FROM w_itab1 .</b>

Reward points if the answer is helpful.

Regards,

Mukul