<?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 BSAD performance issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296419#M1635270</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 am using the below query to fetch data from  bsad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT bukrs "Company code&lt;/P&gt;&lt;P&gt;           kunnr "Customer&lt;/P&gt;&lt;P&gt;           augbl "Clearing document&lt;/P&gt;&lt;P&gt;           gjahr "Year&lt;/P&gt;&lt;P&gt;           belnr "Accounting Document Number&lt;/P&gt;&lt;P&gt;           monat " period&lt;/P&gt;&lt;P&gt;           vbeln "Billing document no&lt;/P&gt;&lt;P&gt;           prctr "Profit center&lt;/P&gt;&lt;P&gt;           FROM bsad INTO TABLE git_bsad&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN git_fagl_val&lt;/P&gt;&lt;P&gt;           WHERE bukrs EQ git_fagl_val-rbukrs AND&lt;/P&gt;&lt;P&gt;                 augbl EQ git_fagl_val-docnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'But this is too slow and takes more than 2 days to fetch data from basd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Oct 2011 06:57:30 GMT</pubDate>
    <dc:creator>S0025444845</dc:creator>
    <dc:date>2011-10-24T06:57:30Z</dc:date>
    <item>
      <title>BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296419#M1635270</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 am using the below query to fetch data from  bsad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT bukrs "Company code&lt;/P&gt;&lt;P&gt;           kunnr "Customer&lt;/P&gt;&lt;P&gt;           augbl "Clearing document&lt;/P&gt;&lt;P&gt;           gjahr "Year&lt;/P&gt;&lt;P&gt;           belnr "Accounting Document Number&lt;/P&gt;&lt;P&gt;           monat " period&lt;/P&gt;&lt;P&gt;           vbeln "Billing document no&lt;/P&gt;&lt;P&gt;           prctr "Profit center&lt;/P&gt;&lt;P&gt;           FROM bsad INTO TABLE git_bsad&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN git_fagl_val&lt;/P&gt;&lt;P&gt;           WHERE bukrs EQ git_fagl_val-rbukrs AND&lt;/P&gt;&lt;P&gt;                 augbl EQ git_fagl_val-docnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'But this is too slow and takes more than 2 days to fetch data from basd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 06:57:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296419#M1635270</guid>
      <dc:creator>S0025444845</dc:creator>
      <dc:date>2011-10-24T06:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296420#M1635271</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;&lt;STRONG&gt;most important&lt;/STRONG&gt; check every SELECT statement with FOR ALL ENTRIES, check wheather the comparing internal table is empty or not.Because if you put an initial internal table in FOR ALL ENTRIES , it will fetch all data from the data table.&lt;/P&gt;&lt;P&gt;check wheather all the fields in the where condition are in sequence of the source datatable.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 07:09:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296420#M1635271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-24T07:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296421#M1635272</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;Create two ranges for bukrs and augbl. Loop at your git_fagl_val and collect datas into your ranges then call select with ranges.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT bukrs "Company code
kunnr "Customer
augbl "Clearing document
gjahr "Year
belnr "Accounting Document Number
monat " period
vbeln "Billing document no
prctr "Profit center
FROM bsad INTO TABLE git_bsad

