<?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/4820566#M1128138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santhosh,&lt;/P&gt;&lt;P&gt;Select all the records outside the loop and write read statement inside the loop.&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 from bseg into table t_item for all entries in t_hdr &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;P&gt;Loop at t_hdr into wa_hdr.&lt;/P&gt;&lt;P&gt;READ TABLE t_item  into w_item with key bukrs = wa_hdr-bukrs&lt;/P&gt;&lt;P&gt; belnr = wa_hdr-belnr&lt;/P&gt;&lt;P&gt;and gjahr = wa_hdr-gjahr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&amp;lt;ur code&amp;gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2008 08:12:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-26T08:12:33Z</dc:date>
    <item>
      <title>Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820562#M1128134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In loop select statement is there .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He was maintaining loop in one internal table and populating another internal table in select and &lt;/P&gt;&lt;P&gt;endselect programe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i am facing the performance probles please provide the code for this one.&lt;/P&gt;&lt;P&gt;&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;Thanks and regards&lt;/P&gt;&lt;P&gt;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2008 13:11:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820562#M1128134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-24T13:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820563#M1128135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi you can do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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 table t_item &lt;/P&gt;&lt;P&gt;from bseg&lt;/P&gt;&lt;P&gt;for all entries in t_hdr &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;P&gt;loop at t_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Skip record if not in selection screen range for state &lt;/P&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;modify  t_item index sy-tabix.&lt;/P&gt;&lt;P&gt;&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;clear t_item-hwbas.&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;Edited by: Srinivas Manchikalapati on Nov 26, 2008 5:41 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2008 14:56:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820563#M1128135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-24T14:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820564#M1128136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Try to use READ using index instead of looping the internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Data:
  w_line type i,
  w_int  type i.

Describe table itab lines w_line.

  Do w_line times.
    
    w_int = w_int + 1.
    Read table itab index w_int.
    ........

  
  Enddo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2008 14:58:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820564#M1128136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-25T14:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820565#M1128137</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 like this, Use for all entries statement in select statement and then read it with in the loop.&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 table t_item &lt;/P&gt;&lt;P&gt;from bseg&lt;/P&gt;&lt;P&gt;for all entries in t_hdr&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;P&gt;Loop at t_item .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table t_hdr with index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write ur code what ever you want inside this.&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;let me know if there are any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kusuma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 03:54:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820565#M1128137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T03:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820566#M1128138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santhosh,&lt;/P&gt;&lt;P&gt;Select all the records outside the loop and write read statement inside the loop.&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 from bseg into table t_item for all entries in t_hdr &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;P&gt;Loop at t_hdr into wa_hdr.&lt;/P&gt;&lt;P&gt;READ TABLE t_item  into w_item with key bukrs = wa_hdr-bukrs&lt;/P&gt;&lt;P&gt; belnr = wa_hdr-belnr&lt;/P&gt;&lt;P&gt;and gjahr = wa_hdr-gjahr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&amp;lt;ur code&amp;gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 08:12:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820566#M1128138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T08:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820567#M1128139</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 for all entries for the first select query instead of select in loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;step 1: Select all the records outside the loop and write read statement inside the loop.&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 from bseg into table t_item &lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_hdr &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;P&gt;step 2 : Now looping at this internal table do the validations at the and modify the internal table with the new values or &lt;/P&gt;&lt;P&gt;Inside the loop read the entries of the table into workarea with key values and then modify using the table key .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Skip record if not in selection screen range for state &lt;/P&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;modify t_item index sy-tabix.&lt;/P&gt;&lt;P&gt;&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;clear t_item-hwbas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 10:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4820567#M1128139</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T10:15:19Z</dc:date>
    </item>
  </channel>
</rss>

