<?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: Performnace Optimisation Issue while fetching data from BSEG table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494409#M1557624</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the data selection criteria, if Fiscal Year (GJAHR) is to be included alongwith&lt;/P&gt;&lt;P&gt;Document Number (BELNR)  to resolve the current problem of same document number in different fiscal&lt;/P&gt;&lt;P&gt;years not getting selected but only the first yearu2019s document getting selected. Subsequent yearu2019s documents with the&lt;/P&gt;&lt;P&gt;same number are not selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select bukrs lifnr hkont&lt;/P&gt;&lt;P&gt;from bsak&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_bsak&lt;/P&gt;&lt;P&gt;where budat in so_budat.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;loop at it_bsak into wa_bsak.&lt;/P&gt;&lt;P&gt;write: / wa_bsak-bukrs.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select belnr gsber sgtxt shkzg pswbt from bseg into corresponding fields of table it_bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bsak&lt;/P&gt;&lt;P&gt;where lifnr = it_bsak-lifnr and&lt;/P&gt;&lt;P&gt;bukrs = it_bsak-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;hkont = it_bsak-hkont.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Nov 2010 17:59:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-17T17:59:51Z</dc:date>
    <item>
      <title>Performnace Optimisation Issue while fetching data from BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494405#M1557620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT-OPTIONS  : so_bukrs FOR bseg-bukrs NO INTERVALS,&lt;/P&gt;&lt;P&gt;                                 so_lifnr FOR bseg-belnr NO INTERVALS,&lt;/P&gt;&lt;P&gt;                                 so_hkont FOR bseg-hkont,&lt;/P&gt;&lt;P&gt;                                 so_budat FOR bkpf-budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Data Selection for BSEG&lt;/P&gt;&lt;P&gt;  SELECT lifnr hkont belnr gsber sgtxt shkzg pswbt from BSEG INTO&lt;/P&gt;&lt;P&gt;  CORRESPONDING FIELDS OF TABLE it_bseg&lt;/P&gt;&lt;P&gt;  WHERE bukrs IN so_bukrs AND&lt;/P&gt;&lt;P&gt;        lifnr IN so_lifnr AND&lt;/P&gt;&lt;P&gt;        hkont IN so_hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for a test data , it produces the following output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;200000     117000     100000001  2    S        1.000,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000000 2    H        1.000,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000001 2    H        1.620,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000002 2    H          830,00&lt;/P&gt;&lt;P&gt;200000     118010     5000000000      H          100,00&lt;/P&gt;&lt;P&gt;200000     118010     5000000001      H          500,00&lt;/P&gt;&lt;P&gt;200000     118010     5000000002      H          300,00&lt;/P&gt;&lt;P&gt;200000     118010     5000000003 2    H          500,00&lt;/P&gt;&lt;P&gt;200000     118010     5000000004 2    H       10.193,36&lt;/P&gt;&lt;P&gt;200000     118010     5000000005      H        1.000,00&lt;/P&gt;&lt;P&gt;200000     118010     5000000006      S        1.000,00  select query1 successful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; while fecthing fields from BSEG table, it takes a long time to display the records. I replaced it with the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bukrs lifnr hkont&lt;/P&gt;&lt;P&gt;from   bsak&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_bsak&lt;/P&gt;&lt;P&gt;where budat in so_budat.&lt;/P&gt;&lt;P&gt;*if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*loop at it_bsak into wa_bsak.&lt;/P&gt;&lt;P&gt;*write: / wa_bsak-bukrs.&lt;/P&gt;&lt;P&gt;*endloop.&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;select belnr gsber sgtxt shkzg pswbt from bseg into corresponding fields of table it_bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bsak&lt;/P&gt;&lt;P&gt;where lifnr = it_bsak-lifnr and&lt;/P&gt;&lt;P&gt;      bukrs = it_bsak-bukrs and&lt;/P&gt;&lt;P&gt;      hkont = it_bsak-hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, i am not getting the same output using the above code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the same test data, the output i get is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;200000     117000     100000001  2    S        1.000,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000000 2    H        1.000,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000001 2    H        1.620,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000002 2    H          830,00&lt;/P&gt;&lt;P&gt;200000     117000     100000001  2    S        1.000,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000000 2    H        1.000,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000001 2    H        1.620,00&lt;/P&gt;&lt;P&gt;200000     117000     1900000002 2    H          830,00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The values get doubled. Please Correct me if i am using the wrong select statement. Awaiting your suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt; Basil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 05:04:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494405#M1557620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-17T05:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Performnace Optimisation Issue while fetching data from BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494406#M1557621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Since BSEG is a cluster table you need to select all the primary key fields even if all the primary key values are not required in your case, along with the other required fields.  So here you have to modify the SELECT statement like shown below.&lt;/P&gt;&lt;P&gt;Also try avoiding INTO CORRESPONDING FIELDS OF which will also cause a performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT BUKRS BELNR GJAHR BUZEI  LIFNR HKONT GSBER SGTXT SHKZG PSWBT 
