<?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 help required in IF statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507873#M234451</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;&lt;/P&gt;&lt;P&gt;I don't have any programming background&lt;/P&gt;&lt;P&gt;But now i need to look at this  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P = 11.&lt;/P&gt;&lt;P&gt;if  not ( p  eq 10   or  p eq 11 or p eq 12 ) .&lt;/P&gt;&lt;P&gt;clear p.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write :  / p.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the control goes to else part.&lt;/P&gt;&lt;P&gt;output  p =11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P = 11.&lt;/P&gt;&lt;P&gt;if   ( p  ne 10   or  p ne 11 or p ne 12 ) .&lt;/P&gt;&lt;P&gt;clear p.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write :  / p.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;Here control goes and clears p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me a clear idea as how this statements are working.I thought they  would give the same results,but its not&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Preeti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Aug 2006 13:33:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-31T13:33:42Z</dc:date>
    <item>
      <title>help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507873#M234451</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;&lt;/P&gt;&lt;P&gt;I don't have any programming background&lt;/P&gt;&lt;P&gt;But now i need to look at this  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P = 11.&lt;/P&gt;&lt;P&gt;if  not ( p  eq 10   or  p eq 11 or p eq 12 ) .&lt;/P&gt;&lt;P&gt;clear p.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write :  / p.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the control goes to else part.&lt;/P&gt;&lt;P&gt;output  p =11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P = 11.&lt;/P&gt;&lt;P&gt;if   ( p  ne 10   or  p ne 11 or p ne 12 ) .&lt;/P&gt;&lt;P&gt;clear p.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write :  / p.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;Here control goes and clears p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me a clear idea as how this statements are working.I thought they  would give the same results,but its not&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Preeti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 13:33:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507873#M234451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T13:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507874#M234452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Preeti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or statement works like if any one of the condition is true, it is true. &lt;/P&gt;&lt;P&gt;example :&lt;/P&gt;&lt;P&gt;(cond1 or cond2 or cond3 or cond4...)&lt;/P&gt;&lt;P&gt;if any one of these conditions cond1, cond2, cond3... is true, the result is true.&lt;/P&gt;&lt;P&gt;so in first case.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;P = 11.
if not ( p eq 10 or &amp;lt;b&amp;gt;p eq 11&amp;lt;/b&amp;gt; or p eq 12 ) .
 clear p.
else.
 write : / p.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;p eq 11 is true -&amp;gt; so the result of whole statement in () is true -&amp;gt; then not(true)-&amp;gt;not of true is false, so the result of this statement is false.&lt;/P&gt;&lt;P&gt;So it goes to else part and writes p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in Second case.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;P = 11.
if ( &amp;lt;b&amp;gt;p ne 10&amp;lt;/b&amp;gt; or p ne 11 or p ne 12 ) .
 clear p.
else.
 write : / p.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;p ne 10 is true -&amp;gt; so the result of whole statement in () is true -&amp;gt;, So it goes to if part and clears p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clears your doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 13:40:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507874#M234452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T13:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507875#M234453</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;Lets go back to basics of boolean algebra.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your first case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compl ( A or B or C )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SUB&gt;(A or B or C) is equal to (&lt;/SUB&gt;A and ~B and ~C ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that means your first statement gets converted to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ( P NE 10 AND P NE 11 AND P NE 12 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&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;Whereas your second statement.&lt;/P&gt;&lt;P&gt;if ( p ne 10 or p ne 11 or p ne 12 ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here if P = 11, what happens is SAP will find that first condition is getting satisfied i.e P NE 10 and rest of the conditions are OR, so it will immediately assume it is not true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in first conditon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ( P NE 10 AND P NE 11 AND P NE 12 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since it is AND condition, SAP will check all three conditions and find that second part P NE 11 is satisfying the critirea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope u got the picture&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 13:40:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507875#M234453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T13:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507876#M234454</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 condition "p ne 10 or p ne 11 or p ne 12" is always true, infact &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if p = 11, it's true p = 10 and p = 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to control a variable is different to certain values in the same time you have to use AND and not OR:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( p ne 10 and p ne 11 and p ne 12 ) .&lt;/P&gt;&lt;P&gt;clear p.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write : / p.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 13:42:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507876#M234454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T13:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507877#M234455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;both the outputs are correct , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first statement control will goto else part only bcoz in th brackets one of ur statements is true and not of that is false , so it will goto else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in ur second statement control will goto p ne 10 first , as this is true , it will clear , to correct that do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Chandrasekhar Jagarlamudi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 13:45:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507877#M234455</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T13:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507878#M234456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the first if statement you r checking the eq and in the second if statement you r checking ne, so it is clearing the P.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can check this by putting the breakpoint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 14:08:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507878#M234456</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T14:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507879#M234457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi preeti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first let us know about OR logic,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if any of the condition(or expression) is true then o/p is true else false.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;In the 1st case&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;first the condition in (...) is evaluated against value of p given (i.e. 11).&lt;/P&gt;&lt;P&gt;since all the conds are true the o/p is true&lt;/P&gt;&lt;P&gt;next &amp;lt;b&amp;gt;if not( ) means&amp;lt;/b&amp;gt; negation of the value obtained&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the o/p obtained is true then it becomes false&lt;/P&gt;&lt;P&gt;hence goes to else part and vice versa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;In the 2nd case,&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;again the condition in (...) is evaluated&lt;/P&gt;&lt;P&gt;since it is checking for not equal to and as 2 conds are true, the o/p is true,hence goes to if part and clears the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sowjanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 14:17:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507879#M234457</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T14:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507880#M234458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Preeti.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Close this thread, if you find the answers relevent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 15:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507880#M234458</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T15:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: help required in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507881#M234459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 19:29:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-in-if-statement/m-p/1507881#M234459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T19:29:58Z</dc:date>
    </item>
  </channel>
</rss>

