<?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: Validations in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632390#M874886</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;AT SELECTION-SCREEN - selscreen_event &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;... &lt;SPAN __jive_macro_name="OUTPUT"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;  | { ON {para|selcrit} } &lt;/P&gt;&lt;P&gt;  | { ON END OF selcrit } &lt;/P&gt;&lt;P&gt;  | { ON BLOCK block } &lt;/P&gt;&lt;P&gt;  | { ON RADIOBUTTON GROUP radi } &lt;/P&gt;&lt;P&gt;  | { } &lt;/P&gt;&lt;P&gt;  | { ON {HELP-REQUEST|VALUE-REQUEST} &lt;/P&gt;&lt;P&gt;  |   FOR {para|selcrit-low|selcrit-high} } &lt;/P&gt;&lt;P&gt;  | { ON EXIT-COMMAND }. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatives: &lt;/P&gt;&lt;P&gt;1. ... OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... ON {para|selcrit} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ... ON END OF selcrit &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. ... ON BLOCK block &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. ... ON RADIOBUTTON GROUP radi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. ... { } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. ... { ON {HELP-REQUEST|VALUE-REQUEST} FOR &lt;/P&gt;&lt;P&gt;      {para|selcrit-low|selcrit-high} } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. ... ON EXIT-COMMAND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;These additions allow individual evaluation of specific elements of the selection screens of the program. The information as to which selection has triggered the event is contained in the system field sy-dynnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 1 &lt;/P&gt;&lt;P&gt;... OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 2 &lt;/P&gt;&lt;P&gt;... ON {para|selcrit} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 3 &lt;/P&gt;&lt;P&gt;... ON END OF selcrit &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered after the selection table selcrit has been fully passed to the program after a user action in the dialog box for the multiple selection has taken place. In the event block, the entire selection table can be checked. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 4 &lt;/P&gt;&lt;P&gt;... ON BLOCK block &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered at the screen event PAI of a selection screen if all the input fields of a block block of the selection screen were passed to the ABAP program. In the event block, the user inputs can be checked. Sending a warning or an error message in the event block makes all the fields of the block block ready for input again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 5 &lt;/P&gt;&lt;P&gt;... ON RADIOBUTTON GROUP radi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered at the screen event PAI of a selection screen if all the fields of a radio button group radi of the selection screen were passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or error message in the event block makes all the radion buttons of the block radi ready for input again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 6 &lt;/P&gt;&lt;P&gt;... { } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The event AT SELECTION-SCREEN itself is triggered as the last event of selection screen processing if all the input values were passed to the program. In this event block, all the user inputs can be checked. Sending a warning or an error message in the event block makes all the screen fields ready for input once again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 7 &lt;/P&gt;&lt;P&gt;... { ON { HELP-REQUEST | VALUE-REQUEST } FOR &lt;/P&gt;&lt;P&gt;    {para|selcrit-low|selcrit-high} }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The two events ON HELP-REQUEST and ON VALUE-REQUEST are triggered at the screen events POH and POV of a selection screen if - for the input field of a parameter para or one of the input fields of a selection criterion selcrit - the field help F1 or the input help F4 was called. Other selection events are not triggered. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;These event blocks can only be implemented for fields of the selection screen that are defined in the same ABAP program and not in a possibly linked logical database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the events for the field and input help, no data is transported between the selection screen and the ABAP program. As with general screens, suitable function modules must be used for these. The parameters and selection criteria changed for the input help are transported to the selection screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 8 &lt;/P&gt;&lt;P&gt;... ON EXIT-COMMAND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;In these executable programs, a standard selection screen and a further selection screen are defined. In the event blocks AT SELECTION-SCREEN, the inputs in the selection screens can be specially handled using the name p_carrid and the screen number in sy-dynnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_at_selection_screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Global data &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: sflight_tab TYPE TABLE OF sflight, &lt;/P&gt;&lt;P&gt;      sflight_wa  LIKE LINE  OF sflight_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Selection screens &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS p_carrid TYPE spfli-carrid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF SCREEN 500. &lt;/P&gt;&lt;P&gt;  SELECT-OPTIONS s_conn FOR sflight_wa-connid. &lt;/P&gt;&lt;P&gt;  DATA s_conn_wa LIKE LINE OF s_conn. &lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF SCREEN 500. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Handling selection screen events &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON p_carrid. &lt;/P&gt;&lt;P&gt;  IF p_carrid IS INITIAL. &lt;/P&gt;&lt;P&gt;    MESSAGE 'Please enter a value' TYPE 'E'. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;  AUTHORITY-CHECK OBJECT 'S_CARRID' &lt;/P&gt;&lt;P&gt;                      ID 'CARRID' FIELD p_carrid &lt;/P&gt;&lt;P&gt;                      ID 'ACTVT'  FIELD '03'. &lt;/P&gt;&lt;P&gt;  IF sy-subrc = 4. &lt;/P&gt;&lt;P&gt;    MESSAGE 'No authorization for carrier' TYPE 'E'. &lt;/P&gt;&lt;P&gt;  ELSEIF sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;    MESSAGE 'Error in authority check' TYPE 'A'. &lt;/P&gt;&lt;P&gt;  ELSE. &lt;/P&gt;&lt;P&gt;    IF sy-ucomm = 'ONLI'. &lt;/P&gt;&lt;P&gt;      CALL SELECTION-SCREEN '0500'. &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;AT SELECTION-SCREEN. &lt;/P&gt;&lt;P&gt;  IF sy-dynnr = '0500'. &lt;/P&gt;&lt;P&gt;    IF s_conn IS INITIAL. &lt;/P&gt;&lt;P&gt;      MESSAGE 'Please enter values' TYPE 'W'. &lt;/P&gt;&lt;P&gt;    ELSE. &lt;/P&gt;&lt;P&gt;      SELECT * &lt;/P&gt;&lt;P&gt;             FROM sflight &lt;/P&gt;&lt;P&gt;             INTO TABLE sflight_tab &lt;/P&gt;&lt;P&gt;             WHERE carrid = p_carrid AND &lt;/P&gt;&lt;P&gt;                   connid IN s_conn. &lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;        MESSAGE 'No flights found' TYPE 'E'. &lt;/P&gt;&lt;P&gt;      ENDIF. &lt;/P&gt;&lt;P&gt;    ENDIF. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Main program &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION. &lt;/P&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Apr 2008 11:06:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-17T11:06:57Z</dc:date>
    <item>
      <title>Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632387#M874883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please get me detailed information about Validations&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 10:31:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632387#M874883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T10:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632388#M874884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;refer the link below,&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/50b512e4174becbaf2b1c856eb1290/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/50b512e4174becbaf2b1c856eb1290/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 10:50:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632388#M874884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T10:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632389#M874885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Validations are nothing but getting messages when input values are wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In reports validations we can done using AT Selection-screen event.whatever the code u write within this event apply as validation on selection screen all fields.&lt;/P&gt;&lt;P&gt;If you want to validate perticular screen field then use at selection-screen on field event.this applies to perticular field what you specified in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In module pool you can do validations at PAI event.&lt;/P&gt;&lt;P&gt;if you want to validate a single field then write FIELD statement within PAI.&lt;/P&gt;&lt;P&gt;if you want to validate more than one field then write CHAIN....ENDCHAIN statement,within this you write for what fields you have to validate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if it helpful.&lt;/P&gt;&lt;P&gt;Dara.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 11:02:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632389#M874885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T11:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632390#M874886</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;AT SELECTION-SCREEN - selscreen_event &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;... &lt;SPAN __jive_macro_name="OUTPUT"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;  | { ON {para|selcrit} } &lt;/P&gt;&lt;P&gt;  | { ON END OF selcrit } &lt;/P&gt;&lt;P&gt;  | { ON BLOCK block } &lt;/P&gt;&lt;P&gt;  | { ON RADIOBUTTON GROUP radi } &lt;/P&gt;&lt;P&gt;  | { } &lt;/P&gt;&lt;P&gt;  | { ON {HELP-REQUEST|VALUE-REQUEST} &lt;/P&gt;&lt;P&gt;  |   FOR {para|selcrit-low|selcrit-high} } &lt;/P&gt;&lt;P&gt;  | { ON EXIT-COMMAND }. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatives: &lt;/P&gt;&lt;P&gt;1. ... OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... ON {para|selcrit} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ... ON END OF selcrit &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. ... ON BLOCK block &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. ... ON RADIOBUTTON GROUP radi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. ... { } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. ... { ON {HELP-REQUEST|VALUE-REQUEST} FOR &lt;/P&gt;&lt;P&gt;      {para|selcrit-low|selcrit-high} } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. ... ON EXIT-COMMAND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;These additions allow individual evaluation of specific elements of the selection screens of the program. The information as to which selection has triggered the event is contained in the system field sy-dynnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 1 &lt;/P&gt;&lt;P&gt;... OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 2 &lt;/P&gt;&lt;P&gt;... ON {para|selcrit} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 3 &lt;/P&gt;&lt;P&gt;... ON END OF selcrit &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered after the selection table selcrit has been fully passed to the program after a user action in the dialog box for the multiple selection has taken place. In the event block, the entire selection table can be checked. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 4 &lt;/P&gt;&lt;P&gt;... ON BLOCK block &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered at the screen event PAI of a selection screen if all the input fields of a block block of the selection screen were passed to the ABAP program. In the event block, the user inputs can be checked. Sending a warning or an error message in the event block makes all the fields of the block block ready for input again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 5 &lt;/P&gt;&lt;P&gt;... ON RADIOBUTTON GROUP radi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered at the screen event PAI of a selection screen if all the fields of a radio button group radi of the selection screen were passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or error message in the event block makes all the radion buttons of the block radi ready for input again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 6 &lt;/P&gt;&lt;P&gt;... { } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The event AT SELECTION-SCREEN itself is triggered as the last event of selection screen processing if all the input values were passed to the program. In this event block, all the user inputs can be checked. Sending a warning or an error message in the event block makes all the screen fields ready for input once again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 7 &lt;/P&gt;&lt;P&gt;... { ON { HELP-REQUEST | VALUE-REQUEST } FOR &lt;/P&gt;&lt;P&gt;    {para|selcrit-low|selcrit-high} }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The two events ON HELP-REQUEST and ON VALUE-REQUEST are triggered at the screen events POH and POV of a selection screen if - for the input field of a parameter para or one of the input fields of a selection criterion selcrit - the field help F1 or the input help F4 was called. Other selection events are not triggered. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;These event blocks can only be implemented for fields of the selection screen that are defined in the same ABAP program and not in a possibly linked logical database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the events for the field and input help, no data is transported between the selection screen and the ABAP program. As with general screens, suitable function modules must be used for these. The parameters and selection criteria changed for the input help are transported to the selection screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 8 &lt;/P&gt;&lt;P&gt;... ON EXIT-COMMAND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;In these executable programs, a standard selection screen and a further selection screen are defined. In the event blocks AT SELECTION-SCREEN, the inputs in the selection screens can be specially handled using the name p_carrid and the screen number in sy-dynnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_at_selection_screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Global data &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: sflight_tab TYPE TABLE OF sflight, &lt;/P&gt;&lt;P&gt;      sflight_wa  LIKE LINE  OF sflight_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Selection screens &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS p_carrid TYPE spfli-carrid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF SCREEN 500. &lt;/P&gt;&lt;P&gt;  SELECT-OPTIONS s_conn FOR sflight_wa-connid. &lt;/P&gt;&lt;P&gt;  DATA s_conn_wa LIKE LINE OF s_conn. &lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF SCREEN 500. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Handling selection screen events &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON p_carrid. &lt;/P&gt;&lt;P&gt;  IF p_carrid IS INITIAL. &lt;/P&gt;&lt;P&gt;    MESSAGE 'Please enter a value' TYPE 'E'. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;  AUTHORITY-CHECK OBJECT 'S_CARRID' &lt;/P&gt;&lt;P&gt;                      ID 'CARRID' FIELD p_carrid &lt;/P&gt;&lt;P&gt;                      ID 'ACTVT'  FIELD '03'. &lt;/P&gt;&lt;P&gt;  IF sy-subrc = 4. &lt;/P&gt;&lt;P&gt;    MESSAGE 'No authorization for carrier' TYPE 'E'. &lt;/P&gt;&lt;P&gt;  ELSEIF sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;    MESSAGE 'Error in authority check' TYPE 'A'. &lt;/P&gt;&lt;P&gt;  ELSE. &lt;/P&gt;&lt;P&gt;    IF sy-ucomm = 'ONLI'. &lt;/P&gt;&lt;P&gt;      CALL SELECTION-SCREEN '0500'. &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;AT SELECTION-SCREEN. &lt;/P&gt;&lt;P&gt;  IF sy-dynnr = '0500'. &lt;/P&gt;&lt;P&gt;    IF s_conn IS INITIAL. &lt;/P&gt;&lt;P&gt;      MESSAGE 'Please enter values' TYPE 'W'. &lt;/P&gt;&lt;P&gt;    ELSE. &lt;/P&gt;&lt;P&gt;      SELECT * &lt;/P&gt;&lt;P&gt;             FROM sflight &lt;/P&gt;&lt;P&gt;             INTO TABLE sflight_tab &lt;/P&gt;&lt;P&gt;             WHERE carrid = p_carrid AND &lt;/P&gt;&lt;P&gt;                   connid IN s_conn. &lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;        MESSAGE 'No flights found' TYPE 'E'. &lt;/P&gt;&lt;P&gt;      ENDIF. &lt;/P&gt;&lt;P&gt;    ENDIF. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Main program &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION. &lt;/P&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 11:06:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632390#M874886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T11:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632391#M874887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;     check this...this is the validation for material no ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables:mara.&lt;/P&gt;&lt;P&gt;parameters: p_matnr like mara-matnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_matnr  like mara-matnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single matnr&lt;/P&gt;&lt;P&gt;          from mara&lt;/P&gt;&lt;P&gt;into v_matnr where matnr = p_matnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;message s000 with 'this is not valid'.&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;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 11:08:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validations/m-p/3632391#M874887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T11:08:24Z</dc:date>
    </item>
  </channel>
</rss>

