‎2009 Dec 23 8:30 AM
hi.
DATA: RANDOM TYPE REF TO CL_ABAP_RANDOM.
i am gettin error: CL_ABAP_RANDOM is unknown.
do you know how i should declare this?
‎2009 Dec 23 8:36 AM
Please check
and also check in Se24 whether above class available ?
a®s
Edited by: a®s on Dec 23, 2009 3:44 AM
‎2009 Dec 23 8:36 AM
Please check
and also check in Se24 whether above class available ?
a®s
Edited by: a®s on Dec 23, 2009 3:44 AM
‎2009 Dec 23 8:57 AM
Hi,
although it uses cl_abap_random_int instead of CL_ABAP_RANDOM maybe you can use something like this:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b824c11b-0701-0010-738f-e76dc3d29925
Best regards.
Edited by: Pablo Casamayor on Dec 23, 2009 9:58 AM
‎2009 Dec 23 10:04 AM
Hi,
If you want to generate random number, you can also use the FM
RANDOM_P
regards,
amit m.
‎2009 Dec 23 12:35 PM
Use function RANDOM_P . Objects doesn't work in all SAP versions
‎2009 Dec 23 1:43 PM
If its a requirement of generating random number
User fm GENERAL_GET_RANDOM_INT
‎2010 Mar 05 3:34 PM
Hi.. instead of using
DATA: RANDOM TYPE REF TO CL_ABAP_RANDOM.
and calling the CREATE and GET_NEXT methods,
you could just declare a few integers and use the function `QF05_RANDOM_INTEGER` as following:
call function 'QF05_RANDOM_INTEGER'
exporting
RAN_INT_MIN = 1
RAN_INT_MAX = max_rnd
importing
RAN_INT = rnd_no.
this will result in `rnd_no` holding the random number...
Regards,
Prasanna K Rao
‎2010 Mar 05 4:22 PM
‎2010 Mar 05 5:33 PM
Hi,
What release are you on?
CL_ABAP_RANDOM only exists as of Basis 7.0. It is not there in 4.6 and Basis 6.x. If you run one of those older releases search for function modules in SE37. The easiest ones to use are the RANDOM_* ones, but curiously enough those belong to Financial Accounting, so you'll find them in an R3 / ERP system but not in others.
Regards,
Mark