<?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: Screen validations in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563791#M857584</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 have to Validate the screen by using this code in At selection screen on field &amp;lt;fieldname&amp;gt;.&lt;/P&gt;&lt;P&gt;The code is&lt;/P&gt;&lt;P&gt;if &amp;lt;fieldname&amp;gt; ne 'YES' or &amp;lt;fieldname&amp;gt; ne 'NO' or &amp;lt;fieldname&amp;gt; ne 'N/A'.&lt;/P&gt;&lt;P&gt;message 'Please Enter Only YES, NO or N/A'  type E.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Mar 2008 03:20:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-26T03:20:56Z</dc:date>
    <item>
      <title>Screen validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563788#M857581</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;I am working on screens. there a some input fields&lt;/P&gt;&lt;P&gt;in which user can enter only YES, NO or N/A value, &lt;/P&gt;&lt;P&gt;now my requirement is that if user enters any other &lt;/P&gt;&lt;P&gt;value except YES, NO or N/A than system should throw &lt;/P&gt;&lt;P&gt;the message 'Please Enter Only YES, NO or N/A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's urgent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2008 03:13:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563788#M857581</guid>
      <dc:creator>ak_upadhyay</dc:creator>
      <dc:date>2008-03-26T03:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Screen validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563789#M857582</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;&lt;/P&gt;&lt;P&gt;Parameters : field(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if field ne 'YES' OR FIELD ne 'NO' OR FIELD ne 'N/A'.
**fLASH ERROR MESSAGE HERE
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V.Balaji&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Balaji V on Mar 26, 2008 4:20 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Balaji V on Mar 26, 2008 4:20 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2008 03:17:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563789#M857582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-26T03:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Screen validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563790#M857583</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;PRE&gt;&lt;CODE&gt;at selection-screen on value.
if value = 'YES' or  value = 'NO' or value = 'N/A'.
ELSE.
 MESSAGE 'ENTER VAILD VALUE' TYPE 'E'.
ENDIF&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Balakumar.G&lt;/P&gt;&lt;P&gt;Reward Points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2008 03:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563790#M857583</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-26T03:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Screen validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563791#M857584</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 have to Validate the screen by using this code in At selection screen on field &amp;lt;fieldname&amp;gt;.&lt;/P&gt;&lt;P&gt;The code is&lt;/P&gt;&lt;P&gt;if &amp;lt;fieldname&amp;gt; ne 'YES' or &amp;lt;fieldname&amp;gt; ne 'NO' or &amp;lt;fieldname&amp;gt; ne 'N/A'.&lt;/P&gt;&lt;P&gt;message 'Please Enter Only YES, NO or N/A'  type E.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2008 03:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563791#M857584</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-26T03:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Screen validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563792#M857585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AK,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are few ways you can achieve this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If you have a data element assigned to the field .. then you can have a value table / fixed value for that data element associated to the field ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If it is a selection screen .. you can put the following condition in "At SELECTION-SCREEN output " event &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" &lt;STRONG&gt;if value = 'yes' or value = 'no' or value = 'N/A'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;else .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;message 'Error'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;endif.&lt;/STRONG&gt;  "&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;3. If it is a screen .. then you can have your conidition in PBO Module ... between Chain and Endchain statments ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps a bit ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Kripa Rangachari.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2008 03:22:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563792#M857585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-26T03:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Screen validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563793#M857586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;&lt;SPAN __default_attr="sylfaen" __jive_macro_name="font"&gt;&lt;SPAN __default_attr="15" __jive_macro_name="size"&gt;
Try as below:
&lt;PRE&gt;&lt;CODE&gt;
CONSTANTS: c_yes TYPE char3 VALUE 'YES',   " Global Declaration
           c_no  TYPE char3 VALUE 'NO',
           c_na  TYPE char3 VALUE 'N/A'.&lt;/CODE&gt;&lt;/PRE&gt;
           
" PAI Event
&lt;PRE&gt;&lt;CODE&gt;MODULE pai.

  PERFORM validate.&lt;/CODE&gt;&lt;/PRE&gt;
 
&lt;PRE&gt;&lt;CODE&gt;
FORM validate.

   IF NOT p_text EQ c_yes OR   " Considering P_TEXT is screen field
      NOT p_text EQ c_no  OR
      NOT p_text EQ n_na.
      MESSAGE e001(00) WITH 'Please Enter Only YES, NO or N/A'.
   ENDIF.
ENDFORM.  " Validate&lt;/CODE&gt;&lt;/PRE&gt;

Above example is w.r.t screen, should you be using in a report program check below example as well:
&lt;PRE&gt;&lt;CODE&gt;parameters: p_text type char3 obligatory.

CONSTANTS: c_yes TYPE char3 VALUE 'YES',
           c_no  TYPE char3 VALUE 'NO',
           c_na  TYPE char3 VALUE 'N/A'.

at selection-screen.

   IF NOT p_text EQ c_yes AND
      NOT p_text EQ c_no  AND
      NOT p_text EQ c_na.
      MESSAGE e001(00) WITH 'Please Enter Only YES, NO or N/A'.
   ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN __default_attr="maroon" __jive_macro_name="color"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2008 03:25:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563793#M857586</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-26T03:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Screen validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563794#M857587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kripa, Just to correct you. This can be done in the PAI, but not in the PBO. &lt;/P&gt;&lt;P&gt;And more over you can not use Chain Endchain in the PBO module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi AK, As said by others u can just validate the field using IF statement. You can do it in module PAI between chain endchain giving the screen field name(s) you wnted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CHAIN.
    FIELD : SCREEN_FIELDNAME.
    MODULE validate_input. " in this moduel u can write the IF statement
ENDCHAIN.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2008 03:27:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563794#M857587</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2008-03-26T03:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Screen validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563795#M857588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi use the code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables : mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Ranges : text for mara-ZEIAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initialization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text-sign = 'I'.&lt;/P&gt;&lt;P&gt;text-option = 'EQ'.&lt;/P&gt;&lt;P&gt;text-low = 'YES'.&lt;/P&gt;&lt;P&gt;append text. clear text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text-sign = 'I'.&lt;/P&gt;&lt;P&gt;text-option = 'EQ'.&lt;/P&gt;&lt;P&gt;text-low = 'NO'.&lt;/P&gt;&lt;P&gt;append text. clear text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text-sign = 'I'.&lt;/P&gt;&lt;P&gt;text-option = 'EQ'.&lt;/P&gt;&lt;P&gt;text-low = 'N/A'.&lt;/P&gt;&lt;P&gt;append text. clear text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if field1 not in text.&lt;/P&gt;&lt;P&gt;message 'Please Enter Only YES, NO or N/A' type 'S'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if field2 not in text.&lt;/P&gt;&lt;P&gt;message 'Please Enter Only YES, NO or N/A' type 'S'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if field3 not in text.&lt;/P&gt;&lt;P&gt;message 'Please Enter Only YES, NO or N/A' type 'S'.&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;Sankar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2008 03:35:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/screen-validations/m-p/3563795#M857588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-26T03:35:09Z</dc:date>
    </item>
  </channel>
</rss>

