<?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 condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606947#M1277687</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;Check this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF zpc0-responsibil EQ '95' OR
zpc0-responsibil EQ '98'.

" If You use OR and pass 99 to zpc0-rjc_rea and space in zpc0-rej_remarks 
" then if any one is satisfied the error message is displayed
IF zpc0-rjc_rea EQ space AND  " --&amp;gt;NOT OR 
zpc0-rej_remarks EQ space.

MESSAGE i653 WITH 'Reject Reason'.
error_flag = 'Y'.
position_flag = 'RJC_REA'.
ENDIF.
ELSE.
IF zpc0-rjc_rea NE space OR
zpc0-rej_remarks NE space.
MESSAGE i416 WITH
'Must be empty reject reason &amp;amp; remark for rejection'.
error_flag = 'Y'.
position_flag = 'RJC_REA'.
ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 May 2009 06:05:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-14T06:05:17Z</dc:date>
    <item>
      <title>IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606946#M1277686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a very weired problem.I have a module pool program where there is one input field with input help(F4).This field is mandatory field in certain scenarios.If this field is empty then the system should displya an error saying "Reject Reason is required field".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 1 - &lt;/P&gt;&lt;P&gt;If the field is empty ---the system display error message - This is correct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2 -If this field is not empty - The system still displays an error message saying it is a required field - This is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code there is the following If condition&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;CHECK error_flag EQ space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF zpc0-responsibil EQ '95' OR&lt;/P&gt;&lt;P&gt;     zpc0-responsibil EQ '98'.&lt;/P&gt;&lt;P&gt;    IF zpc0-rjc_rea     EQ space  OR&lt;/P&gt;&lt;P&gt;       zpc0-rej_remarks EQ space.&lt;/P&gt;&lt;P&gt;      MESSAGE i653 WITH 'Reject Reason'.&lt;/P&gt;&lt;P&gt;      error_flag = 'Y'.&lt;/P&gt;&lt;P&gt;      position_flag  = 'RJC_REA'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    IF zpc0-rjc_rea     NE space OR&lt;/P&gt;&lt;P&gt;       zpc0-rej_remarks NE space.&lt;/P&gt;&lt;P&gt;      MESSAGE i416 WITH&lt;/P&gt;&lt;P&gt;       'Must be empty reject reason &amp;amp; remark for rejection'.&lt;/P&gt;&lt;P&gt;      error_flag = 'Y'.&lt;/P&gt;&lt;P&gt;      position_flag  = 'RJC_REA'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sending zpc0-responsibil = 95 and zpc0-rjc_rea  = 99..Still the IF condition is satisfied and i system executes the stmt MESSAGE i653 WITH 'Reject Reason'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one please suggest what could be the problem .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE- In debugging mode i see the values for zpc0-responsibil as 95 and zpc0-rjc_rea as 99.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Swati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:00:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606946#M1277686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606947#M1277687</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;Check this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF zpc0-responsibil EQ '95' OR
zpc0-responsibil EQ '98'.

" If You use OR and pass 99 to zpc0-rjc_rea and space in zpc0-rej_remarks 
" then if any one is satisfied the error message is displayed
IF zpc0-rjc_rea EQ space AND  " --&amp;gt;NOT OR 
zpc0-rej_remarks EQ space.

MESSAGE i653 WITH 'Reject Reason'.
error_flag = 'Y'.
position_flag = 'RJC_REA'.
ENDIF.
ELSE.
IF zpc0-rjc_rea NE space OR
zpc0-rej_remarks NE space.
MESSAGE i416 WITH
'Must be empty reject reason &amp;amp; remark for rejection'.
error_flag = 'Y'.
position_flag = 'RJC_REA'.
ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:05:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606947#M1277687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606948#M1277688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SO what about this field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zpc0-rej_remarks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is that equal to space at that time in that case that will be the prob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:05:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606948#M1277688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606949#M1277689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You said you are passing the following values:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;""zpc0-responsibil = 95 and zpc0-rjc_rea = 99.&lt;/P&gt;&lt;P&gt;Still the IF condition is satisfied and i system executes the stmt MESSAGE i653 WITH 'Reject Reason'.""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you have not specified what you are passing in  zpc0-rej_remarks .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If  zpc0-rej_remarks  contains space then you will definitely get your error message because you are using 'OR' condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:07:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606949#M1277689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606950#M1277690</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 have put OR condition in IF,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF zpc0-rjc_rea EQ space OR
zpc0-rej_remarks EQ space.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;therefore even u are passing zpc0-rjc_rea = 99 , but zpc0-rej_remarks  is taking space hense if condition is true and giving u that message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use AND in above IF condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:11:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606950#M1277690</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606951#M1277691</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 zpc0-rjc_rea EQ space OR&lt;/P&gt;&lt;P&gt;zpc0-rej_remarks EQ space.&lt;/P&gt;&lt;P&gt;MESSAGE i653 WITH 'Reject Reason'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if any of the above condition is true the 'if' condition gets satisfied..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the zpc0-rej_remarks field is empty then it would giv u the error msg.&lt;/P&gt;&lt;P&gt;pass the value in zpc0-rej_remarks  field &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:14:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606951#M1277691</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606952#M1277692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cant believe this ..this simple thing didnt strike me ....Guys you all are correct .The zpc0-rej_remarks is passed as space hence the errror.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for this help.&lt;/P&gt;&lt;P&gt;Problem Solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:16:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606952#M1277692</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606953#M1277693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hhh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Arun on May 14, 2009 8:17 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:16:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606953#M1277693</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606954#M1277694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do like this&lt;/P&gt;&lt;P&gt; IF zpc0-responsibil EQ '95' and&lt;/P&gt;&lt;P&gt;    zpc0-responsibil EQ '98'.&lt;/P&gt;&lt;P&gt;	IF zpc0-rjc_rea EQ space OR&lt;/P&gt;&lt;P&gt;	zpc0-rej_remarks EQ space.&lt;/P&gt;&lt;P&gt;	MESSAGE i653 WITH 'Reject Reason'.&lt;/P&gt;&lt;P&gt;	error_flag = 'Y'.&lt;/P&gt;&lt;P&gt;	position_flag = 'RJC_REA'.&lt;/P&gt;&lt;P&gt;	ENDIF.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;	IF zpc0-rjc_rea NE space OR&lt;/P&gt;&lt;P&gt;	zpc0-rej_remarks NE space.&lt;/P&gt;&lt;P&gt;	MESSAGE i416 WITH&lt;/P&gt;&lt;P&gt;	'Must be empty reject reason &amp;amp; remark for rejection'.&lt;/P&gt;&lt;P&gt;	error_flag = 'Y'.&lt;/P&gt;&lt;P&gt;	position_flag = 'RJC_REA'.&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;Regards&lt;/P&gt;&lt;P&gt;Shashi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 06:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/5606954#M1277694</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-14T06:22:49Z</dc:date>
    </item>
  </channel>
</rss>

