<?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: Diff b/w IF/ENDIF and CASE statement? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439293#M545852</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 statement we can use for different type of situation occurence instead of using or in if case but if statement we are using for one situatation check max.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;&lt;P&gt;reward if it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2007 05:31:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-04T05:31:46Z</dc:date>
    <item>
      <title>Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439292#M545851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Plz let me know the difference between IF and CASE statements.Which one is better to be used in general...and are there any specific situations where we have to go for CASE insted of IF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 05:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439292#M545851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T05:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439293#M545852</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 statement we can use for different type of situation occurence instead of using or in if case but if statement we are using for one situatation check max.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;&lt;P&gt;reward if it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 05:31:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439293#M545852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T05:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439294#M545853</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;CASE is also a kind of IF...ELSE stmnt. (may be for 3 or 4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For few conditions to check and act accordingly, we prefer IF...ELSE....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the conditions are more ..then CASE stmnt is preferred..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE &amp;lt;field&amp;gt;&lt;/P&gt;&lt;P&gt;  WHEN &amp;lt;value&amp;gt;&lt;/P&gt;&lt;P&gt;     &amp;lt;code&amp;gt;&lt;/P&gt;&lt;P&gt;  WHEN &amp;lt;value&amp;gt;&lt;/P&gt;&lt;P&gt;     &amp;lt;code&amp;gt;&lt;/P&gt;&lt;P&gt;  WHEN &amp;lt;value&amp;gt;&lt;/P&gt;&lt;P&gt;     &amp;lt;code&amp;gt;&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 05:31:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439294#M545853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T05:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439295#M545854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If it is 1 or 2 conditions use IF..ELSE..ENDIF.&lt;/P&gt;&lt;P&gt;if there are more conditions better to use CASE..WHEN..ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points for useful Answers&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 05:32:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439295#M545854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T05:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439296#M545855</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;Case statement is good for performance wise because here we declare cases &lt;/P&gt;&lt;P&gt;and according to these cases program will be executed.&lt;/P&gt;&lt;P&gt;When we use if statement then the cursur goes to in the loop, when ever&lt;/P&gt;&lt;P&gt;the loop is not complete till then the programme will not execute.&lt;/P&gt;&lt;P&gt;Thats by in performance basis the case statement is good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try and explain using an example...&lt;/P&gt;&lt;P&gt;1) For IF statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppost you have a variable color..and you are checking it against color names.&lt;/P&gt;&lt;P&gt;then your code will be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF COLOR == 'BLUE'.&lt;/P&gt;&lt;P&gt;    statements&lt;/P&gt;&lt;P&gt;ELSEIF COLOR == 'BLACK'.&lt;/P&gt;&lt;P&gt;    statements.&lt;/P&gt;&lt;P&gt;...and so on....&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you use CASE Statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE COLOR.&lt;/P&gt;&lt;P&gt;when 'BLUE'.&lt;/P&gt;&lt;P&gt;   statements.&lt;/P&gt;&lt;P&gt;when 'BLACK'.&lt;/P&gt;&lt;P&gt;  statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so follows that CASE is easy to use and performance wise is also better.&lt;/P&gt;&lt;P&gt;&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;Priyanka.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 05:33:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439296#M545855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T05:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439297#M545856</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;The behaviour is same, that is the effect that you want to have is same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But If you have lot of alternatives cases it looks ODD when you put then in IF ELSEIF and ENDIF's.  In such a case CASE ENDCASE is more useful interms of readability.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE is supposed to be faster compared to IF.&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, 04 Jul 2007 05:33:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439297#M545856</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-07-04T05:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439298#M545857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;u can use any of these&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if there are large number of conditons to check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then performance wise and also according to the scenario&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we prefer to use CASE statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ravish&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;plz dont forget to reward points if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 05:34:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439298#M545857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T05:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439299#M545858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choice is your requirement:&lt;/P&gt;&lt;P&gt; Using IF-ENDIF condition you can have any logical expression line EQ, NE, CP etc. Also NOT, OR , AND relational logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Howevere in CASE- ENDCASE  you check for equality only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;A.Singh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 05:36:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439299#M545858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T05:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w IF/ENDIF and CASE statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439300#M545859</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;it is better to use case instead of using elseif(condition) block.&lt;/P&gt;&lt;P&gt;if u use elseif means to execute the code in elseif it should take decision twice(once at if(condition) and other at elseif(condition)).like this if u use 10 elseif (condition) statements in ur if...endif block to execute the 10 th block it should take the decision for 11 times.it will degarde the performance.in case of CASE it always will take decision once.so in these types of situations we have to use case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;reward if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 05:36:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-if-endif-and-case-statement/m-p/2439300#M545859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T05:36:49Z</dc:date>
    </item>
  </channel>
</rss>

