<?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 Re: Select records Randomly in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468989#M1252602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try FM  'RANDOM_TABLE_ENTRY'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTEST.&lt;/P&gt;&lt;P&gt;TABLES: marc.&lt;/P&gt;&lt;P&gt;DATA: str TYPE matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 10 TIMES.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RANDOM_TABLE_ENTRY'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      table                   = 'MARC'&lt;/P&gt;&lt;P&gt;     item1                   = 'MATNR'           &amp;lt;---- Field1&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ITEM2                   =                        &amp;lt;---- Field2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ITEM3                   =                        &amp;lt;---- Field3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ITEM4                   =                        &amp;lt;---- Field4&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;P&gt;     value1                  = str                   &amp;lt;---- Field1 Value&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VALUE2                  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VALUE3                  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VALUE4                  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TABLESIZE               =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TABLEPOS                =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   GENERATION_FAILED       = 1&lt;/P&gt;&lt;P&gt;   OTHERS                  = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / str.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sap Fan on Apr 14, 2009 7:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Apr 2009 05:12:49 GMT</pubDate>
    <dc:creator>awin_prabhu</dc:creator>
    <dc:date>2009-04-14T05:12:49Z</dc:date>
    <item>
      <title>Select records Randomly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468986#M1252599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a internal table with 1000 records, I would like to select 50 records randomly from the 1000 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any better way, for this logic. Please let me know .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Prasead&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2009 05:05:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468986#M1252599</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-14T05:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select records Randomly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468987#M1252600</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;What is the purpose of selecting records randomly ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this FM gives the random number QF05_RANDOM_INTEGER&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2009 05:08:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468987#M1252600</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-14T05:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select records Randomly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468988#M1252601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Limit the Select query with &lt;STRONG&gt;UPTO 50 ROWS&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2009 05:12:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468988#M1252601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-14T05:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select records Randomly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468989#M1252602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try FM  'RANDOM_TABLE_ENTRY'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTEST.&lt;/P&gt;&lt;P&gt;TABLES: marc.&lt;/P&gt;&lt;P&gt;DATA: str TYPE matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 10 TIMES.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RANDOM_TABLE_ENTRY'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      table                   = 'MARC'&lt;/P&gt;&lt;P&gt;     item1                   = 'MATNR'           &amp;lt;---- Field1&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ITEM2                   =                        &amp;lt;---- Field2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ITEM3                   =                        &amp;lt;---- Field3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ITEM4                   =                        &amp;lt;---- Field4&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;P&gt;     value1                  = str                   &amp;lt;---- Field1 Value&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VALUE2                  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VALUE3                  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VALUE4                  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TABLESIZE               =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TABLEPOS                =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   GENERATION_FAILED       = 1&lt;/P&gt;&lt;P&gt;   OTHERS                  = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / str.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sap Fan on Apr 14, 2009 7:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2009 05:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468989#M1252602</guid>
      <dc:creator>awin_prabhu</dc:creator>
      <dc:date>2009-04-14T05:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select records Randomly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468990#M1252603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;check this out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Structure RESERVELNS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Number of reserved rows for event print_end_of_page. If no number is specified, the text specified there is overwritten by the list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2009 05:19:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468990#M1252603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-14T05:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select records Randomly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468991#M1252604</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;You can use FM:  'QF05_RANDOM_INTEGER'  to get the random records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chris Gu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2009 05:26:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468991#M1252604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-14T05:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select records Randomly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468992#M1252605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: MAX TYPE I,          
      RND TYPE I.
PARAMETERS: SAMPLE TYPE I.        " to decide on number of entries can hard code on requirement
DESCRIBE TABLE ITAB LINES MAX.    " to get the max number of entries in table

DO SAMPLE TIMES.
  CALL FUNCTION 'QF05_RANDOM_INTEGER' 
    EXPORTING 
     RAN_INT_MAX = MAX
     RAN_INT_MIN = 1 
    IMPORTING 
     RAN_INT = RND                " Here you get a random integer
    EXCEPTIONS 
     INVALID_INPUT = 1 
     OTHERS = 2.
  READ TABLE ITAB INDEX RND.      " Use RND as index and read that entry.
  WRITE:/ ITAB-FIELD.             " This is the random entry you can place it in a new internal table
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2009 05:46:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468992#M1252605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-14T05:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Select records Randomly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468993#M1252606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;worked out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 01:32:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-records-randomly/m-p/5468993#M1252606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T01:32:45Z</dc:date>
    </item>
  </channel>
</rss>

