Application Development 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: 

move-corresponding itab1 to itab2

Former Member
0 Kudos

Hi guys,

is it possible for a move-corresponding to transfer all entries of itab1 to itab2 by just using this code:

move-corresponding itab1 to itab2????

or move-corresponding is only for one entry? thanks a lot!

always,

mark

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Move-corresponding will move all the fields from one internal table to another.

So to transfer all entries into another internal table we can have move-corresponding itab1 to itab2.

or u can use itab1[ ] = itab2[ ].

If we take into account the performance the itab1[] = itab2 is much faster than move-corresponding, as move-corresponding has the bottle neck to search all fields of similar name.

Hope this helps you,

Thanks,

Dhanashri.

Edited by: Dhanashri Pawar on Jun 23, 2008 7:25 AM

Edited by: Dhanashri Pawar on Jul 31, 2008 7:57 AM

7 REPLIES 7

nikhil_chitre
Active Participant
0 Kudos

Hi

Try Using

itab1 [ ] = itab2 [ ]

if you want to copy the whole internal table to second table

Regards,

Nikhil

Edited by: Nikhil A Chitre on Jun 23, 2008 11:55 AM

Edited by: Nikhil A Chitre on Jun 23, 2008 11:56 AM

Edited by: Nikhil A Chitre on Jun 23, 2008 11:56 AM

Former Member
0 Kudos

Hi

Move-corresponding: transfer the data from a structure to another one in according to the name of the fields.

move-corresponding itab1 to itab2

So u can use above code to move all data from one internaltable to other internal table

U can also use

itab1[] =  itab2[]

Former Member
0 Kudos

Hi Mark,

Yes it is possible! but make sure that the availble fields is the same as you pass the data to another table. Try using itab1[] = itab2[] , it is much faster than the syntax move-corresponding . Be sure to have the same format of the itab.

Regards,

Mark

Former Member
0 Kudos

syntax : move-corresponding itab1 to itab2

this syntax is most faster : itab2[ ] = itab1[ ].

Link:[Abap Tips|http://abap4beginner.blogspot.com]

Edited by: anuar jusoh on Jun 23, 2008 4:25 AM

Former Member
0 Kudos

Hi,

Move-corresponding will move all the fields from one internal table to another.

So to transfer all entries into another internal table we can have move-corresponding itab1 to itab2.

or u can use itab1[ ] = itab2[ ].

If we take into account the performance the itab1[] = itab2 is much faster than move-corresponding, as move-corresponding has the bottle neck to search all fields of similar name.

Hope this helps you,

Thanks,

Dhanashri.

Edited by: Dhanashri Pawar on Jun 23, 2008 7:25 AM

Edited by: Dhanashri Pawar on Jul 31, 2008 7:57 AM

Former Member
0 Kudos

Hi

Hi

Move: transfer the data from a structure to another one in according to the length of original structure;

Move-corresponding: transfer the data from a structure to another one in according to the name of the fields, so in your case:

data: begin of t_cash, "cash transactions

D1(08), "Post Date

D2(40), "Employee Name

D3(40), "Employee Vendor Id

end of t_cash.

data: begin of t_card, "card transactions

D1(08), "Post Date

D2(40), "Employee Name

D4(25), "Merchant Name

end of t_card.

If you use MOVE, u shoudl consider T_CARD is shorter than T_CASH: the last field D4 is long 25 CHAR, but the last field D3 is long 40 char. So u'll loose the last 15 digit of T_CASH

MOVE T_CASH TO T_CARD.

is like

T_CARD = T_CASH(73).

If you use MOVE-CORRESPONDING, u'll transfer only the information of the field D1 and D2:

MOVE-CORRESPONDING T_CASH TO T_CARD.

is like

T_CARD-D1 = T_CASH-D1.

T_CARD-D2 = T_CASH-D2.

Now the problem is ECC 6.00 is unicode release, so the statament MOVE-CORRESPONDING can't be used if the original and destination variable have a different structure.

Former Member
0 Kudos

Hi,

You can use statments below :



append lines of itab1 to itab2.

OR

itab2 [  ]  = itab1 [  ].

Use above for better performance.

Thanks,

Sriram Ponna.