SAP ABAP Class CL_ABAP_RANDOM (Pseudo Random Number Generator)
Hierarchy
☛
SAP_BASIS (Software Component) SAP Basis Component
⤷
BC-ABA-LA (Application Component) Syntax, Compiler, Runtime
⤷
SABP_RANDOM (Package) Random Number Generator
⤷
⤷
Meta Relationship - Using
| # | Relationship type | Using | Short Description | Created on |
|---|---|---|---|---|
| 1 | Interface implementation (CLASS c. INTERFACES i_ref) | IF_SERIALIZABLE_OBJECT | Serializable Object | 20030709 |
Properties
| Class | CL_ABAP_RANDOM | |
| Short Description | Pseudo Random Number Generator | |
| Super Class | ||
| Instantiability of a Class | 0 | Private |
| Final |
General Data
| Message Class | ||
| Program status | S | System Program |
| Category | 0 | |
| Package | SABP_RANDOM | Random Number Generator |
| Created | 20030701 | SAP |
| Last change | 20130531 | SAP |
| Shared Memory-enabled | ||
| Fixed point arithmetic | ||
| Unicode checks active |
Forward declarations
| # | Type group / Object type | Type | Type Description |
|---|---|---|---|
| 1 | Type group use (TYPE-POOLS tp) | Type group use (TYPE-POOLS tp) | |
| 2 | Forward declaration class (CLASS c DEFINITION DEFERRED) | Forward declaration class (CLASS c DEFINITION DEFERRED) |
Interfaces
| # | Interface | Abstract | Final | Description | Created on |
|---|---|---|---|---|---|
| 1 | IF_SERIALIZABLE_OBJECT | Serializable Object | 20030709 |
Friends
Class CL_ABAP_RANDOM has no friend class.
Attributes
| # | Attribute | Level | Visibility | Read only | Typing | Associated Type | Initial Value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Constant | Private | Type reference (TYPE) | ABAP_BOOL | SPACE | FALSE | 20030714 | ||
| 2 | Instance attribute | Protected | Type reference (TYPE) | I | Flag: State Computed | 20030701 | |||
| 3 | Instance attribute | Protected | Type reference (TYPE) | I | 1 | Number of Left States | 20030701 | ||
| 4 | Instance attribute | Protected | Type reference (TYPE) | %_C_POINTER | Kernel: Pointer to Next State | 20030701 | |||
| 5 | Instance attribute | Protected | Type reference (TYPE) | ABAP_PRNG_STATE | PRNG State Array | 20030701 | |||
| 6 | Constant | Private | Type reference (TYPE) | ABAP_BOOL | 'X' | TRUE | 20030714 |
Methods
| # | Method | Level | Visibility | Method type | Description | Created on |
|---|---|---|---|---|---|---|
| 1 | Static method | Public | Method | Factory | 20030701 | |
| 2 | Static method | Private | Method | Factory for Standard Test PRNG | 20030701 | |
| 3 | Instance method | Public | Method | Compute a packed RN of type decfloat16 | 20080904 | |
| 4 | Instance method | Public | Method | Compute a packed RN of type decfloat34 | 20080904 | |
| 5 | Instance method | Public | Method | Compute a Floating Point RN in [0,1) | 20030701 | |
| 6 | Instance method | Private | Method | Initialise a PRNG (Compute State Array) | 20030701 | |
| 7 | Instance method | Public | Method | Compute a Signed Integer RN | 20030701 | |
| 8 | Instance method | Public | Method | Compute a 31 Bit Integer RN (i.e. 0 <= Value <= 0x7FFFFFFF) | 20030701 | |
| 9 | Instance method | Public | Method | Compute a Random Integer RN in [a,b] | 20030701 | |
| 10 | Instance method | Public | Method | Compute a Packed RN (31 Digits, No Decimals) | 20030702 | |
| 11 | Instance method | Public | Method | Compute a Packed RN in [a,b] (31 Digits, No Decimals) | 20030702 | |
| 12 | Static method | Public | Method | Compute a Random Seed (Integer) | 20030701 | |
| 13 | Instance method | Protected | Method | Special Initialization for Standard Test | 20030701 |
Events
Class CL_ABAP_RANDOM has no event.
Types
| # | Type | Visibility | Typing | Associated Type | Description | Created on | Type Source |
|---|---|---|---|---|---|---|---|
| 1 | ABAP_PRNG_STATE | Protected | See coding | 20030701 | |
||
| 2 | P31_0 | Public | See coding | 20030702 | P31_0 type p length 16 decimals 0
|
Method Signatures
Method CREATE Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | PRNG | Value transfer | Object reference (TYPE REF TO) | CL_ABAP_RANDOM | PRNG Instanz | 20030701 | |||
| 2 | SEED | Call by reference | Type reference (TYPE) | I | Startwert für PRNG | 20030701 |
Method CREATE on class CL_ABAP_RANDOM has no exception.
Method CREATE_TESTER Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | PRNG | Value transfer | Object reference (TYPE REF TO) | CL_ABAP_RANDOM | PRNG Instanz | 20030701 |
Method CREATE_TESTER on class CL_ABAP_RANDOM has no exception.
Method DECFLOAT16 Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | VALUE | Value transfer | Type reference (TYPE) | DECFLOAT16 | 20080904 |
Method DECFLOAT16 on class CL_ABAP_RANDOM has no exception.
Method DECFLOAT34 Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | VALUE | Value transfer | Type reference (TYPE) | DECFLOAT34 | 20080904 |
Method DECFLOAT34 on class CL_ABAP_RANDOM has no exception.
Method FLOAT Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | VALUE | Value transfer | Type reference (TYPE) | F | pseudo random FP number | 20030701 |
Method FLOAT on class CL_ABAP_RANDOM has no exception.
Method INITPRNG Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | SEED | Call by reference | Type reference (TYPE) | I | PRNG's start value | 20030701 |
Method INITPRNG on class CL_ABAP_RANDOM has no exception.
Method INT Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | VALUE | Value transfer | Type reference (TYPE) | I | pseudo random integer number | 20030701 |
Method INT on class CL_ABAP_RANDOM has no exception.
Method INT31 Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | VALUE | Value transfer | Type reference (TYPE) | I | pseudo random integer number | 20030701 |
Method INT31 on class CL_ABAP_RANDOM has no exception.
Method INTINRANGE Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | HIGH | Call by reference | Type reference (TYPE) | I | 0 | upper bound of interval | 20030701 | ||
| 2 | LOW | Call by reference | Type reference (TYPE) | I | 0 | lower bound of interval | 20030701 | ||
| 3 | VALUE | Value transfer | Type reference (TYPE) | I | random number's value | 20030701 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Exception for CL_ABAP_RANDOM* | 20040708 |
Method PACKED Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | VALUE | Value transfer | Type reference (TYPE) | P31_0 | 20030702 |
Method PACKED on class CL_ABAP_RANDOM has no exception.
Method PACKEDINRANGE Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | MAX | Call by reference | Type reference (TYPE) | P31_0 | '9999999999999999999999999999999' | upper bound of range | 20030702 | ||
| 2 | MIN | Call by reference | Type reference (TYPE) | P31_0 | '-9999999999999999999999999999999' | lower bound of range | 20030702 | ||
| 3 | VALUE | Value transfer | Type reference (TYPE) | P31_0 | generated packed RN | 20030702 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Exception for CL_ABAP_RANDOM* | 20030714 |
Method SEED Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | SEED | Value transfer | Type reference (TYPE) | I | random seed value | 20030701 |
Method SEED on class CL_ABAP_RANDOM has no exception.
Method TESTINIT Signature
Method TESTINIT on class CL_ABAP_RANDOM has no parameter.
Method TESTINIT on class CL_ABAP_RANDOM has no exception.
History
| Last changed by/on | SAP | 20130531 |
| SAP Release Created in | 640 |