<?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 issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416986#M1243638</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"If you are sure that BLART (Select-Option) is not made obligatory on sel-screen but still you&lt;/P&gt;&lt;P&gt;"expect it should have some value before the actual SELECTion from BKPF then check if for entries.&lt;/P&gt;&lt;P&gt;"This way you need not DEACTIVATE/Comment "BLART" is SELECT statement and thus no need for&lt;/P&gt;&lt;P&gt;"any LOOP and another Int. Table IT_ADHL based on Sel-Screen/Range BLART.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF NOT S_BLART IS INITIAL. "(Asssuming BLART as SELECT-OPTION so calling it S_BLART)

SELECT BUKRS BELNR GJAHR BLART BUDAT
  FROM BKPF
  INTO TABLE it_adhl
  WHERE BUKRS = 'TAFE' AND
               BLART IN S_BLART AND   "Uncommenting this line here from your code
               BSTAT IN BSTAT AND
               BUDAT IN BUDAT.
ENDIF.

SORT it_adhl BY bukrs belnr gjahr.
DELETE ADJACENT DUPLICATES FROM it_adhl COMPARING bukrs belnr gjahr.

IF NOT it_adhl IS INITIAL.
  SELECT BUKRS BELNR GJAHR BSCHL WRBTR HKONT GSBER MATNR 
    FROM BSEG
