<?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 problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332614#M513406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends ,&lt;/P&gt;&lt;P&gt;Below is the one of the perform in my program which is taking more time .. Can you please suggest me to find a solution to take less time for execution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Adv .&lt;/P&gt;&lt;P&gt;Varma ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_count TYPE i.&lt;/P&gt;&lt;P&gt;SELECT m~customer&lt;/P&gt;&lt;P&gt;m~name&lt;/P&gt;&lt;P&gt;m~payer&lt;/P&gt;&lt;P&gt;t~txtmd&lt;/P&gt;&lt;P&gt;INTO TABLE gt_cust2&lt;/P&gt;&lt;P&gt;FROM /bi0/pcustomer AS m&lt;/P&gt;&lt;P&gt;JOIN /bi0/tcustomer AS t&lt;/P&gt;&lt;P&gt;ON m&lt;SUB&gt;customer EQ t&lt;/SUB&gt;customer&lt;/P&gt;&lt;P&gt;WHERE m~objvers EQ 'A'&lt;/P&gt;&lt;P&gt;AND m~accnt_grp NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT gt_cust2 BY customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT m~customer&lt;/P&gt;&lt;P&gt;m~name&lt;/P&gt;&lt;P&gt;m~payer&lt;/P&gt;&lt;P&gt;t~txtmd&lt;/P&gt;&lt;P&gt;INTO TABLE gt_cust&lt;/P&gt;&lt;P&gt;FROM /bi0/pcustomer AS m&lt;/P&gt;&lt;P&gt;JOIN /bi0/tcustomer AS t&lt;/P&gt;&lt;P&gt;ON m&lt;SUB&gt;customer EQ t&lt;/SUB&gt;customer&lt;/P&gt;&lt;P&gt;WHERE m~objvers EQ 'A'&lt;/P&gt;&lt;P&gt;AND m~accnt_grp IN s_ktokd&lt;/P&gt;&lt;P&gt;AND m~payer NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;SORT gt_cust BY customer.&lt;/P&gt;&lt;P&gt;LOOP AT gt_cust.&lt;/P&gt;&lt;P&gt;CLEAR l_count.&lt;/P&gt;&lt;P&gt;LOOP AT gt_cust2 WHERE payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;ADD 1 TO l_count.&lt;/P&gt;&lt;P&gt;IF l_count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;gt_soldto-customer = gt_cust-customer.&lt;/P&gt;&lt;P&gt;gt_soldto-payer = gt_payer-payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;IF l_count &amp;gt; 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Payer found&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR gt_cust2.&lt;/P&gt;&lt;P&gt;READ TABLE gt_cust2 WITH KEY customer = gt_cust-payer&lt;/P&gt;&lt;P&gt;BINARY SEARCH.&lt;/P&gt;&lt;P&gt;IF NOT gt_cust2-name IS INITIAL.&lt;/P&gt;&lt;P&gt;gt_payer-name = gt_cust2-name.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;gt_payer-name = gt_cust2-txtmd.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Stand alone customer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gt_soldto-payer = gt_payer-payer = p_nonpyr.&lt;/P&gt;&lt;P&gt;gt_payer-name = p_nonpnm.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;COLLECT: gt_soldto,&lt;/P&gt;&lt;P&gt;gt_payer.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;SORT: gt_soldto,&lt;/P&gt;&lt;P&gt;gt_payer.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 May 2007 11:52:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-31T11:52:38Z</dc:date>
    <item>
      <title>Performance problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332614#M513406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends ,&lt;/P&gt;&lt;P&gt;Below is the one of the perform in my program which is taking more time .. Can you please suggest me to find a solution to take less time for execution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Adv .&lt;/P&gt;&lt;P&gt;Varma ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_count TYPE i.&lt;/P&gt;&lt;P&gt;SELECT m~customer&lt;/P&gt;&lt;P&gt;m~name&lt;/P&gt;&lt;P&gt;m~payer&lt;/P&gt;&lt;P&gt;t~txtmd&lt;/P&gt;&lt;P&gt;INTO TABLE gt_cust2&lt;/P&gt;&lt;P&gt;FROM /bi0/pcustomer AS m&lt;/P&gt;&lt;P&gt;JOIN /bi0/tcustomer AS t&lt;/P&gt;&lt;P&gt;ON m&lt;SUB&gt;customer EQ t&lt;/SUB&gt;customer&lt;/P&gt;&lt;P&gt;WHERE m~objvers EQ 'A'&lt;/P&gt;&lt;P&gt;AND m~accnt_grp NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT gt_cust2 BY customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT m~customer&lt;/P&gt;&lt;P&gt;m~name&lt;/P&gt;&lt;P&gt;m~payer&lt;/P&gt;&lt;P&gt;t~txtmd&lt;/P&gt;&lt;P&gt;INTO TABLE gt_cust&lt;/P&gt;&lt;P&gt;FROM /bi0/pcustomer AS m&lt;/P&gt;&lt;P&gt;JOIN /bi0/tcustomer AS t&lt;/P&gt;&lt;P&gt;ON m&lt;SUB&gt;customer EQ t&lt;/SUB&gt;customer&lt;/P&gt;&lt;P&gt;WHERE m~objvers EQ 'A'&lt;/P&gt;&lt;P&gt;AND m~accnt_grp IN s_ktokd&lt;/P&gt;&lt;P&gt;AND m~payer NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;SORT gt_cust BY customer.&lt;/P&gt;&lt;P&gt;LOOP AT gt_cust.&lt;/P&gt;&lt;P&gt;CLEAR l_count.&lt;/P&gt;&lt;P&gt;LOOP AT gt_cust2 WHERE payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;ADD 1 TO l_count.&lt;/P&gt;&lt;P&gt;IF l_count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;gt_soldto-customer = gt_cust-customer.&lt;/P&gt;&lt;P&gt;gt_soldto-payer = gt_payer-payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;IF l_count &amp;gt; 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Payer found&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR gt_cust2.&lt;/P&gt;&lt;P&gt;READ TABLE gt_cust2 WITH KEY customer = gt_cust-payer&lt;/P&gt;&lt;P&gt;BINARY SEARCH.&lt;/P&gt;&lt;P&gt;IF NOT gt_cust2-name IS INITIAL.&lt;/P&gt;&lt;P&gt;gt_payer-name = gt_cust2-name.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;gt_payer-name = gt_cust2-txtmd.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Stand alone customer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gt_soldto-payer = gt_payer-payer = p_nonpyr.&lt;/P&gt;&lt;P&gt;gt_payer-name = p_nonpnm.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;COLLECT: gt_soldto,&lt;/P&gt;&lt;P&gt;gt_payer.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;SORT: gt_soldto,&lt;/P&gt;&lt;P&gt;gt_payer.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 11:52:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332614#M513406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T11:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332615#M513407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok what i would do is not to do 2 of such big selects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your first select and your second select are almost identical.&lt;/P&gt;&lt;P&gt;Only yout got one more condition in your second select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this again means your recordset you gain from your second select is just a subset of the reocrdset you gain with your first select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This again means you dont need to go down to the DB another time, since all the data you need is already in your internal table you fill with your first select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your first select you need to add the fields for which in your second select conditions exist.&lt;/P&gt;&lt;P&gt;Then you can do your second select not on the DB-table but on your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Statement for this is "READ TABLE" instead of SELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:01:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332615#M513407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332616#M513408</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;LOOP AT gt_cust.&amp;lt;b&amp;gt;use loop  assigning field symbol&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;CLEAR l_count.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;LOOP AT gt_cust2 WHERE payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;ADD 1 TO l_count.&lt;/P&gt;&lt;P&gt;IF l_count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just do a read  gt_cust2  into Wa_cust2 where payer = gt_cust-payer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:03:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332616#M513408</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-05-31T12:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332617#M513409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi varma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use for all entries instead of innerjoin and try to avoid nested loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;seshu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:12:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332617#M513409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332618#M513410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are there any other ways ... Please suggest ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;Varma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:12:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem/m-p/2332618#M513410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:12:53Z</dc:date>
    </item>
  </channel>
</rss>

