<?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:Select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532239#M1263893</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select burks GJAHR BELNR BLDAT bLART SHKZG GSBER dmbtr werks from bsis&lt;/P&gt;&lt;P&gt; into table i_bsis_main&lt;/P&gt;&lt;P&gt;from bsis  &lt;/P&gt;&lt;P&gt;where bukrs eq p_bukrs and&lt;/P&gt;&lt;P&gt;a~hkont eq p_hkont and&lt;/P&gt;&lt;P&gt;( a~belnr in s_fi_doc ) and&lt;/P&gt;&lt;P&gt;a~budat &amp;lt;= s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select burks GJAHR BELNR BLDAT bLART SHKZG GSBER dmbtr werks from bsis&lt;/P&gt;&lt;P&gt; into table i_bsis_main1&lt;/P&gt;&lt;P&gt; for all entries of i_bsis_main&lt;/P&gt;&lt;P&gt; where burks = i_bsis_main-burks and &lt;/P&gt;&lt;P&gt;       hkont = i_bsis_main-hkont and&lt;/P&gt;&lt;P&gt;       budat = i_bsis_main-budat and&lt;/P&gt;&lt;P&gt;       belnr = i_bsis_main-belnr and&lt;/P&gt;&lt;P&gt;       augdt &amp;gt; s_budat and&lt;/P&gt;&lt;P&gt;       augbl ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Anagha Deshmukh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Apr 2009 09:50:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-18T09:50:21Z</dc:date>
    <item>
      <title>Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532236#M1263890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz suggest how can i improve the performance of both these queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select a&lt;SUB&gt;belnr a&lt;/SUB&gt;gjahr a&lt;SUB&gt;bldat a&lt;/SUB&gt;gsber a&lt;SUB&gt;blart a&lt;/SUB&gt;budat a&lt;SUB&gt;dmbtr a&lt;/SUB&gt;xblnr&lt;/P&gt;&lt;P&gt;        a&lt;SUB&gt;shkzg a&lt;/SUB&gt;werks a&lt;SUB&gt;gsber a&lt;/SUB&gt;bukrs&lt;/P&gt;&lt;P&gt;         into corresponding fields of table i_bsis_main&lt;/P&gt;&lt;P&gt;         from bsis as a&lt;/P&gt;&lt;P&gt;             where a~bukrs eq p_bukrs    and&lt;/P&gt;&lt;P&gt;                    a~hkont eq p_hkont    and&lt;/P&gt;&lt;P&gt;                    a~budat &amp;lt;= s_budat    and&lt;/P&gt;&lt;P&gt;                  ( a~belnr in s_fi_doc ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************************************************************&lt;/P&gt;&lt;P&gt; select a&lt;SUB&gt;belnr a&lt;/SUB&gt;gjahr a&lt;SUB&gt;bldat a&lt;/SUB&gt;gsber a&lt;SUB&gt;blart a&lt;/SUB&gt;budat a&lt;SUB&gt;dmbtr a&lt;/SUB&gt;xblnr&lt;/P&gt;&lt;P&gt;        a&lt;SUB&gt;shkzg a&lt;/SUB&gt;werks a&lt;SUB&gt;gsber a&lt;/SUB&gt;bukrs&lt;/P&gt;&lt;P&gt;         into corresponding fields of i_bsis_main&lt;/P&gt;&lt;P&gt;         from bsas as a&lt;/P&gt;&lt;P&gt;             where a~bukrs eq p_bukrs    and&lt;/P&gt;&lt;P&gt;                    a~hkont eq p_hkont    and&lt;/P&gt;&lt;P&gt;                    a~budat &amp;lt;= s_budat   and&lt;/P&gt;&lt;P&gt;                    a~augdt &amp;gt; s_budat   and&lt;/P&gt;&lt;P&gt;                    a~augbl &amp;lt;&amp;gt; ' '     and&lt;/P&gt;&lt;P&gt;                  ( a~belnr in s_fi_doc ).&lt;/P&gt;&lt;P&gt;    append i_bsis_main.&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;PLz suggest.&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 08:42:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532236#M1263890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T08:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532237#M1263891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 08:52:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532237#M1263891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T08:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532238#M1263892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;Insted of  &lt;STRONG&gt;INTO CORRESPONDING&lt;/STRONG&gt;  use the the table of the same structure with the same sequence .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of  fs_bsis ,
            belnr type bsis-belnr,
            gjahr type bsis-gjahr,
            bldat type bsis-bldat,
            gsber type bsis-gsber,
            blart type bsis-blart,
            budat type bsis-budat ,
            dmbtr type bsis-dmbtr,
           xblnr type bsis-xblnr,
           shkzg  type bsis-shkzg ,
           werks type bsis-werks,
           gsber type bsis-gsber,
           bukrs type bsis-bukrs,
        end of fs_bsis.
