<?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 IF Condition in SAPscript in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290583#M155197</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently having trouble inserting my IF statement in the main window of a form. what I want to do is &lt;/P&gt;&lt;P&gt;IF mseg-bwart is NOT equal to '631' then it would do the code below. if it is EQUAL to 631, then it would not do the code below. I have tried using nested if but it always fails. Any help would be appreciated. Many thanks guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: IF &amp;amp;MKPF-TCODE2&amp;amp; NE 'MB01' AND &amp;amp;MKPF-TCODE2&amp;amp; NE 'MIGO_GR'&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-WEMPF&amp;amp;&lt;/P&gt;&lt;P&gt;/: ELSE&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-EBELN&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDIF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Mar 2006 08:41:35 GMT</pubDate>
    <dc:creator>aris_hidalgo</dc:creator>
    <dc:date>2006-03-23T08:41:35Z</dc:date>
    <item>
      <title>IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290583#M155197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently having trouble inserting my IF statement in the main window of a form. what I want to do is &lt;/P&gt;&lt;P&gt;IF mseg-bwart is NOT equal to '631' then it would do the code below. if it is EQUAL to 631, then it would not do the code below. I have tried using nested if but it always fails. Any help would be appreciated. Many thanks guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: IF &amp;amp;MKPF-TCODE2&amp;amp; NE 'MB01' AND &amp;amp;MKPF-TCODE2&amp;amp; NE 'MIGO_GR'&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-WEMPF&amp;amp;&lt;/P&gt;&lt;P&gt;/: ELSE&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-EBELN&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDIF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 08:41:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290583#M155197</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-03-23T08:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290584#M155198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;please send the code where it is not working.&lt;/P&gt;&lt;P&gt;So that we can help u out in this regard.this code is not suffient.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sreevani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 08:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290584#M155198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T08:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290585#M155199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;/: IF &amp;amp;MSEG-BWART&amp;amp; NE '631' AND &amp;amp;MKPF-TCODE2&amp;amp; NE 'MB01' AND &amp;amp;MKPF-TCODE2&amp;amp; NE 'MIGO_GR'
I1 ,,&amp;amp;MSEG-WEMPF&amp;amp;
/: ELSEIF &amp;amp;MSEG-BWART&amp;amp; NE '631' 
I1 ,,&amp;amp;MSEG-EBELN&amp;amp;
/: ENDIF&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 08:50:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290585#M155199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T08:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290586#M155200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1ST CHECK THAT IN DRIVER PROGRAM ALL THE VALUE   OF  MSEG TABLE IS  FETCH...&lt;/P&gt;&lt;P&gt;IN DRIVER PROGRAM...&lt;/P&gt;&lt;P&gt;SEELCT * FROM MSEG WHERE CONDN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/:IF  &amp;amp;MSEG-BWART&amp;amp; = '631'&lt;/P&gt;&lt;P&gt;DO THIS&lt;/P&gt;&lt;P&gt;:ELSE &lt;/P&gt;&lt;P&gt;DO THIS&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;Message was edited by: kishan negi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 08:54:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290586#M155200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T08:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290587#M155201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Viray,&lt;/P&gt;&lt;P&gt; try using Case..&lt;/P&gt;&lt;P&gt;sorry for the previous one..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: CASE &amp;amp;MSEG-BWART&amp;amp; 
 /: WHEN '631'.
 /: WHEN OTHERS. 
 / : IF &amp;amp;MKPF-TCODE2&amp;amp; NE 'MB01' AND &amp;amp;MKPF-TCODE2&amp;amp;  NE 'MIGO_GR'I1 ,,&amp;amp;MSEG-WEMPF&amp;amp;
/: ELSE
I1 ,,&amp;amp;MSEG-EBELN&amp;amp;
/: ENDIF 
 /: ENDCASE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;satesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Satesh R&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Satesh R&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 08:54:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290587#M155201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T08:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290588#M155202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try doing this.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;IF mseg-bwart is NOT equal to '631' then it would do the code below. if it is EQUAL to 631, then it would not do the code below&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: IF &amp;amp;mseg-bwart&amp;amp; NE 631 . &lt;/P&gt;&lt;P&gt;/: IF &amp;amp;MKPF-TCODE2&amp;amp; NE 'MB01' AND &amp;amp;MKPF-TCODE2&amp;amp; NE 'MIGO_GR'&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-WEMPF&amp;amp;&lt;/P&gt;&lt;P&gt;/: ELSE&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-EBELN&amp;amp;&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;What i want to say that sometime i had observe if you give the neagtive condition along with AND and all , it behaves very differently , i would advices you to break your IF with a single condition followed by other and try to see the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that will wrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;P&gt;Rewrd points, if found helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 08:59:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290588#M155202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T08:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290589#M155203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Viraylab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First and foremost is all the variables that u are using should be available in sapscript. If they are then u can us the following..&lt;/P&gt;&lt;P&gt;/: CASE &amp;amp;MSEG-BWART&amp;amp; &lt;/P&gt;&lt;P&gt;/: WHEN '631'.&lt;/P&gt;&lt;P&gt;/: IF &amp;amp;MKPF-TCODE2&amp;amp; NE 'MB01' AND &amp;amp;MKPF-TCODE2&amp;amp;   &lt;/P&gt;&lt;P&gt;   NE 'MIGO_GR'&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-WEMPF&amp;amp;&lt;/P&gt;&lt;P&gt;/: ELSE&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-EBELN&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDIF &lt;/P&gt;&lt;P&gt;/: WHEN OTHERS&lt;/P&gt;&lt;P&gt;/: ENDCASE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using debugger to find out exact reason if it is still skipping the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 09:06:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290589#M155203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T09:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290590#M155204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you can use nested IFs in SAPScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have to repeat some of the code and use a bigger IF statement to include all the conditions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 09:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290590#M155204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T09:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290591#M155205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;this is always a problem in scripts,&lt;/P&gt;&lt;P&gt;the best way is to set a flag inside the code.and use that flag here that is the best way.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 10:59:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290591#M155205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T10:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: IF Condition in SAPscript</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290592#M155206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try to use this&lt;/P&gt;&lt;P&gt;/: IF &amp;amp;MSEG-BWART&amp;amp; NE '631' AND &amp;amp;MKPF-TCODE2&amp;amp; NE 'MB01' AND &amp;amp;MKPF-TCODE2&amp;amp; NE 'MIGO_GR'&lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-WEMPF&amp;amp;/: &lt;/P&gt;&lt;P&gt;ELSE &lt;/P&gt;&lt;P&gt;I1 ,,&amp;amp;MSEG-EBELN&amp;amp;/: ENDIF&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 11:01:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition-in-sapscript/m-p/1290592#M155206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T11:01:48Z</dc:date>
    </item>
  </channel>
</rss>