WHERE bukrs IN r_bukrs AND
             augbl IN r_augbl.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Take care.&lt;/P&gt;&lt;P&gt;Çağatay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 07:18:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296421#M1635272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-24T07:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296422#M1635273</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 am using the table not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me there is any possiblity of creating secondary indexes ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you pls expain how the ranges will be better?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 07:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296422#M1635273</guid>
      <dc:creator>S0025444845</dc:creator>
      <dc:date>2011-10-24T07:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296423#M1635274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Before using for all entries, you need to check whether itab in filled with values or not?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if not git_bsad [ ] is initial.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SELECT bukrs "Company code&lt;/P&gt;&lt;P&gt;kunnr "Customer&lt;/P&gt;&lt;P&gt;augbl "Clearing document&lt;/P&gt;&lt;P&gt;gjahr "Year&lt;/P&gt;&lt;P&gt;belnr "Accounting Document Number&lt;/P&gt;&lt;P&gt;monat " period&lt;/P&gt;&lt;P&gt;vbeln "Billing document no&lt;/P&gt;&lt;P&gt;prctr "Profit center&lt;/P&gt;&lt;P&gt;FROM bsad INTO TABLE git_bsad&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN git_fagl_val&lt;/P&gt;&lt;P&gt;WHERE bukrs EQ git_fagl_val-rbukrs AND&lt;/P&gt;&lt;P&gt;augbl EQ git_fagl_val-docnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 07:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296423#M1635274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-24T07:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296424#M1635275</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 alreay checking the table is not initial.&lt;/P&gt;&lt;P&gt;My code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT git_fagl_val[] IS  INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT bukrs "Company code&lt;/P&gt;&lt;P&gt;           kunnr "Customer&lt;/P&gt;&lt;P&gt;           augbl "Clearing document&lt;/P&gt;&lt;P&gt;           gjahr "Year&lt;/P&gt;&lt;P&gt;           belnr "Accounting Document Number&lt;/P&gt;&lt;P&gt;           monat " period&lt;/P&gt;&lt;P&gt;           vbeln "Billing document no&lt;/P&gt;&lt;P&gt;           prctr "Profit center&lt;/P&gt;&lt;P&gt;           FROM bsad INTO TABLE git_bsad&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN git_fagl_val&lt;/P&gt;&lt;P&gt;           WHERE bukrs EQ git_fagl_val-rbukrs AND&lt;/P&gt;&lt;P&gt;                 augbl EQ git_fagl_val-docnr.&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 07:53:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296424#M1635275</guid>
      <dc:creator>S0025444845</dc:creator>
      <dc:date>2011-10-24T07:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296425#M1635276</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;You should use the customer code too in order to improve the performance, if you know the clearing document, you can know the customer too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 08:08:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296425#M1635276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-24T08:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296426#M1635277</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 do not have the customer. I am getting the clearing document from FAGLFLEXA, but I do not have the customer.&lt;/P&gt;&lt;P&gt;below is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT a~docnr  "Document Number (Clearing Doc Number)&lt;/P&gt;&lt;P&gt;           a~rbukrs  "Company Code&lt;/P&gt;&lt;P&gt;           a~rtcur  "Local Currency&lt;/P&gt;&lt;P&gt;          a~racct  "G/L account number&lt;/P&gt;&lt;P&gt;          a~prctr  "Profit Center&lt;/P&gt;&lt;P&gt;          a~kokrs  "Controlling Area&lt;/P&gt;&lt;P&gt;          a~hsl  "Amount in local currency&lt;/P&gt;&lt;P&gt;          a~poper  "Period&lt;/P&gt;&lt;P&gt;          a~gjahr  "Year&lt;/P&gt;&lt;P&gt;          a~budat  "Posting date&lt;/P&gt;&lt;P&gt;          b~blart "Document Type&lt;/P&gt;&lt;P&gt;   INTO TABLE git_fagl&lt;/P&gt;&lt;P&gt;   FROM faglflexa AS a INNER JOIN bkpf AS b&lt;/P&gt;&lt;P&gt;   ON a&lt;SUB&gt;rbukrs = b&lt;/SUB&gt;bukrs&lt;/P&gt;&lt;P&gt;   AND   a&lt;SUB&gt;gjahr = b&lt;/SUB&gt;gjahr&lt;/P&gt;&lt;P&gt;    AND  a&lt;SUB&gt;docnr = b&lt;/SUB&gt;belnr&lt;/P&gt;&lt;P&gt;    WHERE a~rbukrs = p_cocd&lt;/P&gt;&lt;P&gt;    AND a~racct IN s_glac&lt;/P&gt;&lt;P&gt;    AND a~gjahr = p_year&lt;/P&gt;&lt;P&gt;    AND a~poper = p_prd&lt;/P&gt;&lt;P&gt;    AND b~blart IN gr_blart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF NOT git_fagl[] IS  INITIAL.&lt;/P&gt;&lt;P&gt;*C-- Fetch data from the table BSAD based on the Company Code and doc number&lt;/P&gt;&lt;P&gt;*C-- for from the FAGLL03 transaction&lt;/P&gt;&lt;P&gt;    SELECT bukrs "Company code&lt;/P&gt;&lt;P&gt;           kunnr "Customer&lt;/P&gt;&lt;P&gt;           augbl "Clearing document&lt;/P&gt;&lt;P&gt;           gjahr "Year&lt;/P&gt;&lt;P&gt;           belnr "Accounting Document Number&lt;/P&gt;&lt;P&gt;           monat " period&lt;/P&gt;&lt;P&gt;           vbeln "Billing document no&lt;/P&gt;&lt;P&gt;           prctr "Profit center&lt;/P&gt;&lt;P&gt;           FROM bsad INTO TABLE git_bsad&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN git_fagl_val&lt;/P&gt;&lt;P&gt;           WHERE bukrs EQ git_fagl_val-rbukrs AND&lt;/P&gt;&lt;P&gt;                 augbl EQ git_fagl_val-docnr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 08:30:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296426#M1635277</guid>
      <dc:creator>S0025444845</dc:creator>
      <dc:date>2011-10-24T08:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296427#M1635278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but you can get it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT git_fag.
  SELECT KUNNR UP TO 1 ROWS INTO git_fag-KUNNR
      FROM BSEG
        WHERE BYKRS = git_fag-RBUKRS
             AND BELNR = git_fag-DOCNR
             AND GJAHR = git_fag-GJAHR
             AND KOART = 'D'.
    ENDSELECT.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 08:42:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296427#M1635278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-24T08:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: BSAD performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296428#M1635279</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;When using FOR ALL ENTRIES (FAE), beside checking FAE table not initial, you should try to make it as small as possible.&lt;/P&gt;&lt;P&gt;Here, I see that you just use FAE for 2 fields CCode and Document number,  so try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lt_temp LIKE git_fagl[].
lt_temp[] = git_fagl[].
SORT lt_temp BY rbukrs docnr.
DELETE ADJACENT DUPLICATES FROM lt_temp COMPARING rbukrs docnr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then, use FAE on LT_TEMP instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 09:33:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bsad-performance-issue/m-p/8296428#M1635279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-24T09:33:21Z</dc:date>
    </item>
  </channel>
</rss>