data : i_bsis like table of fs_bsis.

select a~belnr a~gjahr a~bldat a~gsber a~blart a~budat a~dmbtr a~xblnr
a~shkzg a~werks a~gsber a~bukrs
into  table i_bsis_main                                          " INTO CORRESPONDING IS REMOVED
from bsis as a
where a~bukrs eq p_bukrs and
a~hkont eq p_hkont and
a~budat &amp;lt;= s_budat and
( a~belnr in s_fi_doc ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This applies for both the select queries.&lt;/P&gt;&lt;P&gt;For further performance improvement you need to maintain some more things , like ---&lt;/P&gt;&lt;P&gt;instead of &amp;lt;= in select query  fetch records in the internal table then imply this condition in the internal table.&lt;/P&gt;&lt;P&gt;The sequence of the fields in the query should as the database table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 09:39:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532238#M1263892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T09:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532239#M1263893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select burks GJAHR BELNR BLDAT bLART SHKZG GSBER dmbtr werks from bsis&lt;/P&gt;&lt;P&gt; into table i_bsis_main&lt;/P&gt;&lt;P&gt;from bsis  &lt;/P&gt;&lt;P&gt;where bukrs eq p_bukrs and&lt;/P&gt;&lt;P&gt;a~hkont eq p_hkont and&lt;/P&gt;&lt;P&gt;( a~belnr in s_fi_doc ) and&lt;/P&gt;&lt;P&gt;a~budat &amp;lt;= s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select burks GJAHR BELNR BLDAT bLART SHKZG GSBER dmbtr werks from bsis&lt;/P&gt;&lt;P&gt; into table i_bsis_main1&lt;/P&gt;&lt;P&gt; for all entries of i_bsis_main&lt;/P&gt;&lt;P&gt; where burks = i_bsis_main-burks and &lt;/P&gt;&lt;P&gt;       hkont = i_bsis_main-hkont and&lt;/P&gt;&lt;P&gt;       budat = i_bsis_main-budat and&lt;/P&gt;&lt;P&gt;       belnr = i_bsis_main-belnr and&lt;/P&gt;&lt;P&gt;       augdt &amp;gt; s_budat and&lt;/P&gt;&lt;P&gt;       augbl ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Anagha Deshmukh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 09:50:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532239#M1263893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T09:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532240#M1263894</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; 1. Define the fields in select stmt in the same way u declared it in internal table definition &amp;amp; write &lt;/P&gt;&lt;P&gt;into table &amp;lt;it&amp;gt; instead of into corresponding fields of...it improves performance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Define views of the structure mentioned in an internal table ....and instead of JOIN stmt just use normal SELECT stmt without join.It ll improve ur performance a lot...try it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;ajit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: AJIT THAKUR on Apr 18, 2009 12:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 10:20:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532240#M1263894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T10:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532241#M1263895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi,&lt;/P&gt;&lt;P&gt;If u r fetching data from one table u should not use the inner join syntax Statement &lt;/P&gt;&lt;P&gt;simple write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select belnr gjahr bldat gsber blart budat dmbtr xblnr&lt;/P&gt;&lt;P&gt;shkzg werks gsber bukrs&lt;/P&gt;&lt;P&gt;into corresponding fields of table i_bsis_main&lt;/P&gt;&lt;P&gt;from bsis &lt;/P&gt;&lt;P&gt;where bukrs eq p_bukrs &lt;/P&gt;&lt;P&gt;and hkont eq p_hkont&lt;/P&gt;&lt;P&gt;and belnr in s_fi_doc&lt;/P&gt;&lt;P&gt;and  budat &amp;lt;= s_budat  .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 10:27:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532241#M1263895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T10:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532242#M1263896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A) Moved to correct forum&lt;/P&gt;&lt;P&gt;B) It's fine as is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 22:06:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532242#M1263896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T22:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532243#M1263897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please use the SQL Trace and check the actual performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it really bad, what do you what to improve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lease the INTO CORRESPONDING where it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second statement could use INTO TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the alias 'as a' only if several tables are involved, for one it is not necessary, confuses only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 06:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532243#M1263897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-20T06:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue:Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532244#M1263898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cannot be said often enough: CORRESPONDING is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use APPENDING CORRESPONDING FIELDS OF TABLE in second select on BSAS, that's about all you can do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 07:36:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-select-statement/m-p/5532244#M1263898</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-04-20T07:36:53Z</dc:date>
    </item>
  </channel>
</rss>

