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

move-corresponding

Former Member
0 Likes
1,399

Hi,

Is this line a cause to performance issue?

MOVE-CORRESPONDING t_bt_pos_match TO t_db_match_send.

The tables used here are having 10 fields each.

Shall I enter values in each field individually or its ok to use this statement ?

Thanks,

Binay.

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,284

Hi,

If both the tables have same fields, With respect to their type and length then you can just use = or MOVE.

MOVE-CORRESPONDING should be used only when you want to move the data based on field names.

The performance of MOVE Is better than MOVE-CORRESPONDING since here you dont compare the field names but just do a byte/char sequence copy.

Regards,

Sesh

8 REPLIES 8
Read only

gopi_narendra
Active Contributor
0 Likes
1,284

It causes a performance issue.

Its better to move each field individually instead of using move-corresponding.

Regards

Gopi

Read only

Former Member
0 Likes
1,284

its depends on data how much ur passing one table to another.

If internal table contains lacs of data better u need to use move with each field.

Read only

Former Member
0 Likes
1,284

the move-corresponding does not come for free, but I don't think that it causes a performance problem.

Be aware that if the structures change, then the move-corresponding will still work.

Generally it is of course recommended to use identical structures, if possible.

Siegfried

Read only

0 Likes
1,284

> Be aware that if the structures change, then the

> move-corresponding will still work.

>

> Generally it is of course recommended to use

> identical structures, if possible.

MOVE-CORRESPONDING is a beautiful statement. Very nice if you want to join information from various structures into one. However, it does have one disadvantage - which is also its strength mentioned by Siegfried.

If you change an include that is used in both structures, everything works without any needs for updating the code. However, if you remove a field from an include, or a list of selected fields, you don't get any warnings that you were actually using this field for something.

I would say the advantages outweigh the disadvantage, but I have kicked myself a couple of times after finally finding out why my code didn't work as I expected.


Kjetil Kilhavn (Vettug AS) - ABAP developer since Feb 2000, but will probably never be a Rockstar developer
Read only

Former Member
0 Likes
1,284

MOVE-CORRESPONDING Should not cause performance issues. It will work in mojority of cases. If your development guidelines does not restrict the usage, it will be good to use it.

Regards,

Vishal

Read only

Former Member
0 Likes
1,284

for completeness,

move-corresponding should not be used with selects to buffered tables. The runtime on the table buffer is much faster, such that you will notice the time for the move-corresponding, in relation to the buffer access.

There it makes sense to do direct moves of the few wanted fields.

In relation to database select the move-corresponding should not play a role.

Siegfried

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,285

Hi,

If both the tables have same fields, With respect to their type and length then you can just use = or MOVE.

MOVE-CORRESPONDING should be used only when you want to move the data based on field names.

The performance of MOVE Is better than MOVE-CORRESPONDING since here you dont compare the field names but just do a byte/char sequence copy.

Regards,

Sesh

Read only

Former Member
0 Likes
1,284

Hi,

Don’t use Move-corresponding statements normally because it affects the performance, so it is better to avoid this statement whenever possible.

Anyway you have only 10 fields so that you can use the 'move' statement for each field instead of Move-corresponding statement.

Regards,

Vijay