"    APPENDING TABLE IT_BSEG1
"Commenting above Assuming there is no previous or further need for Appending data into IT_BSEG1
    INTO TABLE it_bseg1
    FOR ALL ENTRIES IN it_adhl
    WHERE bukrs = it_adhl-bukrs AND
                 belnr = it_adhl-belnr AND
                 gjahr = it_adhl-gjahr AND
                 bschl IN ('40','50') AND
                 hkont IN s_hkont.  "Assuming s_hknot a SELECT-OPTION/RANGE
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"If there is still Performace Problem then check number of records fetched from BKPF table. If no. of records are too high then FOR ALL ENTRIES on BSEG would not yield performance and hence go for either of the 2 options below:&lt;/P&gt;&lt;P&gt;" (1) INNER JOIN on BKPF/BSEG&lt;/P&gt;&lt;P&gt;" (2) PACKAGE SIZE with SELECT statement for BKPF and fetch data from BSEG for those records&lt;/P&gt;&lt;P&gt;"in which case there could be multiple fetches from BKPF and thus from BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manuj Bhardwaj on May 26, 2009 10:50 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 May 2009 20:27:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-26T20:27:11Z</dc:date>
    <item>
      <title>Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416979#M1243631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Please use a meaningful subject in future&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dear sir,&lt;/P&gt;&lt;P&gt;             &lt;/P&gt;&lt;P&gt; SELECT BUKRS BELNR GJAHR BLART BUDAT FROM BKPF INTO TABLE IT_ADHL1 WHERE&lt;/P&gt;&lt;P&gt;                                                       BUKRS = 'TAFE' AND&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                                      BLART IN BLART AND&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                                                       BSTAT IN BSTAT AND&lt;/P&gt;&lt;P&gt;                                                       BUDAT IN BUDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT IT_ADHL1 WHERE BLART IN BLART.&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING IT_ADHL1 TO IT_ADHL.&lt;/P&gt;&lt;P&gt;    APPEND IT_ADHL. CLEAR IT_ADHL.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT BUKRS BELNR GJAHR BSCHL WRBTR HKONT GSBER MATNR FROM BSEG APPENDING TABLE IT_BSEG1&lt;/P&gt;&lt;P&gt;               FOR ALL ENTRIES IN IT_ADHL   WHERE BUKRS = IT_ADHL-BUKRS AND&lt;/P&gt;&lt;P&gt;                                            BELNR = IT_ADHL-BELNR AND&lt;/P&gt;&lt;P&gt;                                            GJAHR = IT_ADHL-GJAHR AND&lt;/P&gt;&lt;P&gt;                                            BSCHL IN ('40','50') AND&lt;/P&gt;&lt;P&gt;                                             HKONT IN HKONT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i execute this code in the period of 3 months ...i got a dumb (time limit exceeded) in this particular code.....how to reduce the performance........help me please.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank u,&lt;/P&gt;&lt;P&gt;Manjula devi.D&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Mar 28, 2009 6:55 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 05:59:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416979#M1243631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T05:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416980#M1243632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dont  give loop directly take the table it_adhl1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in select compare this table dont use append.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 06:15:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416980#M1243632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T06:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416981#M1243633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try using:&lt;/P&gt;&lt;P&gt;SORT IT_ADHL BY BUKRS BELNR GJAHR.&lt;/P&gt;&lt;P&gt;before the second select statement. This will improve performance.&lt;/P&gt;&lt;P&gt;Also checking IF IT_ADHL[] IS NOT INITIAL and DELETE ADJACENT DUPLICATES FROM IT_ADHL is a good practice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also MOVE_CORRESPONDING reduces performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 06:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416981#M1243633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T06:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416982#M1243634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manjula,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I faced some similar problem, and after I tried with this solution and posted this one.&lt;/P&gt;&lt;P&gt;do necessary changes as per requirement.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Author: Dileep Kumar&lt;/P&gt;&lt;P&gt;Submitted: 11.02.2009&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Description  : Join Statement is the best in some cases as shown below than For All Entries. So Dont Forget about Joins Simply. Keep trying with joins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sometimes, where you can get a better performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont forget about joins simply like that due to performances. Now in this case(A Business Requirement) Joins is the best than FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF TY_MKPF ,&lt;/P&gt;&lt;P&gt;        MBLNR TYPE MKPF-MBLNR,          "Material document&lt;/P&gt;&lt;P&gt;        MJAHR TYPE MKPF-MJAHR,&lt;/P&gt;&lt;P&gt;        BUDAT TYPE MKPF-BUDAT,          "Posting Date in the document&lt;/P&gt;&lt;P&gt;      END OF TY_MKPF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF TY_MSEG1 ,&lt;/P&gt;&lt;P&gt;        MJAHR TYPE MKPF-MJAHR,&lt;/P&gt;&lt;P&gt;        BUDAT TYPE MKPF-BUDAT,          "Posting Date in the document&lt;/P&gt;&lt;P&gt;        MBLNR TYPE MSEG-MBLNR,          "Material document&lt;/P&gt;&lt;P&gt;        MATNR TYPE MSEG-MATNR,          "Material Number&lt;/P&gt;&lt;P&gt;        ZEILE TYPE MSEG-ZEILE,          "Item in material document&lt;/P&gt;&lt;P&gt;        BWART TYPE MSEG-BWART,          "Movement Type&lt;/P&gt;&lt;P&gt;        CHARG TYPE MSEG-CHARG,          "Batch Number&lt;/P&gt;&lt;P&gt;        EBELN TYPE MSEG-EBELN,          "PO #&lt;/P&gt;&lt;P&gt;        SHKZG TYPE MSEG-SHKZG,          "Debit/Credit Indicator&lt;/P&gt;&lt;P&gt;        MENGE TYPE MSEG-MENGE,          "Quantity&lt;/P&gt;&lt;P&gt;        MEINS TYPE MSEG-MEINS,          "UOM&lt;/P&gt;&lt;P&gt;        DMBTR TYPE MSEG-DMBTR,          "Amount in local currency&lt;/P&gt;&lt;P&gt;        WAERS TYPE MSEG-WAERS,          "Currency Key&lt;/P&gt;&lt;P&gt;      END OF TY_MSEG1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF TY_MSEG ,&lt;/P&gt;&lt;P&gt;        MBLNR TYPE MSEG-MBLNR,          "Material document&lt;/P&gt;&lt;P&gt;        MATNR TYPE MSEG-MATNR,          "Material Number&lt;/P&gt;&lt;P&gt;        ZEILE TYPE MSEG-ZEILE,          "Item in material document&lt;/P&gt;&lt;P&gt;        BWART TYPE MSEG-BWART,          "Movement Type&lt;/P&gt;&lt;P&gt;        CHARG TYPE MSEG-CHARG,          "Batch Number&lt;/P&gt;&lt;P&gt;        EBELN TYPE MSEG-EBELN,          "PO #&lt;/P&gt;&lt;P&gt;        SHKZG TYPE MSEG-SHKZG,          "Debit/Credit Indicator&lt;/P&gt;&lt;P&gt;        MENGE TYPE MSEG-MENGE,          "Quantity&lt;/P&gt;&lt;P&gt;        MEINS TYPE MSEG-MEINS,          "UOM&lt;/P&gt;&lt;P&gt;        DMBTR TYPE MSEG-DMBTR,          "Amount in local currency&lt;/P&gt;&lt;P&gt;        WAERS TYPE MSEG-WAERS,          "Currency Key&lt;/P&gt;&lt;P&gt;      END OF TY_MSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : IT_MSEG TYPE TABLE OF TY_MSEG, WA_MSEG LIKE LINE OF IT_MSEG.&lt;/P&gt;&lt;P&gt;DATA : IT_MKPF TYPE TABLE OF TY_MKPF, WA_MKPF LIKE LINE OF IT_MKPF.&lt;/P&gt;&lt;P&gt;DATA : IT_MSEG1 TYPE TABLE OF TY_MSEG1, WA_MSEG1 LIKE LINE OF IT_MSEG1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS :&lt;/P&gt;&lt;P&gt;   S_BUDAT FOR MKPF-BUDAT," OBLIGATORY,       " Posting Date.&lt;/P&gt;&lt;P&gt;   S_MATNR FOR MSEG-MATNR," OBLIGATORY.       " Material No.&lt;/P&gt;&lt;P&gt;   S_WERKS FOR MSEG-WERKS." OBLIGATORY,       " Plant&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;*&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT MBLNR MJAHR BUDAT&lt;/P&gt;&lt;P&gt;      INTO TABLE IT_MKPF&lt;/P&gt;&lt;P&gt;      FROM MKPF&lt;/P&gt;&lt;P&gt;      WHERE BUDAT IN S_BUDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF IT_MKPF IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT MBLNR MATNR ZEILE BWART CHARG EBELN SHKZG MENGE MEINS DMBTR WAERS&lt;/P&gt;&lt;P&gt;      FROM MSEG&lt;/P&gt;&lt;P&gt;      INTO TABLE IT_MSEG&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN IT_MKPF&lt;/P&gt;&lt;P&gt;      WHERE MBLNR = IT_MKPF-MBLNR AND&lt;/P&gt;&lt;P&gt;            MJAHR = IT_MKPF-MJAHR AND&lt;/P&gt;&lt;P&gt;            MATNR IN S_MATNR AND&lt;/P&gt;&lt;P&gt;            WERKS IN S_WERKS .&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*compared to the above For all entries, below Join can perform well &amp;amp; Good.&lt;/P&gt;&lt;P&gt;*&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT  A&lt;SUB&gt;MJAHR  A&lt;/SUB&gt;BUDAT B&lt;SUB&gt;MBLNR B&lt;/SUB&gt;MATNR B&lt;SUB&gt;ZEILE B&lt;/SUB&gt;BWART B~CHARG&lt;/P&gt;&lt;P&gt;          B&lt;SUB&gt;EBELN B&lt;/SUB&gt;SHKZG B&lt;SUB&gt;MENGE B&lt;/SUB&gt;MEINS B&lt;SUB&gt;DMBTR B&lt;/SUB&gt;WAERS&lt;/P&gt;&lt;P&gt;          INTO TABLE IT_MSEG1&lt;/P&gt;&lt;P&gt;          FROM MKPF AS A INNER JOIN MSEG AS B ON A&lt;SUB&gt;MBLNR = B&lt;/SUB&gt;MBLNR AND&lt;/P&gt;&lt;P&gt;                                                 A&lt;SUB&gt;MJAHR = B&lt;/SUB&gt;MJAHR&lt;/P&gt;&lt;P&gt;          WHERE A~BUDAT IN S_BUDAT AND&lt;/P&gt;&lt;P&gt;                B~MATNR IN S_MATNR AND&lt;/P&gt;&lt;P&gt;                B~WERKS IN S_WERKS .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Dileep .C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 07:02:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416982#M1243634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T07:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416983#M1243635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Moved to the correct forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 22:02:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416983#M1243635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T22:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416984#M1243636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Please use a meaningful subject in future&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Mar 2009 17:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416984#M1243636</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-03-28T17:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416985#M1243637</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;First of all, if it is only for doing a second fetch , you are using the internal table it_adhl, it is not required. Instead you can use the first internal table it_adhl1 itself. Becos it has  all the key fields in it . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By this way you can avoid a loop execution. This will improve the program performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before using the first internal table, sort and delete for adjacent duplicates. Also check whether the internal table is initial. If it is not initial, use it in the select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ramesh Sundaram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 10:52:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416985#M1243637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T10:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416986#M1243638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"If you are sure that BLART (Select-Option) is not made obligatory on sel-screen but still you&lt;/P&gt;&lt;P&gt;"expect it should have some value before the actual SELECTion from BKPF then check if for entries.&lt;/P&gt;&lt;P&gt;"This way you need not DEACTIVATE/Comment "BLART" is SELECT statement and thus no need for&lt;/P&gt;&lt;P&gt;"any LOOP and another Int. Table IT_ADHL based on Sel-Screen/Range BLART.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF NOT S_BLART IS INITIAL. "(Asssuming BLART as SELECT-OPTION so calling it S_BLART)

