<?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: IF statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615514#M600335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Absolutely no problem from performance point of view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The programs with nested if statements are difficult to read. In this case you cant avoid if statements as you dont have fixed value to use case statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the above listed code is perfect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Aug 2007 18:07:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-01T18:07:10Z</dc:date>
    <item>
      <title>IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615507#M600328</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;Do nested if statements result in performance issues ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a subroutine which has the following codes within its body.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_date_high TYPE datum,&lt;/P&gt;&lt;P&gt;        l_date_low  TYPE datum,&lt;/P&gt;&lt;P&gt;        l_time_high TYPE uzeit,&lt;/P&gt;&lt;P&gt;        l_time_low  TYPE uzeit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: l_date_high, l_date_low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF so_date IS INITIAL.&lt;/P&gt;&lt;P&gt;    l_date_high = sy-datlo.&lt;/P&gt;&lt;P&gt;    CLEAR: l_date_low.&lt;/P&gt;&lt;P&gt;    l_time_high = sy-uzeit.&lt;/P&gt;&lt;P&gt;    CLEAR: l_time_low.&lt;/P&gt;&lt;P&gt;  ELSEIF so_date-high IS INITIAL AND NOT so_date-low IS INITIAL.&lt;/P&gt;&lt;P&gt;    l_date_high = so_date-low.&lt;/P&gt;&lt;P&gt;    IF l_date_high = sy-datlo.&lt;/P&gt;&lt;P&gt;      l_time_high = sy-uzeit.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      l_time_high = '235959'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    l_date_low = so_date-low.&lt;/P&gt;&lt;P&gt;    CLEAR: l_time_low.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    l_date_high = so_date-high.&lt;/P&gt;&lt;P&gt;    l_date_low  = so_date-low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF l_date_high = sy-datlo.&lt;/P&gt;&lt;P&gt;      l_time_high = sy-uzeit.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      l_time_high = '235959'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    CLEAR: l_time_low.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF so_time IS INITIAL.&lt;/P&gt;&lt;P&gt;    l_time_high = '235959'.&lt;/P&gt;&lt;P&gt;    CLEAR: l_time_low.&lt;/P&gt;&lt;P&gt;  ELSEIF so_time-high IS INITIAL AND NOT so_time-low IS INITIAL.&lt;/P&gt;&lt;P&gt;    l_time_low = so_time-low.&lt;/P&gt;&lt;P&gt;    l_time_high = '235959'.&lt;/P&gt;&lt;P&gt;  ELSEIF NOT so_time-high IS INITIAL AND so_time-low IS INITIAL.&lt;/P&gt;&lt;P&gt;    CLEAR: so_time-low.&lt;/P&gt;&lt;P&gt;    l_time_high = so_time-high.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    l_time_low  = so_time-low.&lt;/P&gt;&lt;P&gt;    l_time_high = so_time-high.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'CHANGE_POINTERS_READ'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            activation_date_high        = l_date_high&lt;/P&gt;&lt;P&gt;            activation_date_low         = l_date_low&lt;/P&gt;&lt;P&gt;            activation_time_high        = l_time_high&lt;/P&gt;&lt;P&gt;            activation_time_low         = l_time_low&lt;/P&gt;&lt;P&gt;            creation_date_high          = l_date_high&lt;/P&gt;&lt;P&gt;            creation_date_low           = l_date_low&lt;/P&gt;&lt;P&gt;            creation_time_high          = l_time_high&lt;/P&gt;&lt;P&gt;            creation_time_low           = l_time_low&lt;/P&gt;&lt;P&gt;            message_type                = p_mestyp&lt;/P&gt;&lt;P&gt;            read_not_processed_pointers = 'X'&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            change_pointers             = t_bp&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            error_in_date_interval      = 1&lt;/P&gt;&lt;P&gt;            error_in_time_interval      = 2&lt;/P&gt;&lt;P&gt;            OTHERS                      = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    SORT t_bp BY cdchgid usrname.&lt;/P&gt;&lt;P&gt;    t_bp_orig[] = t_bp[].                "keep track of pulled documents&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DELETE t_bp WHERE cdchgid = 'D'&lt;/P&gt;&lt;P&gt;                   OR cdchgid = 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please suggest to make necessary changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Binay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 10:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615507#M600328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T10:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615508#M600329</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;If possible try and use CASE instead of IF ELSEIF ELSE ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else this should not be a big problem with respect to Performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since these days the application servers are good in performance this hould not be a big problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concentrate more on reducing the Database statements to improve the performance instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 10:34:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615508#M600329</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-08-01T10:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615509#M600330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is no problem in using multiple if..else statements... performance wont hit a much... but the better way is if u have more than 3 if statement try using Case...Endcase statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ur code is fine and will work properly as at any time it will check only one if statement and performance won't hit a long...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 10:45:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615509#M600330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T10:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615510#M600331</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;generally, it should not affect the performance. in this important is that which cotrol structure is suitable for ur logic.  Say CASE...ENDCASE is used to tackle diffrent values of a single variable. and IF is used to tackle logic of expression condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 10:48:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615510#M600331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T10:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615511#M600332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;CASE AND ENDCASE I VERY GOOD AT THIS POINT OF TIME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WITH NESTED IF YES U WILL GET PERFORMANCE PROBLEM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IF USEFULL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 12:56:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615511#M600332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T12:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615512#M600333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, the last comment is incorrect. With your 3, 4, 5 conditions there is absolutely nb need to think about a change (if you have a problem then it is somewhere completely different).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case ... endscase can help slightly, if you have different value for a certain variable, and 10s oder 100s of branches. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 14:14:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615512#M600333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T14:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615513#M600334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree completely. I'd be surprised if you found a user who was able to detect a performance difference between CASE and IF ... ELSEIF ... ENDIF, even if there was a thousand ELSEIF lines. Computers compute fast, humans interact slowly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main advantage (in my opinion) of CASE statements is that the program is easier to read.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 14:36:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615513#M600334</guid>
      <dc:creator>KjetilKilhavn</dc:creator>
      <dc:date>2007-08-01T14:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615514#M600335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Absolutely no problem from performance point of view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The programs with nested if statements are difficult to read. In this case you cant avoid if statements as you dont have fixed value to use case statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the above listed code is perfect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 18:07:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statements/m-p/2615514#M600335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T18:07:10Z</dc:date>
    </item>
  </channel>
</rss>

