With SORT
IF your_table IS NOT INITIAL.
SORT your_table BY your_field DESCENDING.
" Get row with max value :
ls_row_with_max_value = your_table[ 1 ].
" Get max value :
lv_max_value = your_table[ 1 ]-your_field.
ENDIF.
With REDUCE :
" Get row with max value :
DATA(ls_row_max) = REDUCE ts_row( INIT ls_max = VALUE #( )
FOR ls_row IN lt_table
NEXT ls_max = COND #(
WHEN ls_row-count > ls_max-count
THEN ls_row
ELSE ls_max )
).
About the author