<?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: re: performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037538#M85510</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi paluri krishna prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           From your code i can understand that for each entry in the internal table you want &amp;lt;b&amp;gt;ebeln&amp;lt;/b&amp;gt; field from the &amp;lt;b&amp;gt;ekpo&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;For that &amp;lt;b&amp;gt;ebeln&amp;lt;/b&amp;gt; you want &amp;lt;b&amp;gt;bedat&amp;lt;/b&amp;gt; from &amp;lt;b&amp;gt;ekko&amp;lt;/b&amp;gt;. Right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Instead of &amp;lt;b&amp;gt;loop at&amp;lt;/b&amp;gt; it_one use &amp;lt;b&amp;gt;For all entries&amp;lt;/b&amp;gt;. Remember before using for all entries you have to check whether itab is initial or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use &amp;lt;b&amp;gt;sy_subrc&amp;lt;/b&amp;gt; statement before select single which increase your performance in the abap side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maheswaran.B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Dec 2005 04:26:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-21T04:26:39Z</dc:date>
    <item>
      <title>re: performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037537#M85509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Iam using this code. How can i improve this performance. In the first statement i retriving the created po's for each pr and in the select statement i am retriveing the posting date for each po. it_one contains the pr and pr items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ebeln into ebeln  from ekpo&lt;/P&gt;&lt;P&gt;      where banfn = it_one-banfn&lt;/P&gt;&lt;P&gt;        and bnfpo = it_one-bnfpo&lt;/P&gt;&lt;P&gt;        and loekz &amp;lt;&amp;gt; 'L'.&lt;/P&gt;&lt;P&gt;       select single bedat from ekko&lt;/P&gt;&lt;P&gt;                  into podat&lt;/P&gt;&lt;P&gt;              where ebeln = ebeln.&lt;/P&gt;&lt;P&gt;**&lt;STRONG&gt;for processing the bedat&lt;/STRONG&gt;***&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       z = z + 1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       if podat &amp;lt;&amp;gt; 0 and badat &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       po_ba = podat - badat.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       po_ba1 = po_ba1 + po_ba.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       clear: podat.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;p.kp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 04:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037537#M85509</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T04:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: re: performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037538#M85510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi paluri krishna prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           From your code i can understand that for each entry in the internal table you want &amp;lt;b&amp;gt;ebeln&amp;lt;/b&amp;gt; field from the &amp;lt;b&amp;gt;ekpo&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;For that &amp;lt;b&amp;gt;ebeln&amp;lt;/b&amp;gt; you want &amp;lt;b&amp;gt;bedat&amp;lt;/b&amp;gt; from &amp;lt;b&amp;gt;ekko&amp;lt;/b&amp;gt;. Right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Instead of &amp;lt;b&amp;gt;loop at&amp;lt;/b&amp;gt; it_one use &amp;lt;b&amp;gt;For all entries&amp;lt;/b&amp;gt;. Remember before using for all entries you have to check whether itab is initial or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use &amp;lt;b&amp;gt;sy_subrc&amp;lt;/b&amp;gt; statement before select single which increase your performance in the abap side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maheswaran.B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 04:26:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037538#M85510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T04:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: re: performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037539#M85511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that EKPO is a very large table and you are not selecting from it based on an index. To fix it, we need to know how you are filling it_one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 04:35:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037539#M85511</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T04:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: re: performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037540#M85512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paluri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of tbl_ekko occurs 0,
        banfn  like ekpo-banfn,
        bedat  like ekko-bedat,
      end of tbl_ekko.

check not it_one[] is initial.

select ekpo~banfn ekko~bedat
       into table tbl_ekko
       from ekko

       inner join ekpo
       on ekko~ebeln = ekpo~ebeln

       for all entries in it_one
       where ekpo~bnfpo = it_one-banfn and
             ekpo~loekz ne 'L'.

* Prepare Table for Binary Search
sort tbl_ekko by banfn.

loop at it_one.
  read table tbl_ekko with key banfn = it_one-banfn 
                           binary search.
  if sy-subrc eq 0.

** do processing logic here.

  endif.

endloop. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method would be more efficient than your current method as it uses an ARRAY FETCH (ie it reads the database once and stores the relevant data into an internal table - this lowers the load onthe DB) and then uses a Binary Search to process the data (the main processing is done on your App Server which is scalable). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would also recommend using a proper index for EKPO as BANFN alone is not an index and can lead to an inefficient query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 04:40:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037540#M85512</guid>
      <dc:creator>former_member221770</dc:creator>
      <dc:date>2005-12-21T04:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: re: performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037541#M85513</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 will try this and i will let u know.&lt;/P&gt;&lt;P&gt;             Thanks for quick response&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;p.kp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 04:46:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037541#M85513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T04:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: re: performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037542#M85514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Suppose i don't want to change my code. I want to create a secondary indexes in ekpo for fields banfn and bnfpo.  Then performance will increase in my opinion. Is it recommendable or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgs&lt;/P&gt;&lt;P&gt;p.kp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 05:05:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037542#M85514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T05:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: re: performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037543#M85515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paluri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP recommends that tables not have more than 5-6 secondary indexes. This is because each secondary index needs a separate db table and each time the system updates the table it also needs to update the tables behind the secondary indexes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By putting creating the secondary index, the performance of your query SHOULD improve but this MAY come at a cost when you save your PO's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would recommend running transaction DB05 to see if your proposed index is worthwhile or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 05:12:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037543#M85515</guid>
      <dc:creator>former_member221770</dc:creator>
      <dc:date>2005-12-21T05:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: re: performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037544#M85516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should not create indexes based on your retrieval performance. Imagine the load the system takes everytime you create or change a PO, particularly if you have a steady rate of PO creation and changes. Every time a new PO is added or changed, system has to reindex and that adds more burden to the processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should tackle it in your code only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 05:13:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-performance/m-p/1037544#M85516</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T05:13:39Z</dc:date>
    </item>
  </channel>
</rss>