FROM BSEG
INTO TABLE IT_BSEG
WHERE BUKRS IN SO_BUKRS AND
                LIFNR IN SO_LIFNR AND
                HKONT IN SO_HKONT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 06:20:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494406#M1557621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-17T06:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Performnace Optimisation Issue while fetching data from BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494407#M1557622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; I am getting the same output now, but my doubt is where does the role of Index table BSAK come into play. If i try to fetch data &lt;/P&gt;&lt;P&gt; using BSAK table  and then use FOR ALL ENTRIES statement , is there any possiblity of getting the same output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am also posting the code used to fetch data from BSAK table.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; select bukrs lifnr hkont&lt;/P&gt;&lt;P&gt; from   bsak&lt;/P&gt;&lt;P&gt; into corresponding fields of table it_bsak&lt;/P&gt;&lt;P&gt; where budat in so_budat.&lt;/P&gt;&lt;P&gt; if sy-subrc = 0.&lt;/P&gt;&lt;P&gt; loop at it_bsak into wa_bsak.&lt;/P&gt;&lt;P&gt; write: / wa_bsak-bukrs.&lt;/P&gt;&lt;P&gt; endloop.&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;select belnr gsber sgtxt shkzg pswbt from bseg into corresponding fields of table it_bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bsak&lt;/P&gt;&lt;P&gt;where lifnr = it_bsak-lifnr and&lt;/P&gt;&lt;P&gt;     bukrs = it_bsak-bukrs and&lt;/P&gt;&lt;P&gt;    hkont = it_bsak-hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Basil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 07:23:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494407#M1557622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-17T07:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Performnace Optimisation Issue while fetching data from BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494408#M1557623</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;When I add to use a mass selection in BSEG I managed to first select data from BKPF ( some secondary indexes are quite interesting ) and then select the items in BSEG using FOR ALL ENTRIES with records fetched from BKPF. You can then specify the whole records primary key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used this technic in daily interfaces checking that FI documents were not yet created ( for instance to avoid a second use of the same input file ).&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, 17 Nov 2010 14:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494408#M1557623</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-17T14:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Performnace Optimisation Issue while fetching data from BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494409#M1557624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the data selection criteria, if Fiscal Year (GJAHR) is to be included alongwith&lt;/P&gt;&lt;P&gt;Document Number (BELNR)  to resolve the current problem of same document number in different fiscal&lt;/P&gt;&lt;P&gt;years not getting selected but only the first yearu2019s document getting selected. Subsequent yearu2019s documents with the&lt;/P&gt;&lt;P&gt;same number are not selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select bukrs lifnr hkont&lt;/P&gt;&lt;P&gt;from bsak&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_bsak&lt;/P&gt;&lt;P&gt;where budat in so_budat.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;loop at it_bsak into wa_bsak.&lt;/P&gt;&lt;P&gt;write: / wa_bsak-bukrs.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select belnr gsber sgtxt shkzg pswbt from bseg into corresponding fields of table it_bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bsak&lt;/P&gt;&lt;P&gt;where lifnr = it_bsak-lifnr and&lt;/P&gt;&lt;P&gt;bukrs = it_bsak-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;hkont = it_bsak-hkont.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 17:59:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494409#M1557624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-17T17:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Performnace Optimisation Issue while fetching data from BSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494410#M1557625</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;BSEG table has all accounting item, BSAK table has the cleared item only, so probably the open items are missing: BSIK tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BSAK/BSIK table have all information you need, so I think it's useless to do a selection in BSEG, probably you can display the result of selection from BSIK and BSAK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 18:23:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performnace-optimisation-issue-while-fetching-data-from-bseg-table/m-p/7494410#M1557625</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-17T18:23:07Z</dc:date>
    </item>
  </channel>
</rss>

