<?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 tunning in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959174#M698101</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides doing what the others recommended, make absolutely sure that there are no initial records in your "for all entries" table... i've found that to be the problem in some cases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2007 20:36:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-22T20:36:52Z</dc:date>
    <item>
      <title>performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959166#M698093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi there,&lt;/P&gt;&lt;P&gt;i have coding part like this:&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR BUZEI BSCHL DMBTR WRBTR PSWSL ZUONR SGTXT KO HK KUNNR WERKS MENGE MEINS&lt;/P&gt;&lt;P&gt;FROM BS APPENDING TABLE itab1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN itab &lt;/P&gt;&lt;P&gt;WHERE BUKRS = S_BUKRS&lt;/P&gt;&lt;P&gt;AND BELNR = T_BSIS-BELNR AND BUZEI = T_BSIS-BUZEI&lt;/P&gt;&lt;P&gt;AND KO IN ('JTH2003352', 'JTH2003353', 'JTH2003370',&lt;/P&gt;&lt;P&gt;'JTH2003371', 'JTH2003372', 'JTH5001320',&lt;/P&gt;&lt;P&gt;'JTH2000023', 'JTH2000024', 'JTH2000028')&lt;/P&gt;&lt;P&gt;AND HK IN ('0040000110', '0040000120').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when execute, it increase my runtime. how to solve this problem.&lt;/P&gt;&lt;P&gt;pls advise. thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 09:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959166#M698093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T09:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959167#M698094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;do like below&lt;/P&gt;&lt;P&gt;if itab[] is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR BUZEI BSCHL DMBTR WRBTR PSWSL ZUONR SGTXT KO HK KUNNR WERKS MENGE MEINS&lt;/P&gt;&lt;P&gt;FROM BSET  into TABLE itab1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN itab &lt;/P&gt;&lt;P&gt;WHERE BUKRS IN S_BUKRS&lt;/P&gt;&lt;P&gt;AND BELNR = T_BSIS-BELNR AND BUZEI = T_BSIS-BUZEI&lt;/P&gt;&lt;P&gt;AND KO IN ('JTH2003352', 'JTH2003353', 'JTH2003370',&lt;/P&gt;&lt;P&gt;'JTH2003371', 'JTH2003372', 'JTH5001320',&lt;/P&gt;&lt;P&gt;'JTH2000023', 'JTH2000024', 'JTH2000028')&lt;/P&gt;&lt;P&gt;AND HK IN ('0040000110', '0040000120').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 09:17:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959167#M698094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T09:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959168#M698095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AND BELNR = T_BSIS-BELNR AND BUZEI = T_BSIS-BUZEI&lt;/P&gt;&lt;P&gt; u are using for all entries in ITAB but in where clause u are using T_BSIS. I dont understand why... it should match.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 09:18:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959168#M698095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T09:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959169#M698096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, the coding actually like this:&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR BUZEI BSCHL DMBTR WRBTR PSWSL ZUONR SGTXT KO HK KUNNR WERKS MENGE MEINS&lt;/P&gt;&lt;P&gt;FROM BSEG APPENDING TABLE itab1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN T_BSIS &lt;/P&gt;&lt;P&gt;WHERE BUKRS = S_BUKRS&lt;/P&gt;&lt;P&gt;AND BELNR = T_BSIS-BELNR AND BUZEI = T_BSIS-BUZEI&lt;/P&gt;&lt;P&gt;AND KO IN ('JTH2003352', 'JTH2003353', 'JTH2003370',&lt;/P&gt;&lt;P&gt;'JTH2003371', 'JTH2003372', 'JTH5001320',&lt;/P&gt;&lt;P&gt;'JTH2000023', 'JTH2000024', 'JTH2000028')&lt;/P&gt;&lt;P&gt;AND HK IN ('0040000110', '0040000120').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but my T_BSIS is always have records and the amount is huge. &lt;/P&gt;&lt;P&gt;any other way to improve it?&lt;/P&gt;&lt;P&gt;pls advise. thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 09:28:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959169#M698096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T09:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959170#M698097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Use the complete primary key BUKRS, BELNR, GJAHR, BUZEI of BSEG in the where clause. table BSIS has all these fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Delete adjacent duplicates to eliminate duplicate entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Do not use APPENDING TABLES when the table to which you are appending is empty. Check if the table contains any data. If so use APPENDING tables. Otherwise use INTO TABLES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) I am not sure what KO and HK are. They are not feilds on thatble BSEG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: t_bsis_tmp LIKE TABLE OF t_bsis.

