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

itab1 = itab2?

Former Member
0 Likes
580

Hi Experts,

I hv 2 itabs.

first itab is having

field1

field2

field3

Second itab is having one extra field,

field1

field2

field3

field4_extra field

So, now, I am selecting the data from VBAK and populating in to itab1.

Now, I have to transfer this itab1 data to itab2(which is hving one extra field)

So, I am using,

itab2 = itab1.

But, i am getting the error i.e. saying that both itabs r not same!

So, How I can transfer the itab1 data to itab2? (later, I can populate the data for that one extra filed in itab2)

ThanQ.

Hi Experts,

I hv 2 itabs.

first itab is having

field1

field2

field3

Second itab is having one extra field,

field1

field2

field3

field4_extra field

So, now, I am selecting the data from VBAK and populating in to itab1.

Now, I have to transfer this itab1 data to itab2(which is hving one extra field)

So, I am using,

itab2 = itab1.

But, i am getting the error i.e. saying that both itabs r not same!

So, How I can transfer the itab1 data to itab2? (later, I can populate the data for that one extra filed in itab2)

ThanQ.

3 REPLIES 3
Read only

Former Member
0 Likes
533

Hi,

User move-corresponding statement.

Try this.

<b>

MOVE-CORRESPONDING itab1 to itab2.

</b>

This will move "field1, field2, field3" from ITAB1 to ITAB2. Later on you can populate extra command.

Let me know if you need any other information.

Regards,

RS

Read only

suresh_datti
Active Contributor
0 Likes
533

You eith have to use mov-ocrresponding or individual fields after opening the loop ie.

loop at itab1.

itab2-field1 = itab1-field1.

itab2-field2 = itab1-field2.

itab2-field3 = itab1-field3.

itab2-field4 = vbak-vbeln.

append itab2.

clear itab2.

endloop.

~Suresh

Read only

0 Likes
533

ThanQ. Both ideas r working.