Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

random function

Former Member
0 Kudos

hey,

i would like to create test data. for this I would like to

create random prices. In Java we have a function random

wherewhit we are able to create different numbers.

Is there an equivalent in ABAP?

thx

chris

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello

RANDOM_AMOUNT

RANDOM_C

RANDOM_C_BY_SET

RANDOM_F8

RANDOM_I2

RANDOM_I4

RANDOM_INITIALIZE

RANDOM_P

choose approaching

7 REPLIES 7

Former Member
0 Kudos

Hello

RANDOM_AMOUNT

RANDOM_C

RANDOM_C_BY_SET

RANDOM_F8

RANDOM_I2

RANDOM_I4

RANDOM_INITIALIZE

RANDOM_P

choose approaching

0 Kudos

Hello,

are these functions of ABAP Objects?

I'm new to ABAP and just using ABAP without Objects til now.

Would you be so kind to give me an example how to use this?

thx

chris

0 Kudos

Hello

It's functions. For example:

CALL FUNCTION 'RANDOM_AMOUNT'

EXPORTING

RND_MIN = '1'

RND_MAX = '10000000'

VALCURR = 'USD'

IMPORTING

RND_AMOUNT = BETRAG

EXCEPTIONS

OTHERS = 1.

0 Kudos

The I've got an ABAP dump with the message:

The function module "RANDOM_AMOUNT" is called,

but cannot be found in the library.

So could it be, that we need a special add-On to use

the classes of ABAP OO??

0 Kudos

No further hints how to use a random function?

ThomasZloch
Active Contributor
0 Kudos

In OO context check out class CL_ABAP_RANDOM.

Thomas