In the development world, time matters. Too often we focus on development time rather than program runtime. Deadlines certainly matter, but if your program performs so poorly that it’s unusable, the project will be a failure. This week’s tip will help you extract column totals from internal tables in a more efficient manner.
For years, ABAPers were required to loop through internal tables and use the SUM operator to get column totals. Starting with ABAP 7.40 SP08, a new operator called REDUCE was added.
The setup:
I created an internal table of student names and grades. You can do this however you’d like – I used another new ABAP 7.40 trick – the FOR loop. |