ABAP operator MIN & MAX

ABAP operator MIN & MAX

Use statements NMIN and NMAX.
⚠️ Maximum 9 values can be passed : val1, val2… val9.


    DATA : lv_nb1 VALUE 25,
           lv_nb2 VALUE 50,
           lv_nb3 VALUE 100.

    DATA(lv_nb_max) = nmax( val1 = lv_nb1
                            val2 = lv_nb2
                            val2 = lv_nb3 ).

    DATA(lv_nb_min) = nmin( val1 = lv_nb1
                            val2 = lv_nb2
                            val2 = lv_nb3 ).

    " ==> LV_MAX = 100
    " ==> LV_MIN = 25

Search tag: maximum minimum

About the author

fjourneau administrator

Hi, I'm Florian Journeau, SAP ABAP R3 Freelance, based in Toulouse, France. You want to know more about me, have a look on my CV : cv.fjourneau.net.

Leave a Reply