2000 404: Page not found

Page not found.

The page you were trying to reach at this address doesn't seem to exist. This is usually the result of a bad or outdated link. We apologize for any inconvenience.

What can I do now?

If this is your first time visiting TechTarget, welcome! Sorry for the circumstances under which we're meeting. Here's where you can go from here:

  • Check out the latest news.
  • Our home page contains the latest information on SAP administration / development.
  • Our about page contains more information about the site you are on, SearchSAP.
  • If you need to, please contact us, we would love to hear from you.

-ADS BY GOOGLE

SearchERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchContentManagement

SearchHRSoftware

Close
c1 0 HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=527B1323FEA87DC44C6EC3B3E19AFB35; Path=/; HttpOnly Set-Cookie: cc=1; Path=/ Set-Cookie: tt_gm=1075602; Domain=techtarget.com; Path=/ Content-Type: text/html;charset=UTF-8 Content-Language: en Transfer-Encoding: chunked Date: Thu, 23 Jan 2020 22:30:50 GMT 2000 How to generate a random number for a given number range
Problem solve Get help with specific problems with your technologies, process and projects.

How to generate a random number for a given number range

Use a function module to find a random number within a given range. Read this tip to find out more.

Function Module QF05_RANDOM_INTEGER can give a random number for a given minimum and maximum values. Study the code below:
 

REPORT ZRANDOM.

DATA RANINT LIKE QF00-RAN_INT.

PARAMETERS: P_MAX LIKE QF00-RAN_INT DEFAULT 100,

P_MIN LIKE QF00-RAN_INT DEFAULT 1,

P_TIMES TYPE I DEFAULT 10.

WRITE:/ 'RANDOM NUMBER'.

ULINE.

DO P_TIMES TIMES.

CALL FUNCTION 'QF05_RANDOM_INTEGER'
EXPORTING
  RAN_INT_MAX   = P_MAX
  RAN_INT_MIN   = P_MIN
IMPORTING
  RAN_INT       = RANINT
EXCEPTIONS
  INVALID_INPUT = 1
  OTHERS        = 2.

  IF SY-SUBRC EQ 0.
    WRITE:/ RANINT.
  ELSE.
    WRITE:/ 'UNABLE TO GENERATE RANDOM NUMBER'.
  ENDIF.
ENDDO.

Dig Deeper on SAP ABAP

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.