‎2006 Sep 19 9:54 PM
Hi Group,
I used FM RANDOM_I2 in my report to generate two digit (from 1 to 100) unique number, when I execute this for the first time it generate 5 ,when I run for second time
still it is showing 5.Can any body tell me why it is giving the same numebr when I generated for the second time.
‎2006 Sep 19 10:01 PM
Hello Swabap
The FM documentation says that before calling the function module you should call RANDOM_INITIALIZE (probably to initialize some buffers).
Regards
Uwe
‎2006 Sep 19 10:03 PM
Hi,
IF you try to call run multiple times for one session it is bringing out random numbers..but if you run only once I think it will bring you the same number..
data: v_output like DATATYPE-INTEGER2.
do 5 times.
CALL FUNCTION 'RANDOM_I2'
IMPORTING
RND_VALUE = v_output
.
write: / v_output.
enddo.
Thanks,
Naren
‎2006 Sep 19 10:10 PM
Hi,
The FM will return you the same value if you run your report second time since field values used by the FM are initialised back. It will give you random numbers only when you use that FM iteratively in the report during single execution. You wont find this difference if you run FM thru SE37 because the field values are not intialised howver if you come out of the SE37 and again then excute FM thru SE37, you will find same numbers generated.
Cheers,
Vikram
Pls reward for helpful replies!!
‎2006 Sep 19 10:34 PM
Hi Vikram,
Thank you for your response,then what is the solution for this.COuld you please help me in solving out this problem