SELECT BUKRS BELNR GJAHR BLART BUDAT
  FROM BKPF
  INTO TABLE it_adhl
  WHERE BUKRS = 'TAFE' AND
               BLART IN S_BLART AND   "Uncommenting this line here from your code
               BSTAT IN BSTAT AND
               BUDAT IN BUDAT.
ENDIF.

SORT it_adhl BY bukrs belnr gjahr.
DELETE ADJACENT DUPLICATES FROM it_adhl COMPARING bukrs belnr gjahr.

IF NOT it_adhl IS INITIAL.
  SELECT BUKRS BELNR GJAHR BSCHL WRBTR HKONT GSBER MATNR 
    FROM BSEG
"    APPENDING TABLE IT_BSEG1
"Commenting above Assuming there is no previous or further need for Appending data into IT_BSEG1
    INTO TABLE it_bseg1
    FOR ALL ENTRIES IN it_adhl
    WHERE bukrs = it_adhl-bukrs AND
                 belnr = it_adhl-belnr AND
                 gjahr = it_adhl-gjahr AND
                 bschl IN ('40','50') AND
                 hkont IN s_hkont.  "Assuming s_hknot a SELECT-OPTION/RANGE
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"If there is still Performace Problem then check number of records fetched from BKPF table. If no. of records are too high then FOR ALL ENTRIES on BSEG would not yield performance and hence go for either of the 2 options below:&lt;/P&gt;&lt;P&gt;" (1) INNER JOIN on BKPF/BSEG&lt;/P&gt;&lt;P&gt;" (2) PACKAGE SIZE with SELECT statement for BKPF and fetch data from BSEG for those records&lt;/P&gt;&lt;P&gt;"in which case there could be multiple fetches from BKPF and thus from BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manuj Bhardwaj on May 26, 2009 10:50 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2009 20:27:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416986#M1243638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-26T20:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416987#M1243639</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 the below code and try to measure the time of your select queries in se30.&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;          blart&lt;/P&gt;&lt;P&gt;          budat&lt;/P&gt;&lt;P&gt;from bkpf&lt;/P&gt;&lt;P&gt;into table it_bkpf&lt;/P&gt;&lt;P&gt;where bukrs eq gc_tafe&lt;/P&gt;&lt;P&gt;and bstat in s_bstat &lt;/P&gt;&lt;P&gt;and budat in s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if it_bkpf-blart in s_blart and if it_bkpf[] is not 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;          bschl&lt;/P&gt;&lt;P&gt;          wrbtr&lt;/P&gt;&lt;P&gt;          hkont&lt;/P&gt;&lt;P&gt;          gsber&lt;/P&gt;&lt;P&gt;          matnr&lt;/P&gt;&lt;P&gt;from bseg&lt;/P&gt;&lt;P&gt;into table it_bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bkpf&lt;/P&gt;&lt;P&gt;where bukrs eq it_bkpf-bukrs&lt;/P&gt;&lt;P&gt;and belnr eq it_bkpf-belnr&lt;/P&gt;&lt;P&gt;and gjahr eq ity_bkpf-gjahr&lt;/P&gt;&lt;P&gt;and bschl in ( gc_40 , gc_50 )&lt;/P&gt;&lt;P&gt;and hkont in s_hkont.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rizwana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 13:17:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/5416987#M1243639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-27T13:17:33Z</dc:date>
    </item>
  </channel>
</rss>

