<?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 select statement using BSEG table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884016#M1141341</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SAPinas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following lines of code in one of my program. Becuase of that code I am getting Performance issue. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : &lt;STRONG&gt;BSEG&lt;/STRONG&gt; is Cluster Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me how I will use in another way &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_hdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select buzei buzid koart shkzg mwskz dmbtr hwbas sgtxt vbund kostl&lt;/P&gt;&lt;P&gt;           aufnr anln1 anln2 hkont kunnr lifnr matnr werks ebeln ebelp&lt;/P&gt;&lt;P&gt;           zekkn rewrt prctr txjcd projk&lt;/P&gt;&lt;P&gt;    into (t_item-buzei, t_item-buzid, t_item-koart, t_item-shkzg,&lt;/P&gt;&lt;P&gt;          t_item-mwskz, t_item-dmbtr, t_item-hwbas, t_item-sgtxt,&lt;/P&gt;&lt;P&gt;          t_item-vbund, t_item-kostl, t_item-aufnr, t_item-anln1,&lt;/P&gt;&lt;P&gt;          t_item-anln2, t_item-hkont, t_item-kunnr, t_item-lifnr,&lt;/P&gt;&lt;P&gt;          t_item-matnr, t_item-werks, t_item-ebeln, t_item-ebelp,&lt;/P&gt;&lt;P&gt;          t_item-zekkn, t_item-rewrt, t_item-prctr, t_item-txjcd,&lt;/P&gt;&lt;P&gt;          t_item-projk)&lt;/P&gt;&lt;P&gt;    from bseg&lt;/P&gt;&lt;P&gt;   where bukrs  = t_hdr-bukrs&lt;/P&gt;&lt;P&gt;     and belnr  = t_hdr-belnr&lt;/P&gt;&lt;P&gt;     and gjahr  = t_hdr-gjahr&lt;/P&gt;&lt;P&gt;     and hkont in s_hkont&lt;/P&gt;&lt;P&gt;     and mwskz in s_mwskz&lt;/P&gt;&lt;P&gt;     and kostl in s_kostl&lt;/P&gt;&lt;P&gt;     and prctr in s_prctr&lt;/P&gt;&lt;P&gt;     and werks in s_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Skip record if not in selection screen range for state&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      check t_item-txjcd(2) in s_state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if t_item-shkzg  = c_debit.  "S&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      if t_item-shkzg  = c_credit. "H&lt;/P&gt;&lt;P&gt;        t_item-dmbtr = t_item-dmbtr * ( -1 ).&lt;/P&gt;&lt;P&gt;        t_item-rewrt = t_item-rewrt * ( -1 ).&lt;/P&gt;&lt;P&gt;        t_item-hwbas = t_item-hwbas * ( -1 ).&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&amp;amp;MWB 04/08/2005 ... add additional US Bayer Tax dept requested fields&lt;/P&gt;&lt;P&gt;      clear: t_item-basetax, t_item-accrtax, t_item-vendtax,&lt;/P&gt;&lt;P&gt;             t_item-taxrate, t_item-invbase, t_item-invtax.&lt;/P&gt;&lt;P&gt;**&amp;amp;MWB ... end insert 04/08/2005&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      clear t_item-hwbas.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;      move-corresponding t_hdr to t_item.&lt;/P&gt;&lt;P&gt;      append t_item.&lt;/P&gt;&lt;P&gt;      clear  t_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endselect.&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;Thank you very much Advance.............:-)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Dec 2008 18:30:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-10T18:30:39Z</dc:date>
    <item>
      <title>select statement using BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884016#M1141341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SAPinas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following lines of code in one of my program. Becuase of that code I am getting Performance issue. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : &lt;STRONG&gt;BSEG&lt;/STRONG&gt; is Cluster Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me how I will use in another way &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_hdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select buzei buzid koart shkzg mwskz dmbtr hwbas sgtxt vbund kostl&lt;/P&gt;&lt;P&gt;           aufnr anln1 anln2 hkont kunnr lifnr matnr werks ebeln ebelp&lt;/P&gt;&lt;P&gt;           zekkn rewrt prctr txjcd projk&lt;/P&gt;&lt;P&gt;    into (t_item-buzei, t_item-buzid, t_item-koart, t_item-shkzg,&lt;/P&gt;&lt;P&gt;          t_item-mwskz, t_item-dmbtr, t_item-hwbas, t_item-sgtxt,&lt;/P&gt;&lt;P&gt;          t_item-vbund, t_item-kostl, t_item-aufnr, t_item-anln1,&lt;/P&gt;&lt;P&gt;          t_item-anln2, t_item-hkont, t_item-kunnr, t_item-lifnr,&lt;/P&gt;&lt;P&gt;          t_item-matnr, t_item-werks, t_item-ebeln, t_item-ebelp,&lt;/P&gt;&lt;P&gt;          t_item-zekkn, t_item-rewrt, t_item-prctr, t_item-txjcd,&lt;/P&gt;&lt;P&gt;          t_item-projk)&lt;/P&gt;&lt;P&gt;    from bseg&lt;/P&gt;&lt;P&gt;   where bukrs  = t_hdr-bukrs&lt;/P&gt;&lt;P&gt;     and belnr  = t_hdr-belnr&lt;/P&gt;&lt;P&gt;     and gjahr  = t_hdr-gjahr&lt;/P&gt;&lt;P&gt;     and hkont in s_hkont&lt;/P&gt;&lt;P&gt;     and mwskz in s_mwskz&lt;/P&gt;&lt;P&gt;     and kostl in s_kostl&lt;/P&gt;&lt;P&gt;     and prctr in s_prctr&lt;/P&gt;&lt;P&gt;     and werks in s_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Skip record if not in selection screen range for state&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      check t_item-txjcd(2) in s_state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if t_item-shkzg  = c_debit.  "S&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      if t_item-shkzg  = c_credit. "H&lt;/P&gt;&lt;P&gt;        t_item-dmbtr = t_item-dmbtr * ( -1 ).&lt;/P&gt;&lt;P&gt;        t_item-rewrt = t_item-rewrt * ( -1 ).&lt;/P&gt;&lt;P&gt;        t_item-hwbas = t_item-hwbas * ( -1 ).&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&amp;amp;MWB 04/08/2005 ... add additional US Bayer Tax dept requested fields&lt;/P&gt;&lt;P&gt;      clear: t_item-basetax, t_item-accrtax, t_item-vendtax,&lt;/P&gt;&lt;P&gt;             t_item-taxrate, t_item-invbase, t_item-invtax.&lt;/P&gt;&lt;P&gt;**&amp;amp;MWB ... end insert 04/08/2005&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      clear t_item-hwbas.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;      move-corresponding t_hdr to t_item.&lt;/P&gt;&lt;P&gt;      append t_item.&lt;/P&gt;&lt;P&gt;      clear  t_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endselect.&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;Thank you very much Advance.............:-)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 18:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884016#M1141341</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T18:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: select statement using BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884017#M1141342</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;try to use the secondary Indexes . I Think we dopnt have index s for Cluster table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try avoid the BSEG select stmt in the LOOP.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ram reddy on Dec 10, 2008 7:34 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ram reddy on Dec 10, 2008 7:35 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 18:33:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884017#M1141342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T18:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: select statement using BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884018#M1141343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As BSEG is in a cluster table RFBLG, the only index available is the primary one, so only BUKRS, BELNR and GJAHR keys are actually available. So for other criteria resolution, the program will read the whole cluster, unpacking the records and executing the selection. When most criteria come from BKPF header, you may select from BKPF and then from BSEG using the full key of the cluster, and using a [FOR ALL ENTRIES|http://help.sap.com/abapdocu/en/ABENOPEN_SQL_PERFO.htm] IN a table with the keys from BKPF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to use one or more of the secondary indexes provide by SAP&lt;/P&gt;&lt;P&gt;- BSAD Accounting: Secondary Index for Customers (Cleared Items)&lt;/P&gt;&lt;P&gt;- BSAK Accounting: Secondary Index for Vendors (Cleared Items)&lt;/P&gt;&lt;P&gt;- BSAS Accounting: Secondary Index for G/L Accounts (Cleared Items)&lt;/P&gt;&lt;P&gt;- BSID Accounting: Secondary Index for Customers&lt;/P&gt;&lt;P&gt;- BSIK Accounting: Secondary Index for Vendors&lt;/P&gt;&lt;P&gt;- BSIM Secondary Index, Documents for Material&lt;/P&gt;&lt;P&gt;- BSIS Accounting: Secondary Index for G/L Accounts&lt;/P&gt;&lt;P&gt;These indexes are actual tables, so you may create/use indexes, they are also easily appended, as they are filled via move-corresponding statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try a little search at sdn on keywords like [BSEG, cluster and performance|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&amp;amp;query=bseg&lt;EM&gt;cluster&lt;/EM&gt;performance&amp;amp;adv=false&amp;amp;sortby=cm_rnd_rankvalue].&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, 10 Dec 2008 18:42:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884018#M1141343</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2008-12-10T18:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: select statement using BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884019#M1141344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kishore, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to select using for all entries, maybe you'll need to create an index on for fields BUKRS, BELNR, GJAHR.&lt;/P&gt;&lt;P&gt;After selection, create a routine to delete rows where t_item-txjcd(2) not in s_state&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 19:45:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884019#M1141344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T19:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: select statement using BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884020#M1141345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;after following all the above suggestions, my tip is to change the below one,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding t_hdr to t_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead, u move explicitly for each field.....may be increase the performence a bit!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2008 18:42:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884020#M1141345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-12T18:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: select statement using BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884021#M1141346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try also to use[ SE30|https://www.sdn.sap.com/irj/scn/advancedsearch?query=+se30&amp;amp;cat=sdn_all] (documentaion [Runtime Analysis|http://help.sap.com/erp2005_ehp_04/helpdata/EN/c6/617cafe68c11d2b2ab080009b43351/frameset.htm]) on your report to analyze the steps that are time consuming : database access or calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Dec 2008 12:39:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884021#M1141346</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2008-12-14T12:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: select statement using BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884022#M1141347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 14:02:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-using-bseg-table/m-p/4884022#M1141347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T14:02:06Z</dc:date>
    </item>
  </channel>
</rss>

