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 and "=" Difference

former_member185181
Active Contributor
0 Kudos

HI ,

Can anyone tell me what exactly is the difference between MOVE statement and "=" operator in ABAP. Are there any performance based issues in using these 2 syntax ? Which one is efficient when used in routines ?

1 ACCEPTED SOLUTION

former_member230674
Contributor

Hi,

There is no difference between "=" and MOVE operation in functionality.

There is no difference in performance also.but by using MOVE statement, it is not possible specify dynamic varaibles like field symbols in assignments.

by

Prasad gvk..

17 REPLIES 17

Former Member
0 Kudos

Hi,

As of my knowledge there is no difference between both the assignments..for more info refer to this link..

http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb3260358411d1829f0000e829fbfe/content.htm

0 Kudos

I need to know whether are there any difference in performance when used?

0 Kudos

HI,

I don't think so there would be any performance issue in using the MOVE and = assignments.

But MOVE-CORRESPONDING can cause little bit performance issue..instead of using this statement..move fields individually using MOVE or =.

former_member230674
Contributor

Hi,

There is no difference between "=" and MOVE operation in functionality.

There is no difference in performance also.but by using MOVE statement, it is not possible specify dynamic varaibles like field symbols in assignments.

by

Prasad gvk..

former_member194613
Active Contributor
0 Kudos

> I need to know whether are there any difference in performance when used?

no, you don't need that

performance is spent somewhere else.

former_member156446
Active Contributor
0 Kudos

what max can you do with move?

send one value in a variable to another.... I doubt if that's some thing to me worried of performance.

I am not a big geek though >>> move will give the memory allocated to another variable or change the address of the memory ( in the core )

= will do the same.

ThomasZloch
Active Contributor
0 Kudos

The biggest performance hazard is thinking about such issues instead of more important ones.

Thomas

0 Kudos

>

> The biggest performance hazard is thinking about such issues instead of more important ones.

> Thomas

True, but just to put it to rest:

REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

DATA: start   TYPE i,
      end     TYPE i,
      dif     TYPE i,

      f1(26).

DO 10 TIMES.
  GET RUN TIME FIELD start.
  DO 10000 TIMES.
    MOVE sy-abcde TO f1.
  ENDDO.
  GET RUN TIME FIELD end.
  dif = end - start.
  WRITE: /001 'Time for MOVE', dif, 'microseconds'.

  GET RUN TIME FIELD start.
  DO 10000 TIMES.
    f1 = sy-abcde.
  ENDDO.
  GET RUN TIME FIELD end.
  dif = end - start.
  WRITE: /001 'Time for =   ', dif, 'microseconds'.
  SKIP.
ENDDO.

Rob

former_member194613
Active Contributor
0 Kudos

lets say it the other way, if there is relevant difference in the most basic statement of

all, what differences would you expect in all other statements?

former_member181962
Active Contributor
0 Kudos

Hi Ananda,

There is no difference in performance .

To know it yourself, you can go to SE30 transaction.

Click on Tips and Tricks.

Compare the following code:

data v_test(1) type c.
do 1000 times.
move '1' to v_test.
enddo.

and

data v_test(1) type c.
do 1000 times.
v_test = '1'.
enddo.

Click on Measure runtime.

I have found there is no difference in runtimes.

But why is it there then?

One feature of a good programming language is "Readability" (Otherwise all the programming could as well be done in ASSEMBLY level coding)

Obviuosly MOVE is more readable than "="

Regards,

Ravi Kanth Talagana

0 Kudos

Thanks guys

former_member194613
Active Contributor
0 Kudos

Obviuosly MOVE is more readable than "="

that is obviously a matter of taste I never use MOVE.

many ABAP features are very old and come from R2 times.

Siegfried

Former Member
0 Kudos

Hi,

"=" is much faster than Move statement.

0 Kudos

Of course, it's only one character compared to six for the "MOVE ... TO ..." construct, this translates roughly into a 500% performance gain.

The previous statement was meant ironically.

0 Kudos

Dear Mahender,

i would love to see your testcase and runtime figures

that proves your statement. Could you post that please?

Kind regards,

Hermann

Former Member
0 Kudos

Hi Ananda / All guys,

Very interesting topic is being discussed.

I too did not noticed any differences in performance of using move v/s = , and most of the time

we use move statement as it can been easily read and understood.

I any more information is there please post.

Thanks,

Vengalrao

matt
Active Contributor
0 Kudos

>

> Hi Ananda / All guys,

> Very interesting topic is being discussed.

Not really - it's posted about once a month. Next month, you can watch the one about MOVE-CORRESPONDING.