Skip to Content
1

Why ABAP 7.4 syntax is reducing the Performance?

Jul 06, 2017 at 02:33 PM

143

avatar image

Hello,

I am using ABAP 7.4 syntax to test whether it improves the performance or not. But in SE30, I found that using ABAP 7.4, it reduces the performance. So, should I use ABAP 7.4 syntax? or am I doing something wrong?

For example, I have used a loop for summation of a field. Check the below syntax:

ABAP7.4 is taking more time. See the SE30 report analysis:

Similarly, for every other scenario like copying the value of a field of an internal table into another, reading an internal table into a work area, ABAP 7.4 is taking more time.

Please help!!

capture0.png (9.1 kB)
capture1.png (4.7 kB)
capture2.jpg (89.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
David Lapointe Jul 06, 2017 at 03:07 PM
2

Could you try to change from this

data(lsum) = REDUCE i( init x = 0 for wa in gt_tab1 next x = x + wa-wkurs ).

to

data(lsum) = REDUCE i( init x = 0 for <wa> in gt_tab1 next x = x + <wa>-wkurs ).

In your loop, you are using field symbols while in the reduce case, you seems to use a work area. That would results in data copy which may be the reason you lose performance.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Thanks David.

Now, it is working as expected.

0

Note that according to your results, with 7.4, REDUCE is considerably faster than LOOP AT with work area.

Please share the other new syntax commands you've used. It will be interesting to see. And when we've reviewed them - you can write a blog with your findings.

1

"considerably faster" = 2% faster (results with field symbols).

The difference of performance with work areas is suspicious, so please share your code (by the way, with a work area, the results may considerably vary based on the size of lines of your internal table, for instance if your lines only contain WKURS, versus lines containing big internal tables, etc.)

2

I've edited my response to say what I meant - I really was only referring to the work area one. :-) But that's a good point - it is suspicious.

1
Horst Keller
Jul 06, 2017 at 02:51 PM
1

How often did you measure? Did you measure a large number of executions in a loop?

From looking at the screenshot I'd say, they use the same time.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

I have tested the result for approximate 14k records and there is always a difference of around 10 - 20 micro seconds.

0

So a loss of 1 to 3 %. That would be nice if the performance issues were only limited to that. Usually, the biggest issues in ABAP programs come from the database, and the unit is in minutes and even hours in worst cases. Don't lose too much time for saving a few milliseconds.

0