‎2006 Dec 01 9:41 AM
How to most efficient can I symulate Aggregation functions in ABAP?
I know that I can use max min, avg on single field in table, but I need to calculate in program, this values but not on a single field but on expression e.g:
max(kolumn1 - kolumn2 + kolumn3 / kolumn 4) and so one...
Or I miss something in documentation?
‎2006 Dec 01 9:54 AM
‎2006 Dec 01 9:46 AM
hi,
exceute the program RSHOWTIM to see more details.
regards
Sandeep.
‎2006 Dec 01 9:53 AM
chk these programs
DEMO_DATA_CALCULATE
and checkout for DEMO* programs in SE38
‎2006 Dec 01 9:54 AM
‎2006 Dec 01 11:55 AM
max(kolumn1 - kolumn2 + kolumn3 / kolumn 4)
It is not possible to achieve the above result via just a SELECT statement you would need to capture the data into internal table and get the result.
SELECT key sum(kolumn1) sum(kolumn2) sum(kolumn3) sum(kolumn4)
into table itab
from ztable
where key in so_key
group by key.
Loop at itab.
lval = itab-kolumn3 / itab-kolumn 4.
lval = kolumn1 - kolumn2 + lval.
if lmax <= lval.
lkey = itab-key.
lmax = lval.
endif.
endloop.
‎2006 Dec 01 12:05 PM