<?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 in select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597315#M1083874</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Razz,&lt;/P&gt;&lt;P&gt;This will definalty degrade your performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of this. try to fetch the data into the internal table and then use the For All entries.&lt;/P&gt;&lt;P&gt;Also avoid Inner join it degrade yoru performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chidanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Oct 2008 18:20:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-25T18:20:45Z</dc:date>
    <item>
      <title>Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597309#M1083868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Expart,&lt;/P&gt;&lt;P&gt; I am writing the statement . It ll take time very much .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT DISTINCT  a~belnr&lt;/P&gt;&lt;P&gt;                     a~lifnr&lt;/P&gt;&lt;P&gt;                     a~budat&lt;/P&gt;&lt;P&gt;                     a~dmbtr&lt;/P&gt;&lt;P&gt;                     a~gsber&lt;/P&gt;&lt;P&gt;                     b~name1&lt;/P&gt;&lt;P&gt;                     APPENDING CORRESPONDING FIELDS OF TABLE itab_itds&lt;/P&gt;&lt;P&gt;                     FROM bsak as a&lt;/P&gt;&lt;P&gt;                     INNER JOIN lfa1 AS b&lt;/P&gt;&lt;P&gt;                     ON a&lt;SUB&gt;lifnr = b&lt;/SUB&gt;lifnr&lt;/P&gt;&lt;P&gt;                     INNER JOIN bkpf as c&lt;/P&gt;&lt;P&gt;                     on a&lt;SUB&gt;belnr = c&lt;/SUB&gt;belnr AND a&lt;SUB&gt;gjahr = c&lt;/SUB&gt;gjahr and a&lt;SUB&gt;xblnr = c&lt;/SUB&gt;xblnr&lt;/P&gt;&lt;P&gt;                     FOR ALL ENTRIES IN itab_bsas&lt;/P&gt;&lt;P&gt;                     WHERE a~belnr = itab_bsas-belnr&lt;/P&gt;&lt;P&gt;                     AND a~budat IN budat1&lt;/P&gt;&lt;P&gt;                     and a~gsber = gsber-low&lt;/P&gt;&lt;P&gt;                     and c~stblg = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz. tell me how to performance the report it ll take time very less .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 06:29:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597309#M1083868</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T06:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597310#M1083869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to split the query. Based on the order of execution and usage of conditions, split the query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 07:02:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597310#M1083869</guid>
      <dc:creator>Sathish</dc:creator>
      <dc:date>2008-10-22T07:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597311#M1083870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Use For all entries instead of inner join .....&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;Bharani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 07:04:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597311#M1083870</guid>
      <dc:creator>BH2408</dc:creator>
      <dc:date>2008-10-22T07:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597312#M1083871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. BSAK-BKPF should be joined with bukrs, belnr, gjahr (remove xblnr)&lt;/P&gt;&lt;P&gt;2. check before the SELECT, if itab_bsas has any entry&lt;/P&gt;&lt;P&gt;3. If the above still don't help, than you have to do something with the WHERE condition&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 07:08:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597312#M1083871</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-10-22T07:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597313#M1083872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi razz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i always scare of using joins..because really it takes much time to procede to next statement in program.&lt;/P&gt;&lt;P&gt;and also bad for performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you need to split your code into different internal table and compare with previous entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT belnr lifnr budat dmbtr gsber INTO CORRESPONDING FIELDS OF TABLE it_bsak &lt;/P&gt;&lt;P&gt;                  FOR ALL ENTRIES IN itab_bsas&lt;/P&gt;&lt;P&gt;                                               where -&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;IF NOT it_bsak[] IS INITIAL.&lt;/P&gt;&lt;P&gt; SELECT name1 INTO c_name1 from LFA1&lt;/P&gt;&lt;P&gt;                  FOR ALL ENTRIES IN it_bsak.&lt;/P&gt;&lt;P&gt;                 where belnr = it_bsak-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.             &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;sujeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2008 07:40:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597313#M1083872</guid>
      <dc:creator>SujeetMishra</dc:creator>
      <dc:date>2008-10-23T07:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597314#M1083873</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;if think that, then this is the discussion for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6397179"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Never thought about &lt;STRONG&gt;what&lt;/STRONG&gt; FAE is doing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The real reason is: Had some bad experience with Joins ,never really learned to write good SQL ,&lt;/P&gt;&lt;P&gt;never thought about the data model (tables, indexes) behind the statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Databases natural language is SQL - it's fast, it's reliable and is existing since around the seventies.&lt;/P&gt;&lt;P&gt;I will go along with Eric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you go for the procedural approach - do it. Later some expert will come and replace it with high-performance SQL &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2008 12:43:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597314#M1083873</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-23T12:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597315#M1083874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Razz,&lt;/P&gt;&lt;P&gt;This will definalty degrade your performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of this. try to fetch the data into the internal table and then use the For All entries.&lt;/P&gt;&lt;P&gt;Also avoid Inner join it degrade yoru performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chidanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 18:20:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597315#M1083874</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T18:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597316#M1083875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Razz,&lt;/P&gt;&lt;P&gt; According to me Don't use the Inner Join along with the For All Entries. Either you can use one. For better performance use the For All Entries. Or one more solution is that you can change your code slightly so that it can increase your performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Nov 2008 09:16:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597316#M1083875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-01T09:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597317#M1083876</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 can see a lot of issues with your SELECT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid using Inner Join with FOR ALL ENTRIES.....it May give you incorrect results sometime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid using FOR ALL ENTRIES with Large Tables like BKPF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always check that the Driver Table should not be empty before writing the FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid Append Corresponding fields of......Use into table.....use an Internal Table with Similar structure and do the append later on as an Internal Table Operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You basically SPLIT your Select into Two Select Statements......First get the data fetched from BKPF and then do the FOR ALL ENTRIES on BSAK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Nov 2008 18:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/4597317#M1083876</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-02T18:37:40Z</dc:date>
    </item>
  </channel>
</rss>

