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: 

Why ABAP 7.4 syntax is reducing the Performance?

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!!

1 ACCEPTED SOLUTION

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.

9 REPLIES 9

horst_keller
Product and Topic Expert
Product and Topic Expert

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.

0 Kudos

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

0 Kudos

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.

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.

0 Kudos

Thanks David.

Now, it is working as expected.

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.

"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.)

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.

Former Member
0 Kudos

Those old and new who have learnt old school ABAP and stick to it will come up with such excuses.