<?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: Performance issue in select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769981#M1951963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akanksha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you want to by pass buffer. Can you debug and get the clauses which is causing the problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jun 2016 07:43:05 GMT</pubDate>
    <dc:creator>former_member185537</dc:creator>
    <dc:date>2016-06-10T07:43:05Z</dc:date>
    <item>
      <title>Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769978#M1951960</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 written one query to fetch data from SAP which is giving performance issue. Query is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;ROWCOUNT &amp;gt; &lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ROWCOUNT &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;ROWCOUNT + ROWSKIPS&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;outdata_itab&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;line&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;fromClauseString&lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;@&amp;lt;datarow&amp;gt; BYPASSING &lt;SPAN class="L0S52"&gt;BUFFER &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;UP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;@ROWCOUNT &lt;SPAN class="L0S52"&gt;ROWS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;whereClauseString&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CLEAR&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;SY&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;DBCNT &lt;SPAN class="L0S52"&gt;GT &lt;/SPAN&gt;ROWSKIPS&lt;/STRONG&gt;&lt;SPAN class="L0S55"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;DO &lt;/SPAN&gt;numberFields &lt;SPAN class="L0S52"&gt;TIMES&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ASSIGN &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;component &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;index &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;of &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;structure &lt;/SPAN&gt;&amp;lt;datarow&amp;gt; &lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;&amp;lt;datafield&amp;gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataFieldString &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&amp;lt;datafield&amp;gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CONCATENATE &lt;/SPAN&gt;returnRowString &lt;SPAN class="L0S33"&gt;'^~^' &lt;/SPAN&gt;datafieldstring &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDDO&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataline &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;INSERT &lt;/SPAN&gt;dataline &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;data&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="L0S55"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDSELECT&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Everything mentioned in select query is coming dynamically from front end. We have 2 parameters called ROWCOUNT and ROWSKIP based on which data is going to front end. Input for these 2 fields comes in loop from front end. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;If condition mentioned in bold is giving issue when sy-dbcnt is more.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Please help me in finding way to escape this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Akanksha&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2016 12:31:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769978#M1951960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-08T12:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769979#M1951961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi akanksha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the performance is mainly derived by the frontend input given in this case.&lt;/P&gt;&lt;P&gt;Also is there a specific requirement to BYPASS BUFFER ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How big are the tables accessed? Are you selecting by key/index? Those parts can have a major inpact on the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should also take a look at the Topic SQL Injection when you want to use such kind of highly dynamic code in any productive environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/saphelp_nw74/helpdata/de/8f/35de1718944eb8a1462cf6362cc8b8/content.htm" title="https://help.sap.com/saphelp_nw74/helpdata/de/8f/35de1718944eb8a1462cf6362cc8b8/content.htm"&gt; SQL Injection - Secure Programming - SAP Library&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="97330" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content="How to Protect Your ABAP Code Against SQL Injection Attacks" href="https://community.sap.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Markus V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2016 13:18:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769979#M1951961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-08T13:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769980#M1951962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Markus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DB size could be any number (Mostly big tables with millions or billions of records). Sy-DBCNT is giving issue in my query. Is there any other way I can fetch records in batches from tables? Because we can not fetch all records together I think?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correct me if I am wrong!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2016 06:35:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769980#M1951962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-10T06:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769981#M1951963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akanksha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you want to by pass buffer. Can you debug and get the clauses which is causing the problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2016 07:43:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769981#M1951963</guid>
      <dc:creator>former_member185537</dc:creator>
      <dc:date>2016-06-10T07:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769982#M1951964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see the problem, but I've no satisfying solution therefore yet. You want to implement a kind of paging in your front end i.e. you want "page" 2 of your selection result and this are e.g. the rows 10 to 20 of your SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need something like SELECT ... FROM start_row TO end_row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But finally this would not improve the performance, because the database has to walk through the table the same you do it now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently see only one way to improve the performance. You have to analyze the most relevant search fields in your WHERE statement and create fitting indexes at the affected tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2016 09:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769982#M1951964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-10T09:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769983#M1951965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This requirement reminds me of entityset paging in a gateway service ($top &amp;amp; $skip). In which case one has several options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;a. SELECT UP lv_max ROWS.&amp;nbsp; DELETE it_tab TO iv_skip&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;lv_max = $top + $skip&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;b. CURSORS, similar to Open SQL statements above but use OPEN CURSOR, FETCH NEXT CURSOR etc. to control which entries are returned&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;c. Native SQL,&amp;nbsp; CL_SQL_STATEMENT with SELECT LIMIT $top OFFSET $skip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2016 10:15:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769983#M1951965</guid>
      <dc:creator>Patrick_vN</dc:creator>
      <dc:date>2016-06-10T10:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769984#M1951966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Armin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I can not pass field details in where as everything in my query is getting generated dynamically. Thats why stuck here. &lt;SPAN __jive_emoticon_name="sad" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/108/images/emoticons/sad.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything else I can look for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Akanksha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 07:33:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769984#M1951966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-14T07:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769985#M1951967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pras,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem area is If statement :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="font-style: inherit; font-family: inherit; background: transparent;"&gt;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;IF &lt;/SPAN&gt;SY&lt;SPAN class="L0S70" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;-&lt;/SPAN&gt;DBCNT &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;GT &lt;/SPAN&gt;ROWSKIPS&lt;/STRONG&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;DO &lt;/SPAN&gt;numberFields &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;TIMES&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ASSIGN &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;component &lt;/SPAN&gt;sy&lt;SPAN class="L0S70" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;index &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;of &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;structure &lt;/SPAN&gt;&amp;lt;datarow&amp;gt; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;to &lt;/SPAN&gt;&amp;lt;datafield&amp;gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataFieldString &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;= &lt;/SPAN&gt;&amp;lt;datafield&amp;gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;CONCATENATE &lt;/SPAN&gt;returnRowString &lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;'^~^' &lt;/SPAN&gt;datafieldstring &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;INTO &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ENDDO&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataline &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;= &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;INSERT &lt;/SPAN&gt;dataline &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="font-style: inherit; font-family: inherit; background: transparent;"&gt;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ENDIF&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;I found in debug that is it taking hell time to come out of this loop.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;-Akanksha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 07:43:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769985#M1951967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-14T07:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769986#M1951968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't use cursor as query is dynamic. I think option a could be useful in my scenario. as I have Max rows and skip rows options available. But I am unable to use that because I am using @&amp;lt;datarow&amp;gt; as type any. Because output data is also getting generated dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you suggest way out to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Akanksha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 07:45:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769986#M1951968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-14T07:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769987#M1951969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I tried to say: I see no possibility to improve the performance in ABAP in your case. You have only a choice at database level. You can create adequate indexes, if you know that the most people only search for specific fields on specific tables. Additionally you have to keep up to date the statistics of your database to support the optimizer of the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course you can also upgrade your hardware...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 10:21:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769987#M1951969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-14T10:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769988#M1951970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm.. and would splitting the select into two be an option? A first select like you have now that only selects the key values, and a second (with FAE) that gets the non-key field data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 11:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769988#M1951970</guid>
      <dc:creator>Patrick_vN</dc:creator>
      <dc:date>2016-06-14T11:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769989#M1951971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akansksha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With given logic with RowCount and RowSkip i understood it is something related to paging where your front end will display selected records on each page. Say for example..it is displaying 10 records on first page and on second page it is selecting 20 records from database and deleting first 10 records and display only remaining 10 records on second page and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this assumption I think you may take out the logic you have written inside the SELECT and ENDSELCT and try with below approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. SELECT (outdata_itab-line) FROM (fromClauseString) INTO table @&amp;lt;datarow&amp;gt; BYPASSING BUFFER UP TO @ROWCOUNT ROWS WHERE (whereClauseString). &lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Delete records from internal table &amp;lt;datarow&amp;gt; from 1st line to ROWSKIPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. After deleting the internal table just perform DO ENDDO operation.&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;Sid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 12:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769989#M1951971</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-14T12:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769990#M1951972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@&lt;A _jive_internal="true" data-avatarid="-1" data-userid="946814" data-username="sid.shah" href="https://answers.sap.com/people/sid.shah" style="font-weight: bold; font-size: 10.8px; color: #8b8b8b; text-decoration: underline !important; background: #ffffff;"&gt;Siddharth Shah &lt;/A&gt;In step 2 If I delete &amp;lt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;datarow&amp;gt; I will be able to perform Do Endo operation as mentioned below? - &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;DO &lt;/SPAN&gt;numberFields &lt;SPAN class="L0S52"&gt;TIMES&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ASSIGN &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;component &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;index &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;of &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;structure &lt;/SPAN&gt;&amp;lt;datarow&amp;gt; &lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;&amp;lt;datafield&amp;gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataFieldString &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&amp;lt;datafield&amp;gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CONCATENATE &lt;/SPAN&gt;returnRowString &lt;SPAN class="L0S33"&gt;'^~^' &lt;/SPAN&gt;datafieldstring &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDDO&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Also When I tried to change select query as you mentioned it gives error saying "&amp;lt;datarow&amp;gt; is not an internal table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;-Akanksha&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2016 11:41:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769990#M1951972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-07-14T11:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769991#M1951973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akanksha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use 'INTO' and not 'INTO TABLE'. Also please prepare one internal table within SELECT and ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please try below steps with correction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;1. SELECT (outdata_itab-line) FROM (fromClauseString) INTO&amp;nbsp; @&amp;lt;datarow&amp;gt; BYPASSING BUFFER UP TO @ROWCOUNT ROWS WHERE (whereClauseString).&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Prepare internal table based of &amp;lt;datarow&amp;gt; (e.g - IT_DATATAB)&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp; 2. Delete records from internal table IT_DATATAB from 1st line to ROWSKIPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;3. After deleting the internal table just perform DO ENDDO operation. (try with &amp;lt;datarow&amp;gt; or IT_DATATAB ... and see whichever works for you.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;Also whichever solution i am giving is based on my assumption and you might need to change little bit of code as per actual scenario. &lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;Regards,&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;Sid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 13:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769991#M1951973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-07-25T13:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769992#M1951974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siddharth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unable to create internal table based on &amp;lt;datarow&amp;gt; as its getting generated at runtime. Can you suggest something on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field symbol: &amp;lt;datarow&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 10:28:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769992#M1951974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-19T10:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769993#M1951975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To create a data object at runtime, use RTTC (classes cl_abap_*descr and statement CREATE DATA ... TYPE HANDLE object). It's precisely described in the ABAP documentation (runtime type services), and helped many many times in the forum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 13:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769993#M1951975</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-08-19T13:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769994#M1951976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akanksha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer below SDN thread link. Hope it can help you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;A href="https://scn.sap.com/thread/2144362" title="https://scn.sap.com/thread/2144362"&gt;Create Dynamic Structure based on Field-Symbol | SCN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siddharth Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2016 05:49:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769994#M1951976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-22T05:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769995#M1951977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siddharth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think question got little diverted from the main issue. Issue is select query here. Though we pass rowskips every time but this query selects records from 1 to end. For example if rowskip is 2000 then first time its picking 1-2000 records and later 1-4000, 1-6000 and so on. That's the reason for performance. Do Endo is not getting executed every time as it is within IF() condition of DBCount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way that this query doesn't fetch records from beginning? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Akanksha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 08:01:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769995#M1951977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-23T08:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769996#M1951978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;Hi Akanksha,&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;Try with Below code directly in your program. Replace your SELECT - ENDSELECT with below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;IF &lt;/SPAN&gt;ROWCOUNT &amp;gt; &lt;SPAN class="L0S32" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROWCOUNT &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;= &lt;/SPAN&gt;ROWCOUNT + ROWSKIPS&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;(&lt;/SPAN&gt;outdata_itab&lt;SPAN class="L0S70" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;line&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;FROM &lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;(&lt;/SPAN&gt;fromClauseString&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;table &lt;/SPAN&gt;@DATA&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;(&lt;/SPAN&gt;datarow&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;)&lt;/SPAN&gt;BYPASSING &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;BUFFER &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;UP &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;TO &lt;/SPAN&gt;@ROWCOUNT &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ROWS &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;WHERE &lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;(&lt;/SPAN&gt;whereClauseString&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;delete &lt;/SPAN&gt;datarow &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;from &lt;/SPAN&gt;&lt;SPAN class="L0S32" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;1 &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;to &lt;/SPAN&gt;rowskips&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;loop &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;at &lt;/SPAN&gt;datarow &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ASSIGNING &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;FIELD&lt;/SPAN&gt;&lt;SPAN class="L0S70" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;SYMBOL&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;(&lt;/SPAN&gt;&amp;lt;datarow&amp;gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;CLEAR&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;: &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S31" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF SY-DBCNT GT ROWSKIPS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;DO &lt;/SPAN&gt;numberFields &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;TIMES&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ASSIGN &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;component &lt;/SPAN&gt;sy&lt;SPAN class="L0S70" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;index &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;of &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;structure &lt;/SPAN&gt;&amp;lt;datarow&amp;gt; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;to &lt;/SPAN&gt;&amp;lt;datafield&amp;gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataFieldString &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;= &lt;/SPAN&gt;&amp;lt;datafield&amp;gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;CONCATENATE &lt;/SPAN&gt;returnRowString &lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;'^~^' &lt;/SPAN&gt;datafieldstring &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;INTO &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ENDDO&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataline &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;= &lt;/SPAN&gt;returnRowString&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;INSERT &lt;/SPAN&gt;dataline &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S31" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 10:04:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769996#M1951978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-23T10:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769997#M1951979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siddharth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In code &amp;lt;datarow&amp;gt; is structure not table. Thats why we used Select-End Select here. So you suggest here is to change this structure to table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Akanksha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 10:04:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-select-query/m-p/11769997#M1951979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-30T10:04:16Z</dc:date>
    </item>
  </channel>
</rss>

