‎2009 Jun 25 7:47 AM
Is there a class for producing a sequence of evenly distributed non-reproducible random integers? I'm on a 7.00 system.
-- Sebastian
‎2009 Jun 25 7:50 AM
‎2009 Jun 25 7:50 AM
‎2009 Jun 25 7:58 AM
The answer is yes:
DATA:
lv_seed TYPE i,
lo_prng TYPE REF TO cl_abap_random_int,
lv_rnd TYPE i.
" Get a random seed to make the sequence non-reproducible
lv_seed = cl_abap_random=>seed( ).
" compute evenly distributed pseudo random numbers in the interval [0,100]
lo_prng = cl_abap_random_int=>create( seed = lv_seed min = 0 max = 100 ).
DO c_limit TIMES.
lv_rnd = lo_prng->get_next( ).
WRITE: / lv_rnd.
ENDDO.
Sorry for posting prematurely.
-- Sebastian