<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Function module to generate random number between 0 and 100 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169203#M996730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is I need to generate random number between    0(zero) to 100(one hundred). My input criteria to the function module is 0 (zero) and 100 (One Hundred) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly let me know the function module &amp;lt;removed_by_moderator&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe, I  will get answer for my query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Jul 11, 2008 1:16 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jul 2008 13:09:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-11T13:09:02Z</dc:date>
    <item>
      <title>Function module to generate random number between 0 and 100</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169203#M996730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is I need to generate random number between    0(zero) to 100(one hundred). My input criteria to the function module is 0 (zero) and 100 (One Hundred) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly let me know the function module &amp;lt;removed_by_moderator&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe, I  will get answer for my query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Jul 11, 2008 1:16 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 13:09:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169203#M996730</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T13:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to generate random number between 0 and 100</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169204#M996731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the FM 'RSSM_RANDOM_NUMBER_GET'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ypu can also use the FM 'ISH_RANDOM_NUMBER', pass '2' as exporting parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 13:14:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169204#M996731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T13:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to generate random number between 0 and 100</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169205#M996732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiii!&lt;/P&gt;&lt;P&gt;  The function module, QF05_RANDOM_INTEGER, can be used to generate a random number. Sample program using the function module is shown below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 REPORT zrandom_test.

DATA:
w_num TYPE i.

CALL FUNCTION 'QF05_RANDOM_INTEGER'
EXPORTING
  ran_int_max = 1000
  ran_int_min = 1
IMPORTING
  ran_int = w_num
EXCEPTIONS
  invalid_input = 1
  OTHERS = 2.
IF sy-subrc &amp;lt;&amp;gt; 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

WRITE :/ 'Next available number is: ', w_num.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 13:19:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169205#M996732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T13:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to generate random number between 0 and 100</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169206#M996733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Welcome to SDN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code...&lt;/P&gt;&lt;P&gt;Here you need to input 2 numbers ie the upper limit and the lower limit. This works only for integers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
QF05_RANDOM_INTEGER
--------------------------------------------
Parameters: p_larg like QF00-RAN_INT,
            p_small like QF00-RAN_INT.

Data: d_result like QF00-RAN_INT.

CALL FUNCTION 'QF05_RANDOM_INTEGER'
 EXPORTING
   RAN_INT_MAX         = p_larg
   RAN_INT_MIN         = p_small
 IMPORTING
   RAN_INT             = d_result
 EXCEPTIONS
  INVALID_INPUT       = 1
   OTHERS              = 2
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


Write:/ 'The Number is = ' , d_result.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
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.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link.....&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tips/ABAP/Random.htm" target="test_blank"&gt;http://www.saptechnical.com/Tips/ABAP/Random.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would solve your problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narin Nandivada&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 13:31:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169206#M996733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T13:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to generate random number between 0 and 100</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169207#M996734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 04:47:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169207#M996734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T04:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to generate random number between 0 and 100</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169208#M996735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 04:48:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169208#M996735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T04:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to generate random number between 0 and 100</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169209#M996736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;good function~~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 09:59:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-generate-random-number-between-0-and-100/m-p/4169209#M996736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T09:59:28Z</dc:date>
    </item>
  </channel>
</rss>

