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

Why ABAP 7.4 syntax is reducing the Performance?

Former Member
6,987

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
Read only

5,265

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.

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

9 REPLIES 9
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
5,265

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.

Read only

0 Likes
5,265

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

Read only

0 Likes
5,265

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.

Read only

5,266

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.

Read only

0 Likes
5,265

Thanks David.

Now, it is working as expected.

Read only

5,265

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.

Read only

5,265

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

Read only

5,265

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.

Read only

Former Member
0 Likes
5,265

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