SAP Tutorials Blog


DATA(random_num_switch) = cl_abap_random_int=>create( seed = cl_abap_random=>seed( )

                                                      min  = 1

                                                      max  = 5 )->get_next( ).


DATA(num_switch) = SWITCH #( random_num_switch

                             WHEN 1 THEN `The number is 1.`

                             WHEN 2 THEN `The number is 2.`

                             WHEN 3 OR 4 THEN `The number is either 3 or 4.`

                             ELSE `The number is not between 1 and 4.` ).


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com