<?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: Problem in SELECT statement..... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461922#M1415654</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Sudha,&lt;/P&gt;&lt;P&gt;Try to avoid fetching data in BSEG table and not in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are alternation tables for Bseg, Please sreach in SDN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Dec 2009 04:26:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-30T04:26:59Z</dc:date>
    <item>
      <title>Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461920#M1415652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i have stuckuped with getting the data, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here am using select statement for getting data, but it gives TIME OUT problem when bulk records come, i ve tried other way but i am nt getting, anybody pls give me the alternative logic...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; my existng code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT gt_bkpf[] IS INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT bukrs&lt;/P&gt;&lt;P&gt;             belnr&lt;/P&gt;&lt;P&gt;             gjahr&lt;/P&gt;&lt;P&gt;             buzei&lt;/P&gt;&lt;P&gt;             augdt&lt;/P&gt;&lt;P&gt;             augcp&lt;/P&gt;&lt;P&gt;             augbl&lt;/P&gt;&lt;P&gt;             bschl&lt;/P&gt;&lt;P&gt;             koart&lt;/P&gt;&lt;P&gt;        FROM  bseg&lt;/P&gt;&lt;P&gt;       INTO TABLE gt_bseg1&lt;/P&gt;&lt;P&gt;       FOR ALL ENTRIES IN gt_bkpf&lt;/P&gt;&lt;P&gt;       WHERE bukrs EQ gt_bkpf-bukrs&lt;/P&gt;&lt;P&gt;       AND augbl EQ gt_bkpf-belnr&lt;/P&gt;&lt;P&gt;       AND augcp EQ gt_bkpf-cpudt&lt;/P&gt;&lt;P&gt;       AND bschl NOT IN ('25', '38').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above one is working, but going for Time out.  i ve tested with opther ways but not getting data into my gt_bseg1 table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tried with the below code, but its not working...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT gt_bkpf[] IS INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT bukrs&lt;/P&gt;&lt;P&gt;           belnr&lt;/P&gt;&lt;P&gt;           gjahr&lt;/P&gt;&lt;P&gt;           buzei&lt;/P&gt;&lt;P&gt;           augdt&lt;/P&gt;&lt;P&gt;           augcp&lt;/P&gt;&lt;P&gt;           augbl&lt;/P&gt;&lt;P&gt;           bschl&lt;/P&gt;&lt;P&gt;           koart&lt;/P&gt;&lt;P&gt;           rebzg&lt;/P&gt;&lt;P&gt;           rebzj&lt;/P&gt;&lt;P&gt;     FROM  bseg&lt;/P&gt;&lt;P&gt;     INTO TABLE gt_bseg&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN gt_bkpf        &lt;/P&gt;&lt;P&gt;     WHERE bukrs EQ p_bukrs&lt;/P&gt;&lt;P&gt;     AND  belnr IN s_belnr.              &lt;/P&gt;&lt;P&gt;     AND   gjahr EQ p_gjahr.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      SORT gt_bseg ASCENDING BY bukrs belnr gjahr augbl.&lt;/P&gt;&lt;P&gt;      DELETE ADJACENT DUPLICATES FROM gt_bseg.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1. ( The below is Alternative code 1)  not working.*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT gt_bkpf INTO gwa_bkpf.&lt;/P&gt;&lt;P&gt;  CLEAR gwa_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE gt_bseg INTO gwa_bseg&lt;/P&gt;&lt;P&gt;           with KEY bukrs = gwa_bkpf-bukrs&lt;/P&gt;&lt;P&gt;                    augbl = gwa_bkpf-belnr&lt;/P&gt;&lt;P&gt;                    augcp = gwa_bkpf-cpudt.&lt;/P&gt;&lt;P&gt;       if sy-subrc eq 0 AND ( gwa_bseg-bschl &amp;lt;&amp;gt; '25'&lt;/P&gt;&lt;P&gt;                              *AND gwa_bseg-bschl &amp;lt;&amp;gt; '38' ).&lt;/P&gt;&lt;P&gt;                   append gwa_bseg to gt_bseg1.&lt;/P&gt;&lt;P&gt;         ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2.  the below one also not working....*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT gt_bkpf INTO gwa_bkpf.&lt;/P&gt;&lt;P&gt;CLEAR gwa_bseg.&lt;/P&gt;&lt;P&gt;    LOOP AT gt_bseg INTO gwa_bseg.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;For gt_bseg1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;      IF  gwa_bseg-augbl EQ gwa_bkpf-belnr&lt;/P&gt;&lt;P&gt;      AND gwa_bseg-augcp EQ gwa_bkpf-cpudt&lt;/P&gt;&lt;P&gt;      AND ( gwa_bseg-bschl NE gc_bschl_out&lt;/P&gt;&lt;P&gt;            AND gwa_bseg-bschl NE gc_bschl_clr ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        APPEND gwa_bseg TO gt_bseg1.&lt;/P&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone  plz help me out on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance..&lt;/P&gt;&lt;P&gt;sudha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 03:04:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461920#M1415652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-30T03:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461921#M1415653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sudha, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will suggest you to search SDN for performance tuning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also , you should try to avoid NOT IN .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 03:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461921#M1415653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-30T03:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461922#M1415654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Sudha,&lt;/P&gt;&lt;P&gt;Try to avoid fetching data in BSEG table and not in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are alternation tables for Bseg, Please sreach in SDN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 04:26:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461922#M1415654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-30T04:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461923#M1415655</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;Problem with your select query is that your using BSEG table which is suppose to be a cluster table for 5 transparent table namely : &lt;/P&gt;&lt;P&gt;BSEC, BSED, BSEG, BSES &amp;amp; BSET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your data should be present in few of the above table. rather fetching data from BSEG..try using joins on above table, whichever are applicable to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 04:39:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461923#M1415655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-30T04:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461924#M1415656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sudha ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BSEG is a cluster table. Any select query on cluster table will degrade a performance for sure. SAP has provided alternatives for that.&lt;/P&gt;&lt;P&gt;Try using following tables in your select query instead of BSEG :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BSAD                         Accounting: Secondary Index for Customers(Cleared Items)&lt;/P&gt;&lt;P&gt;BSID                           Accounting: Secondary Index for Customers&lt;/P&gt;&lt;P&gt;BSAK                         Accounting: Secondary Index for Vendors (Cleared Items)&lt;/P&gt;&lt;P&gt;BSIK                           Accounting: Secondary Index for Vendors&lt;/P&gt;&lt;P&gt;BSAS                         Accounting: Secondary Index for G/L Accounts (Cleared Items)&lt;/P&gt;&lt;P&gt;BSIS                           Accounting: Secondary Index for G/L Accounts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to use any of the above tables in your program . Performace will surely improve without breaking the business logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Revert to me in case of any help required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 04:42:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461924#M1415656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-30T04:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461925#M1415657</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;This query from BSEG will definitely go for a toss.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason is we are not using primary fields in the where clause, instead we are using&lt;/P&gt;&lt;P&gt;augbl&lt;/P&gt;&lt;P&gt;augcp&lt;/P&gt;&lt;P&gt;bschl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which do not have any secondary index, and more over it is not possible to build secondary indexes on them since BSEG is a cluster table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My points for this would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Instead of BSEG, use all the following tables and append their records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  BSIS, BSAS, BSID, BSAD, BSIK, BSAK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) This is because, these tables already have indexes on AUGBL.&lt;/P&gt;&lt;P&gt;b) Instead of AUGCP, you may have to use AUGGJ  or AUGDT.&lt;/P&gt;&lt;P&gt;c) If you are using AUGGJ, then you may have to create secondary index on this field.&lt;/P&gt;&lt;P&gt;d) For BSCHL, do not write in where clause. instead fetch all records in itab, and then filter in one go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this sounds complicated, but for BSEG queries there are not much options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit Mittal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 04:57:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461925#M1415657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-30T04:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461926#M1415658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello sudhasumathi &lt;/P&gt;&lt;P&gt;Insted of using Direct Comparision in your Query/ Code  i would suggest to use VALUE RANGE  for fix value comparision it would improve performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Anup Deshmukh on Dec 30, 2009 7:51 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 06:50:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461926#M1415658</guid>
      <dc:creator>anup_deshmukh4</dc:creator>
      <dc:date>2009-12-30T06:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461927#M1415659</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;use all the &lt;STRONG&gt;PRIMARY KEYS&lt;/STRONG&gt; in the selection query..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this solve ur problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RItesh J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 08:13:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461927#M1415659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-30T08:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SELECT statement.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461928#M1415660</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;the subject &lt;STRONG&gt;"Problem in SELECT statement....."&lt;/STRONG&gt;  is perfect. Now we know   it is not  &lt;STRONG&gt;"Problem with girlfriend....."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 08:47:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/6461928#M1415660</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2009-12-30T08:47:37Z</dc:date>
    </item>
  </channel>
</rss>

