already provided aggregate functions, instead of finding out the minimum/maximum
values using ABAP code.
Maxnu = 0.
Select * from zflight where airln = ‘LF’ and cntry = ‘IN’.
Check zflight-fligh > maxnu.
Maxnu = zflight-fligh.
Select max( fligh ) from zflight into maxnu where airln = ‘LF’ and cntry = ‘IN’.
aggregate functions that can be used are min (to find the minimum value), avg
(to find the average of a Data interval), sum (to add up a data interval) and
count (counting the lines in a data selection).