<?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/n else and elseif in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202160#M470611</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you multiple IFs and ELSEIFs better use CASE ENDCASE. &lt;/P&gt;&lt;P&gt;This will avoid confusion and gives more code readability.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE &amp;lt;var&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN &amp;lt;VALUE1&amp;gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;WHEN &amp;lt;VALUE2&amp;gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;WHEN &amp;lt;VALUEN&amp;gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;OTHERS&lt;/P&gt;&lt;P&gt;*------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCASE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SKJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Apr 2007 17:43:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-25T17:43:38Z</dc:date>
    <item>
      <title>Diff b/n else and elseif</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202159#M470610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please help me to find out what are the cases else and elseif are used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a particular case &lt;/P&gt;&lt;P&gt;I used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If   condition&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;endif&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;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case  its not entering else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it is working fine if it is elseif  condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 17:36:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202159#M470610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T17:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/n else and elseif</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202160#M470611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you multiple IFs and ELSEIFs better use CASE ENDCASE. &lt;/P&gt;&lt;P&gt;This will avoid confusion and gives more code readability.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE &amp;lt;var&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN &amp;lt;VALUE1&amp;gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;WHEN &amp;lt;VALUE2&amp;gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;WHEN &amp;lt;VALUEN&amp;gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;OTHERS&lt;/P&gt;&lt;P&gt;*------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCASE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SKJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 17:43:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202160#M470611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T17:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/n else and elseif</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202161#M470612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi in this case,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.  If condition  "if success control goes to point 2, if cond fails control -&amp;gt; point 7&lt;/P&gt;&lt;P&gt;2.  if                "if success control goes to point 3, if cond fails control -&amp;gt; point 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.  if                "if success control goes inside n executes code control -&amp;gt;point 5&lt;/P&gt;&lt;P&gt;                       "if condition fails control -&amp;gt; point 4 n exe code and control goes-&amp;gt;5&lt;/P&gt;&lt;P&gt;4.  else            " this else is for 3 if condition&lt;/P&gt;&lt;P&gt;5.  endif           " for 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.  endif          " for 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7.  else.      " this else is for 1 if condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8.  if   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9.  if&lt;/P&gt;&lt;P&gt;10. else      " this else is for 9 if condition&lt;/P&gt;&lt;P&gt;11. endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12. endif.     " this is for  8 if condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;13. Endif.    "for 1 if condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;i think this will make things clear.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, the difference between else n elseif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g: &lt;/P&gt;&lt;P&gt;if x eq 'A'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.     " This else works for anything else except 'A'&lt;/P&gt;&lt;P&gt;&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;if x eq 'A'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif x eq 'B'.     " This else works for only  'B'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif  condition is nothing but if condition, but preceeded by another if condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Hpe it wil help u&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 18:05:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202161#M470612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T18:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/n else and elseif</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202162#M470613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the difference&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ELSEIF&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; Within a processing block enclosed by " IF ... ENDIF ", this statement indicates the processing to be executed if the logical expressions specified by IF and the preceding ELSEIF s are false, but the logical expression in this ELSEIF processing block is true.&lt;/P&gt;&lt;P&gt;Between the IF and ENDIF statements, there may be any number of ELSEIF s. These may be followed, optionally, by an ELSE statement, but this is executed only if none of the logical expressions under IF or ELSEIF is true.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA RESULT TYPE I.
...
IF RESULT &amp;lt; 0.
  WRITE / 'Result less than zero'.
ELSEIF RESULT = 0.
  WRITE / 'Result equal zero'.
ELSE.
  WRITE / 'Result greater than zero'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the value of RESULT , the three different texts are output.&lt;/P&gt;&lt;P&gt;Related IF ,&lt;/P&gt;&lt;P&gt;ELSE ,&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 19:04:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-n-else-and-elseif/m-p/2202162#M470613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T19:04:30Z</dc:date>
    </item>
  </channel>
</rss>

