[ABAP] Minimum / Maxium von zwei Zahlen ermitteln

DATA(it_values1) = VALUE int4_table( ( 1 ) ( 2 ) ( 3 ) ).
DATA(it_values2) = VALUE int4_table( ( 1 ) ( 5 ) ( 2 ) ).

DO lines( it_values1 ) TIMES.
  DATA(lv_min) = nmin( val1 = it_values1[ sy-index ] val2 = it_values2[ sy-index ] ).
  DATA(lv_max) = nmax( val1 = it_values1[ sy-index ] val2 = it_values2[ sy-index ] ).
  WRITE: / it_values1[ sy-index ], it_values2[ sy-index ], 'MIN:', lv_min.
  WRITE: / it_values1[ sy-index ], it_values2[ sy-index ], 'MAX:', lv_max.
ENDDO.