<?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 Performance Issue in a report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792257#M1122432</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;     Can you please modify this code, i have performance issue for the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here: t_po is a final internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select  ekko&lt;SUB&gt;bukrs ekko&lt;/SUB&gt;ebeln ekko&lt;SUB&gt;lifnr ekko&lt;/SUB&gt;bsart    " EKKO&lt;/P&gt;&lt;P&gt;            ekko&lt;SUB&gt;ernam ekko&lt;/SUB&gt;aedat ekko~memory                " EKKO&lt;/P&gt;&lt;P&gt;            ekpo&lt;SUB&gt;ebelp ekpo&lt;/SUB&gt;idnlf ekpo&lt;SUB&gt;txz01 ekpo&lt;/SUB&gt;loekz     " EKPO&lt;/P&gt;&lt;P&gt;            ekpo&lt;SUB&gt;effwr ekpo&lt;/SUB&gt;menge                                      " EKPO  &lt;/P&gt;&lt;P&gt;            ekkn&lt;SUB&gt;sakto ekkn&lt;/SUB&gt;ps_psp_pnr                              " EKKN&lt;/P&gt;&lt;P&gt;            ekkn&lt;SUB&gt;zekkn ekkn&lt;/SUB&gt;menge                                    " EKKN   &lt;/P&gt;&lt;P&gt;            into (t_po-bukrs,t_po-ebeln,t_po-lifnr,t_po-bsart,&lt;/P&gt;&lt;P&gt;                  t_po-ernam,t_po-aedat,t_po-memory,&lt;/P&gt;&lt;P&gt;                  t_po-ebelp,t_po-idnlf,t_po-txz01,t_po-loekz,&lt;/P&gt;&lt;P&gt;                  t_po-effwr,t_po-menge,&lt;/P&gt;&lt;P&gt;                  t_po-sakto,t_po-ps_psp_pnr,&lt;/P&gt;&lt;P&gt;                  t_po-zekkn,t_po-menge1)&lt;/P&gt;&lt;P&gt;            from ( ekko inner join ekpo&lt;/P&gt;&lt;P&gt;            on   ekko&lt;SUB&gt;ebeln eq ekpo&lt;/SUB&gt;ebeln )&lt;/P&gt;&lt;P&gt;                 inner join ekkn&lt;/P&gt;&lt;P&gt;            on   ekko&lt;SUB&gt;ebeln eq ekkn&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;            and  ekpo&lt;SUB&gt;ebelp eq ekkn&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;            for all entries in t_pspnr           &lt;/P&gt;&lt;P&gt;            where ekko~bukrs      in s_bukrs  and&lt;/P&gt;&lt;P&gt;                  ekko~lifnr      in s_lifnr  and&lt;/P&gt;&lt;P&gt;                  ekko~bsart      in s_bsart  and&lt;/P&gt;&lt;P&gt;                  ekko~aedat      in s_aedat  and&lt;/P&gt;&lt;P&gt;                  ekko~ernam      in s_ernam  and&lt;/P&gt;&lt;P&gt;                  ekpo~idnlf      in s_idnlf  and&lt;/P&gt;&lt;P&gt;                  ps_psp_pnr      =  t_pspnr-pspnr.    &lt;/P&gt;&lt;P&gt;      append t_po.&lt;/P&gt;&lt;P&gt;      clear  t_po.&lt;/P&gt;&lt;P&gt;    endselect.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Another code:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;  sort t_po by bukrs idnlf ebeln ebelp.&lt;/P&gt;&lt;P&gt;  loop at t_po.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select single post1 psphi into (t_po-post1,t_po-psphi)             "Performance issue&lt;/P&gt;&lt;P&gt;                  from prps&lt;/P&gt;&lt;P&gt;                  where pspnr = t_po-ps_psp_pnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select single pspid into t_po-pspid                                         ""Performance issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  from proj&lt;/P&gt;&lt;P&gt;                  where pspnr = t_po-psphi.&lt;/P&gt;&lt;P&gt;    if t_po-pspid in s_pspid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do nothing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      delete t_po index sy-tabix.&lt;/P&gt;&lt;P&gt;      continue.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get invoiced amount for a PO line item&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select dmbtr shkzg into (ekbe-dmbtr,ekbe-shkzg)              ""Performance issue&lt;/P&gt;&lt;P&gt;              from ekbe&lt;/P&gt;&lt;P&gt;              where ebeln = t_po-ebeln and&lt;/P&gt;&lt;P&gt;                    ebelp = t_po-ebelp and&lt;/P&gt;&lt;P&gt;                    vgabe = '2'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if ekbe-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;        ekbe-dmbtr = ekbe-dmbtr * -1.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      t_po-invamt = t_po-invamt + ekbe-dmbtr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endselect.                                                                                ""Performance issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if not t_po-menge eq 0.&lt;/P&gt;&lt;P&gt;      t_po-polinamt = t_po-effwr * ( t_po-menge1 / t_po-menge ).&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    t_po-amtopen  = t_po-polinamt - t_po-invamt.&lt;/P&gt;&lt;P&gt;    modify t_po index sy-tabix.&lt;/P&gt;&lt;P&gt;    clear: t_po,prps,ekbe,proj.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Nov 2008 09:07:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-18T09:07:15Z</dc:date>
    <item>
      <title>Performance Issue in a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792257#M1122432</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;     Can you please modify this code, i have performance issue for the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here: t_po is a final internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select  ekko&lt;SUB&gt;bukrs ekko&lt;/SUB&gt;ebeln ekko&lt;SUB&gt;lifnr ekko&lt;/SUB&gt;bsart    " EKKO&lt;/P&gt;&lt;P&gt;            ekko&lt;SUB&gt;ernam ekko&lt;/SUB&gt;aedat ekko~memory                " EKKO&lt;/P&gt;&lt;P&gt;            ekpo&lt;SUB&gt;ebelp ekpo&lt;/SUB&gt;idnlf ekpo&lt;SUB&gt;txz01 ekpo&lt;/SUB&gt;loekz     " EKPO&lt;/P&gt;&lt;P&gt;            ekpo&lt;SUB&gt;effwr ekpo&lt;/SUB&gt;menge                                      " EKPO  &lt;/P&gt;&lt;P&gt;            ekkn&lt;SUB&gt;sakto ekkn&lt;/SUB&gt;ps_psp_pnr                              " EKKN&lt;/P&gt;&lt;P&gt;            ekkn&lt;SUB&gt;zekkn ekkn&lt;/SUB&gt;menge                                    " EKKN   &lt;/P&gt;&lt;P&gt;            into (t_po-bukrs,t_po-ebeln,t_po-lifnr,t_po-bsart,&lt;/P&gt;&lt;P&gt;                  t_po-ernam,t_po-aedat,t_po-memory,&lt;/P&gt;&lt;P&gt;                  t_po-ebelp,t_po-idnlf,t_po-txz01,t_po-loekz,&lt;/P&gt;&lt;P&gt;                  t_po-effwr,t_po-menge,&lt;/P&gt;&lt;P&gt;                  t_po-sakto,t_po-ps_psp_pnr,&lt;/P&gt;&lt;P&gt;                  t_po-zekkn,t_po-menge1)&lt;/P&gt;&lt;P&gt;            from ( ekko inner join ekpo&lt;/P&gt;&lt;P&gt;            on   ekko&lt;SUB&gt;ebeln eq ekpo&lt;/SUB&gt;ebeln )&lt;/P&gt;&lt;P&gt;                 inner join ekkn&lt;/P&gt;&lt;P&gt;            on   ekko&lt;SUB&gt;ebeln eq ekkn&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;            and  ekpo&lt;SUB&gt;ebelp eq ekkn&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;            for all entries in t_pspnr           &lt;/P&gt;&lt;P&gt;            where ekko~bukrs      in s_bukrs  and&lt;/P&gt;&lt;P&gt;                  ekko~lifnr      in s_lifnr  and&lt;/P&gt;&lt;P&gt;                  ekko~bsart      in s_bsart  and&lt;/P&gt;&lt;P&gt;                  ekko~aedat      in s_aedat  and&lt;/P&gt;&lt;P&gt;                  ekko~ernam      in s_ernam  and&lt;/P&gt;&lt;P&gt;                  ekpo~idnlf      in s_idnlf  and&lt;/P&gt;&lt;P&gt;                  ps_psp_pnr      =  t_pspnr-pspnr.    &lt;/P&gt;&lt;P&gt;      append t_po.&lt;/P&gt;&lt;P&gt;      clear  t_po.&lt;/P&gt;&lt;P&gt;    endselect.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Another code:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;  sort t_po by bukrs idnlf ebeln ebelp.&lt;/P&gt;&lt;P&gt;  loop at t_po.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select single post1 psphi into (t_po-post1,t_po-psphi)             "Performance issue&lt;/P&gt;&lt;P&gt;                  from prps&lt;/P&gt;&lt;P&gt;                  where pspnr = t_po-ps_psp_pnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select single pspid into t_po-pspid                                         ""Performance issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  from proj&lt;/P&gt;&lt;P&gt;                  where pspnr = t_po-psphi.&lt;/P&gt;&lt;P&gt;    if t_po-pspid in s_pspid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do nothing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      delete t_po index sy-tabix.&lt;/P&gt;&lt;P&gt;      continue.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get invoiced amount for a PO line item&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select dmbtr shkzg into (ekbe-dmbtr,ekbe-shkzg)              ""Performance issue&lt;/P&gt;&lt;P&gt;              from ekbe&lt;/P&gt;&lt;P&gt;              where ebeln = t_po-ebeln and&lt;/P&gt;&lt;P&gt;                    ebelp = t_po-ebelp and&lt;/P&gt;&lt;P&gt;                    vgabe = '2'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if ekbe-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;        ekbe-dmbtr = ekbe-dmbtr * -1.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      t_po-invamt = t_po-invamt + ekbe-dmbtr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endselect.                                                                                ""Performance issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if not t_po-menge eq 0.&lt;/P&gt;&lt;P&gt;      t_po-polinamt = t_po-effwr * ( t_po-menge1 / t_po-menge ).&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    t_po-amtopen  = t_po-polinamt - t_po-invamt.&lt;/P&gt;&lt;P&gt;    modify t_po index sy-tabix.&lt;/P&gt;&lt;P&gt;    clear: t_po,prps,ekbe,proj.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2008 09:07:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792257#M1122432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-18T09:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue in a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792258#M1122433</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;Instead of selecting each fields and putting it in each fileds in internal table, we can select the fields and put it into the internal table which contains the required fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: begin of itab,&lt;/P&gt;&lt;P&gt;             vorna type vorna,&lt;/P&gt;&lt;P&gt;            nachn type nachn,&lt;/P&gt;&lt;P&gt;            end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wt_itab type table of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vorna, nachn into table wt_itab from pa0002 where cond.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This increase the performance because it wont take time to match the each fields given after the table statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2008 09:14:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792258#M1122433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-18T09:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue in a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792259#M1122434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a non-unique or a secondary index using Se11 on the table with the fields you are using in your select clause.&lt;/P&gt;&lt;P&gt;Run St05 again after creating the index and there will be improvement in performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2008 09:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792259#M1122434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-18T09:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue in a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792260#M1122435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First and foremost you need to remove the endselect and instead use &lt;STRONG&gt;into table&lt;/STRONG&gt; . &lt;/P&gt;&lt;P&gt;Then before the query is called, check that the table t_pspnr  is not empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of doing a select inside the loop, select the data once in a internal table and read it within the loop. in your code the tables are prps ekbe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2008 09:36:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792260#M1122435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-18T09:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue in a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792261#M1122436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please declare ur internal table in the order in which you are selecting.&lt;/P&gt;&lt;P&gt;and use into table itab instead of mentioning  each and every field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also avoid using select endselect. instead u can use into table itab option with the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use&lt;/P&gt;&lt;P&gt; 'If not t_pspnr  is intial'.&lt;/P&gt;&lt;P&gt;before using for all entries in t_pspnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Sudheer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: sudheer kumar on Nov 18, 2008 11:09 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2008 10:08:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-in-a-report/m-p/4792261#M1122436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-18T10:08:20Z</dc:date>
    </item>
  </channel>
</rss>