IF NOT t_bsis[] IS INITAIL.

  t_bsis_tmp[] = t_bsis[].

  SORT t_bsis_tmp BY bukrs belnr gjahr buzei.

  DELETE ADJACENT DUPLICATES FROM t_bsis_tmp COMPARING
    bukrs
    belnr
    gjahr
    buzei.

  IF itab1[] IS INITIAL.

    SELECT bukrs
           belnr
           gjahr
           buzei
           bschl
           dmbtr
           wrbtr
           pswsl
           zuonr
           sgtxt
           ko
           hk
           kunnr
           werks
           menge
           meins
    FROM bseg
    INTO TABLE itab1
    FOR ALL ENTRIES IN t_bsis_tmp
    WHERE bukrs EQ s_bukrs
    AND   bukrs EQ t_bsis_tmp-bukrs
    AND   belnr EQ t_bsis_tmp-belnr
    AND   gjahr EQ t_bsis_tmp-gjahr
    AND   buzei EQ t_bsis_tmp-buzei
    AND   ko    IN ('JTH2003352', 'JTH2003353', 'JTH2003370',
                    'JTH2003371', 'JTH2003372', 'JTH5001320',
                    'JTH2000023', 'JTH2000024', 'JTH2000028')
    AND   hk    IN ('0040000110', '0040000120').

  ELSE.

    SELECT bukrs
           belnr
           gjahr
           buzei
           bschl
           dmbtr
           wrbtr
           pswsl
           zuonr
           sgtxt
           ko
           hk
           kunnr
           werks
           menge
           meins
    FROM bseg
    APPENDING TABLE itab1
    FOR ALL ENTRIES IN t_bsis_tmp
    WHERE bukrs EQ s_bukrs
    AND   bukrs EQ t_bsis_tmp-bukrs
    AND   belnr EQ t_bsis_tmp-belnr
    AND   gjahr EQ t_bsis_tmp-gjahr
    AND   buzei EQ t_bsis_tmp-buzei
    AND   ko    IN ('JTH2003352', 'JTH2003353', 'JTH2003370',
                    'JTH2003371', 'JTH2003372', 'JTH5001320',
                    'JTH2000023', 'JTH2000024', 'JTH2000028')
    AND   hk    IN ('0040000110', '0040000120').

  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 13:19:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959170#M698097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T13:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959171#M698098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select BUKRS also from bsis into the internal table instead of putting s_bukrs&lt;/P&gt;&lt;P&gt;if t_bsis[] is not initial.&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR BUZEI BSCHL DMBTR WRBTR PSWSL ZUONR SGTXT KO HK KUNNR WERKS MENGE MEINS&lt;/P&gt;&lt;P&gt;FROM BSeg into TABLE itab1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_bsis WHERE BUKRS = t_bsis-bukrs&lt;/P&gt;&lt;P&gt;AND BELNR = T_BSIS-BELNR AND BUZEI = T_BSIS-BUZEI&lt;/P&gt;&lt;P&gt;AND KO IN ('JTH2003352', 'JTH2003353', 'JTH2003370',&lt;/P&gt;&lt;P&gt;'JTH2003371', 'JTH2003372', 'JTH5001320',&lt;/P&gt;&lt;P&gt;'JTH2000023', 'JTH2000024', 'JTH2000028')&lt;/P&gt;&lt;P&gt;AND HK IN ('0040000110', '0040000120').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;try to fetch maximum key fields from BSIS and provide it into BSEG in the above select.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 13:28:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959171#M698098</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T13:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959172#M698099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It doesn't look too bad. You could try to add the fiscal year to the SELECT, but it won't help a lot. If you are going to SELECT a lot of data, it will take time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also try adding the fiscal year and company code to your internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CHECK NOT  t_bsis[] IS INITIAL.
SORT t_bsis BY bukrs belnr gjahr buzei.

SELECT bukrs belnr gjahr buzei bschl dmbtr wrbtr pswsl zuonr sgtxt ko hk
       kunnr werks menge meins
  FROM bseg APPENDING TABLE itab1
  FOR ALL ENTRIES IN t_bsis
  WHERE bukrs = t_bsis-bukrs
    AND belnr = t_bsis-belnr
    AND gjahr = t_bsis-gjahr
    AND buzei = t_bsis-buzei
    AND ko IN ('JTH2003352', 'JTH2003353', 'JTH2003370',
               'JTH2003371', 'JTH2003372', 'JTH5001320',
               'JTH2000023', 'JTH2000024', 'JTH2000028')
    AND hk IN ('0040000110', '0040000120').
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Added SORT as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 13:49:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959172#M698099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T13:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959173#M698100</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 can give only the key fields in the select statement and after having populated the itab1, filter the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR BUZEI BSCHL DMBTR WRBTR PSWSL ZUONR SGTXT KO HK KUNNR WERKS MENGE MEINS&lt;/P&gt;&lt;P&gt;FROM BSEG APPENDING TABLE itab1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN T_BSIS &lt;/P&gt;&lt;P&gt;WHERE BUKRS = S_BUKRS&lt;/P&gt;&lt;P&gt;AND BELNR = T_BSIS-BELNR &lt;/P&gt;&lt;P&gt;AND BUZEI  = T_BSIS-BUZEI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE itab1 where not &lt;/P&gt;&lt;P&gt;( KO IN ('JTH2003352', 'JTH2003353', 'JTH2003370',&lt;/P&gt;&lt;P&gt;'JTH2003371', 'JTH2003372', 'JTH5001320',&lt;/P&gt;&lt;P&gt;'JTH2000023', 'JTH2000024', 'JTH2000028')&lt;/P&gt;&lt;P&gt;AND &lt;/P&gt;&lt;P&gt;HK IN ('0040000110', '0040000120') ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way, you would be using the primary index and will help in optimizing your select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Navneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 14:02:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959173#M698100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T14:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: performance tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959174#M698101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides doing what the others recommended, make absolutely sure that there are no initial records in your "for all entries" table... i've found that to be the problem in some cases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 20:36:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2959174#M698101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T20:36:52Z</dc:date>
    </item>
  </channel>
</rss>

