04-18-2009 12:43 PM
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 ?
04-18-2009 1:11 PM
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..
04-18-2009 12:53 PM
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
04-18-2009 12:57 PM
I need to know whether are there any difference in performance when used?
04-18-2009 1:04 PM
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 =.
04-18-2009 1:11 PM
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..
04-18-2009 5:07 PM
> I need to know whether are there any difference in performance when used?
no, you don't need that
performance is spent somewhere else.
04-18-2009 10:11 PM
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.
04-20-2009 8:29 AM
The biggest performance hazard is thinking about such issues instead of more important ones.
Thomas
04-22-2009 10:30 PM
>
> 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
04-20-2009 12:40 PM
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?
04-20-2009 12:56 PM
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
04-20-2009 1:04 PM
04-20-2009 8:28 PM
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
04-22-2009 10:00 AM
04-22-2009 11:40 AM
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.
04-22-2009 12:17 PM
Dear Mahender,
i would love to see your testcase and runtime figures
that proves your statement. Could you post that please?
Kind regards,
Hermann
04-23-2009 1:17 PM
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
04-23-2009 2:23 PM
>
> 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.