<?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 tuning in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/920471#M58803</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;Hey guys,&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;I have two things to confirm regarding performance in abap program.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;1-Comparision of Loop..Endloop stmt in SELECT query and &lt;/P&gt;&lt;P&gt;  Selectoption parameter IN option in SELECT query.&lt;/P&gt;&lt;P&gt;  (which process is more fast in performance.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2-Could you pls confirm whether Code-2 is more faster than code-1 operation.?&lt;/P&gt;&lt;P&gt;if so can you pls tell will the result of both code-1 and 2 are same?&lt;/P&gt;&lt;P&gt;Here wk_monat is Month(duration) input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Code-1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;WK_MONAT = '01'.&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;SELECT BELNR BUZEI BLART MWSKZ HKONT SHKZG DMBTR&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS&lt;/P&gt;&lt;P&gt;FROM BSIS WHERE BUKRS = itab_t001-BUKRS AND &lt;/P&gt;&lt;P&gt;GJAHR = P_GJAHR AND &amp;lt;b&amp;gt;MONAT = WK_MONAT&amp;lt;/b&amp;gt; AND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WK_MONAT = WK_MONAT + 1.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;COde-2&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;wk_monat is parameter.&lt;/P&gt;&lt;P&gt;SELECT BELNR BUZEI BLART MWSKZ HKONT SHKZG DMBTR&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS&lt;/P&gt;&lt;P&gt;FROM BSIS WHERE BUKRS = itab_t001-BUKRS AND &lt;/P&gt;&lt;P&gt;GJAHR = P_GJAHR AND &amp;lt;b&amp;gt;MONAT &amp;lt;= WK_MONAT&amp;lt;/b&amp;gt; AND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ambichan.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Mar 2005 04:18:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-03-27T04:18:11Z</dc:date>
    <item>
      <title>Performance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/920471#M58803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;Hey guys,&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;I have two things to confirm regarding performance in abap program.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;1-Comparision of Loop..Endloop stmt in SELECT query and &lt;/P&gt;&lt;P&gt;  Selectoption parameter IN option in SELECT query.&lt;/P&gt;&lt;P&gt;  (which process is more fast in performance.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2-Could you pls confirm whether Code-2 is more faster than code-1 operation.?&lt;/P&gt;&lt;P&gt;if so can you pls tell will the result of both code-1 and 2 are same?&lt;/P&gt;&lt;P&gt;Here wk_monat is Month(duration) input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Code-1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;WK_MONAT = '01'.&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;SELECT BELNR BUZEI BLART MWSKZ HKONT SHKZG DMBTR&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS&lt;/P&gt;&lt;P&gt;FROM BSIS WHERE BUKRS = itab_t001-BUKRS AND &lt;/P&gt;&lt;P&gt;GJAHR = P_GJAHR AND &amp;lt;b&amp;gt;MONAT = WK_MONAT&amp;lt;/b&amp;gt; AND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WK_MONAT = WK_MONAT + 1.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;COde-2&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;wk_monat is parameter.&lt;/P&gt;&lt;P&gt;SELECT BELNR BUZEI BLART MWSKZ HKONT SHKZG DMBTR&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS&lt;/P&gt;&lt;P&gt;FROM BSIS WHERE BUKRS = itab_t001-BUKRS AND &lt;/P&gt;&lt;P&gt;GJAHR = P_GJAHR AND &amp;lt;b&amp;gt;MONAT &amp;lt;= WK_MONAT&amp;lt;/b&amp;gt; AND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ambichan.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Mar 2005 04:18:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/920471#M58803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-27T04:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Performance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/920472#M58804</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;As you might be aware of the SAP system 3-tier architecture, the idea is to keep the roundtrips to the database as low as possible. When you issue a SELECT statement inside any sort of a loop (do, while, loop at), the R/3 has to issue a SELECT in every loop pass. This is not advisable. In case of selection options, the complete select-option table is first interpreted into an SQL query and then passed to the database in one go. Hence only a single trip to the database is required thus improving performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In code-1, you have issued the SELECT in a loop. Please avoid this. Keeping other checks aside, the SELECT statement in code-1 is not logically correct. Rather that writing&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AND MONAT = WK_MONAT AND WK_MONAT = WK_MONAT + 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;you should write&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AND ( MONAT = WK_MONAT OR WK_MONAT = WK_MONAT + 1 )...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to select a range of data, you might would like to give BETWEEN a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Shehryar Khan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Mar 2005 04:51:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/920472#M58804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-27T04:51:09Z</dc:date>
    </item>
  </channel>
</rss>

