<?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 Fetching output from internal table based on some count in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981929#M951142</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;I have a requirement like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an internal table with just one row, lets say "orderid". Now in my scenario, I fill this orderid's which can be repeating, like for eg. it can have same orderid n number of times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I also have a requirement like this. I have a condition variable lets say "Count" which will be dynamically passed by the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to fetch all the orderid's from the internal table and store it into a different table which is exactly repeated "Count" number of times. So get all the orderid's from the internal table which is exactly present count times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me if I can do this by writing a select query or by using any other efficient method, if possible with some explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siva.&lt;/P&gt;&lt;P&gt;PS: Points will be rewarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Jun 2008 03:16:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-13T03:16:04Z</dc:date>
    <item>
      <title>Fetching output from internal table based on some count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981929#M951142</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;I have a requirement like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an internal table with just one row, lets say "orderid". Now in my scenario, I fill this orderid's which can be repeating, like for eg. it can have same orderid n number of times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I also have a requirement like this. I have a condition variable lets say "Count" which will be dynamically passed by the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to fetch all the orderid's from the internal table and store it into a different table which is exactly repeated "Count" number of times. So get all the orderid's from the internal table which is exactly present count times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me if I can do this by writing a select query or by using any other efficient method, if possible with some explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siva.&lt;/P&gt;&lt;P&gt;PS: Points will be rewarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 03:16:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981929#M951142</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T03:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching output from internal table based on some count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981930#M951143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi siva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0.&lt;/P&gt;&lt;P&gt; data : project like zmytable-project.&lt;/P&gt;&lt;P&gt; data : cnt   type i.&lt;/P&gt;&lt;P&gt;data : end of itab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Select project count(*) as cnt&lt;/P&gt;&lt;P&gt;from zmytable&lt;/P&gt;&lt;P&gt;into table itab&lt;/P&gt;&lt;P&gt;group by project&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think this will help u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sindhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 03:25:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981930#M951143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T03:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching output from internal table based on some count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981931#M951144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this code, hope this helps&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  count type i.
sort itab by orderid.
loop at itab.
   count = count + 1. 
  at end of orderid.
   if count = p_count
     append itab to temp_itab.
   endif.
   clear count.
  endat.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 03:41:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981931#M951144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T03:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching output from internal table based on some count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981932#M951145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot. Problem solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 05:00:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-output-from-internal-table-based-on-some-count/m-p/3981932#M951145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T05:00:12Z</dc:date>
    </item>
  </channel>
</rss>

