<?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 statement with skip count &amp; row count in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011139#M1496697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I need this kind of select query because all the data generated in rfc called through web. and at web ui only first 10 are displayed.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you have a table with a simple primary key (i.e. only one key field), which is the case for E070 you can simply use something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select * from E070 into table e070_tab up to ROW_LIMIT rows
         where TRKORR &amp;gt; TRKORR_PREV
         order by primary key.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I.e. all you need to do in your RFC is to pass the number of entries you want to get via parameter ROW_LIMIT and fill the value TRKORR_PREV with the highest value you previously read. This way you can nicely paginate through the data. One could generalize this also for multiple key fields, but this is more difficult and would have to account for some possible overlap...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Most of the people are happy with first 10 records then why i should bring 100 records for those users who don't even see it. Moreover it makes session size big.. leading to performance issues..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Though I can understand the general need for using a clean approach for pagination, I'm irritated with your statement given table E070 along with 10 rows. When I add all field lengths for E070 I get &lt;EM&gt;82 bytes&lt;/EM&gt; and even with some overhead for the used data structure storing this information, I kind of wonder if your table/numbers are just an example or you're dealing with some highly tuned application. For example a web dynpro session usually consumes a couple of megabytes and that's just due to the overhead of the framework without considering any specific application data...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd expect though that performance is also accounting for response time (that's what the users are usually interested in) and in that case getting 10 entries and then having to do another RFC call seems also not ideal. I can see that you don't want to retrieve all data if that set is large, but I'd expect that your web app does some buffering to allow faster pagination (balance between memory requirements and response time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Jun 2010 06:39:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-19T06:39:10Z</dc:date>
    <item>
      <title>Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011130#M1496688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to write a select statement in abap which should be like&lt;/P&gt;&lt;P&gt;select *  from e070 into table t_output limit 10 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with this I mean to say is that get me 10 rows from the r3 where the ten rows are the 2nd half, like get 20 rows skip first 10 rows and send me the left ten rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 07:47:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011130#M1496688</guid>
      <dc:creator>anand_sagarsethi</dc:creator>
      <dc:date>2010-06-18T07:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011131#M1496689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to know how i can write the statement in abap..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 07:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011131#M1496689</guid>
      <dc:creator>anand_sagarsethi</dc:creator>
      <dc:date>2010-06-18T07:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011132#M1496690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No possible.&lt;/P&gt;&lt;P&gt;Only select into internal table and manipulations with this table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 08:05:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011132#M1496690</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-18T08:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011133#M1496691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anand,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;           We can't achive with select statement but with internal table we can&lt;/P&gt;&lt;P&gt;           try this code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM E070 INTO TABLE IT_E070 UP TO 100 ROWS.

LOOP AT IT_E070 FROM 10 TO 20.
WRITE : / IT_E070-TRKORR.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this may help u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 10:37:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011133#M1496691</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-18T10:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011134#M1496692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply: I need this kind of select query because all the data generated in rfc called through web. and at web ui only  first 10 are displayed. Most of the people are happy with first 10 records then why i should bring 100 records for those users who dont even see it. Moreover it makes session size big.. leading to performance issues.. Any suggestion.. abt how to solve this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 11:08:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011134#M1496692</guid>
      <dc:creator>anand_sagarsethi</dc:creator>
      <dc:date>2010-06-18T11:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011135#M1496693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply: I need this kind of select query because all the data generated in rfc called through web. and at web ui only  first 10 are displayed. Most of the people are happy with first 10 records then why i should bring 100 records for those users who dont even see it. Moreover it makes session size big.. leading to performance issues.. Any suggestion.. abt how to solve this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 11:09:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011135#M1496693</guid>
      <dc:creator>anand_sagarsethi</dc:creator>
      <dc:date>2010-06-18T11:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011136#M1496694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  If u want only first 10 rows then u can try with this select statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM E070 INTO TABLE IT_E070 UP TO 10 ROWS&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i guess this will help u&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 11:17:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011136#M1496694</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-18T11:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011137#M1496695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to select 20 rows, using a UP TO 20 ROWS in the select statement, then delete the first 10 rows of the internal table. Also, as you don't give any ORDER BY clause, the result is theorically unpredictable (optimizer choice, and buffering effect can arise) &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * INTO TABLE t_output FROM e070 UP TO 20 ROWS ORDER BY PRIMARY KEY.
DELETE t_output FROM 1 TO 10.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 11:48:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011137#M1496695</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2010-06-18T11:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011138#M1496696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the PACKAGE SIZE option of the SELECT statement. Make your PACKAGE SIZE 10 and ignore the first set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 13:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011138#M1496696</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-18T13:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011139#M1496697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I need this kind of select query because all the data generated in rfc called through web. and at web ui only first 10 are displayed.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you have a table with a simple primary key (i.e. only one key field), which is the case for E070 you can simply use something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select * from E070 into table e070_tab up to ROW_LIMIT rows
         where TRKORR &amp;gt; TRKORR_PREV
         order by primary key.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I.e. all you need to do in your RFC is to pass the number of entries you want to get via parameter ROW_LIMIT and fill the value TRKORR_PREV with the highest value you previously read. This way you can nicely paginate through the data. One could generalize this also for multiple key fields, but this is more difficult and would have to account for some possible overlap...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Most of the people are happy with first 10 records then why i should bring 100 records for those users who don't even see it. Moreover it makes session size big.. leading to performance issues..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Though I can understand the general need for using a clean approach for pagination, I'm irritated with your statement given table E070 along with 10 rows. When I add all field lengths for E070 I get &lt;EM&gt;82 bytes&lt;/EM&gt; and even with some overhead for the used data structure storing this information, I kind of wonder if your table/numbers are just an example or you're dealing with some highly tuned application. For example a web dynpro session usually consumes a couple of megabytes and that's just due to the overhead of the framework without considering any specific application data...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd expect though that performance is also accounting for response time (that's what the users are usually interested in) and in that case getting 10 entries and then having to do another RFC call seems also not ideal. I can see that you don't want to retrieve all data if that set is large, but I'd expect that your web app does some buffering to allow faster pagination (balance between memory requirements and response time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jun 2010 06:39:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011139#M1496697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-19T06:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with skip count &amp; row count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011140#M1496698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gr8 reply!!!!!   Harald Boeing    Appreciated..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this can work..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jun 2010 12:35:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-skip-count-row-count/m-p/7011140#M1496698</guid>
      <dc:creator>anand_sagarsethi</dc:creator>
      <dc:date>2010-06-19T12:35:29Z</dc:date>
    </item>
  </channel>
</rss>

