<?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: how to write Error message for select options? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503113#M1258756</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this code !&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN ON S_FEVOR. " OR AT SELECTION-SCREEN
 SELECT SINGLE FEVOR
               FROM AFKO
               INTO AFKO-FEVOR.
IF SY-SUBRC NE 0.
MESSAGE 'PLEASE ENTER VALUE FOR FEVOR' TYPE 'E'. 
" or you can use message class message - MESSAGE E(000) FROM &amp;lt;CLASS NAME&amp;gt;.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you declare select options as obligatory system will throw error but if you want to validate the date entered you need to use at selection screen. Depends on your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Apr 2009 13:34:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-11T13:34:55Z</dc:date>
    <item>
      <title>how to write Error message for select options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503109#M1258752</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 have this select option statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_fevor FOR afko-fevor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to write error message for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Smitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Apr 2009 11:36:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503109#M1258752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-11T11:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to write Error message for select options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503110#M1258753</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;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN ON s_fevor.
your checks....
if fail...
MESSAGE text TYPE 'E'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Apr 2009 11:41:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503110#M1258753</guid>
      <dc:creator>_IvanFemia_</dc:creator>
      <dc:date>2009-04-11T11:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to write Error message for select options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503111#M1258754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At selection-screen.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;if s_fevor is initial.     " or is not initial accoding to ur req. .&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;      message 'Please Enter Value in s_fevor' TYPE 'E'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: shishir deshmukh on Apr 11, 2009 1:44 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Apr 2009 11:43:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503111#M1258754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-11T11:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to write Error message for select options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503112#M1258755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Error messages are displayed for Select-options mostly on two conditions:&lt;/P&gt;&lt;P&gt;1) You needs to check wether a value is entered or not its done by:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;a)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select-options:SELECT-OPTIONS: s_fevor FOR afko-fevor Obligatory.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;   In this case error message is automatically throwed by system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) You can do this in Selection Screen events.&lt;/P&gt;&lt;P&gt; Ex:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
IF S_FEVOR-LOW IS INITIAL.
MESSAGE 'XXXXX' TYPE 'E'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) You need to Validate the entered value:&lt;/P&gt;&lt;P&gt;You can do this in Selection Screen events.&lt;/P&gt;&lt;P&gt; Ex:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.

SELECT FEVOR
             FROM AFKO
             INTO AFKO-FEVOR
             UP TO 1 ROWS
 ENDSELECT.         
IF SY-SUBRC NE 0.
MESSAGE 'XXXXX' 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;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Apr 2009 12:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503112#M1258755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-11T12:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to write Error message for select options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503113#M1258756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this code !&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN ON S_FEVOR. " OR AT SELECTION-SCREEN
 SELECT SINGLE FEVOR
               FROM AFKO
               INTO AFKO-FEVOR.
IF SY-SUBRC NE 0.
MESSAGE 'PLEASE ENTER VALUE FOR FEVOR' TYPE 'E'. 
" or you can use message class message - MESSAGE E(000) FROM &amp;lt;CLASS NAME&amp;gt;.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you declare select options as obligatory system will throw error but if you want to validate the date entered you need to use at selection screen. Depends on your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Apr 2009 13:34:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-error-message-for-select-options/m-p/5503113#M1258756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-11T13:34:55Z</dc:date>
    </item>
  </channel>
</rss>

