Skip to Content

AT SELECTION-SCREEN - Urgent

Could anybody tell me what does the event( AT SELECTION-SCREEN ) only do ? I am asking only about AT SELECTION-SCREEN

Regards,

SAURAV LAHIRY

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:54 AM

    Hi,

    It tells about the actions to be triggered after user entered the values on the selection screen.

    Plzz reward points if it helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:54 AM

    Hi,

    this event is triggered on any user action on selection-screen.

    Cheers,

    Will.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:54 AM

    Hi

    hope it will help you.

    Pls reward pts if help.

    Selection screens are special screens that are defined with the help of ABAP statements. As programmers do not have access to the flow logic of selection screens, they cannot define dialog modules for selection screens. The ABAP runtime environment fully controls the processing flow of selection screens. To allow programmers to modify the selection screen before it is called (PBO) and react to user actions on the selection screen (PAI), the ABAP runtime environment generates a number of special selection screen events before the selection screen is displayed and after the user has executed actions on the selection screen. Programmers can define event blocks in the program to react to these events.

    The basic form of the selection screen events is the AT SELECTION-SCREEN event. This event occurs after the runtime environment has passed all input data from the selection screen to the ABAP program. The other selection screen events allow programmers to modify the selection screen before it is sent and specifically check user input.

    Selection screen events occur both during standard and user-defined selection screen processing. The SY-DYNNR system field contains the number of the active selection screen and helps you to determine which selection screen is currently being processed in the event blocks.

    Overview of Selection Screen Events

    For example, a standard selection screen is defined as follows in the declaration part of an executable program:

    The following graphic shows the possible selection screen events and their chronological sequence between the INITIALIZATION and the START-OF-SELECTION event. If user-defined selection screens are called, the event sequence is imbedded accordingly in the current program flow.

    Selection screen processing starts after the INITIALIZATION event with AT SELECTION SCREEN OUTPUT. The selection screen is then sent to the screen. User actions on the selection screen result in other events that are either used for field or possible entries help, or that trigger PAI processing of the selection screen. During PAI processing, error messages in the relevant event blocks allow users to return to the selection screen. Only if the AT SELECTION-SCREEN event is exited properly, that is not through an error message, are the other events of the executable program triggered, starting with START-OF-SELECTION.

    Choosing multiple selection calls the relevant dialog box. Similarly, events are triggered during its PAI processing.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:54 AM

    Hi,

    AT SELECTION-SCREEN does the validation of the screen field specified in the selection screen.

    Hope this helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:54 AM

    Hi,

    The event AT SELECTION-SCREEN is the basic form of a whole series of events that occur while the selection screen is being processed.

    AT SELECTION-SCREEN OUTPUT

    event is triggered. This event block allows you to modify the selection screen directly before it is displayed.

    AT SELECTION-SCREEN ON <field>

    is triggered when the contents of each individual input field are passed from the selection screen to the ABAP program. The input field <field> can be checked in the corresponding event block. If an error message occurs within this event block, the corresponding field is made ready for input again on the selection screen.

    AT SELECTION-SCREEN ON BLOCK <block>

    is triggered when the contents of all of the fields in a block are passed from the selection screen to the ABAP program. You define a block by enclosing the declarations of the elements in the block between the statements SELECTION-SCREEN BEGIN OF BLOCK <block> and SELECTION-SCREEN END OF BLOCK <block>.

    AT SELECTION-SCREEN ON <seltab>

    event is triggered for the current line of the selection table. It can then be processed like a single field.

    Next, the

    AT SELECTION-SCREEN ON END OF <seltab>

    event is triggered. This event block allows you to check the whole selection table <seltab>. Warning messages are displayed as dialog boxes, not in the status line.

    AT SELECTION-SCREEN ON HELP-REQUEST FOR <field>

    The event is triggered when the user calls the F1 help for the field <field>. If no corresponding event block has been defined, the help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference. If a corresponding event block exists, it takes precedence over the default help mechanism. It is then up to the programmer to ensure that appropriate help is displayed.

    AT SELECTION-SCREEN ON RADIOBUTTON GROUP <radi>

    is triggered when the contents of all of the fields in a radio button group are passed from the selection screen to the ABAP program. To define a radio button group <radi>, use the addition RADIOBUTTON GROUP <radi> in the corresponding PARAMETERS statements

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>

    The event is triggered when the user calls the F4 help for the field <field>. If no corresponding event block has been defined, the possible values help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference.

    follow this link for more information on AT SELECTION-SCREEN.

    http://help.sap.com/saphelp_nw2004s/helpdata/en/79/34a234d9b511d1950e0000e8353423/content.htm

    Regards,

    Omkaram.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:56 AM

    hI,

    At selection-screen is the event of a report program in which we have to validate the selection screen fields.

    SELECTION SCREEN

    Selection screens are special screens that are defined with the help of ABAP statements. As programmers do not have access to the flow logic of selection screens, they cannot define dialog modules for selection screens. The ABAP runtime environment fully controls the processing flow of selection screens. To allow programmers to modify the selection screen before it is called (PBO) and react to user actions on the selection screen (PAI), the ABAP runtime environment generates a number of special selection screen events before the selection screen is displayed and after the user has executed actions on the selection screen

    AT SELECTION-SCREEN OUTPUT

    This event is executed at PBO of the selection screen every time the user presses ENTER - in contrast to INITIALIZATION . Therefore, this event is not suitable for setting selection screen default values. Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used) and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.

    Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of selection screen fields.

    Example

    SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.

    ...

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    CHECK SCREEN-GROUP1 = 'XYZ'.

    SCREEN-INTENSIFIED = '1'.

    MODIFY SCREEN.

    ENDLOOP.

    AT SELECTION-SCREEN ON VALUE-REQUEST

    The event is triggered when the user calls the F4 help for the field field. If no corresponding event block has been defined, no possible values help or values list from the Dictionary is displayed. If a corresponding event block exists, it takes precedence over the default possible values help mechanism. It is then up to the programmer to ensure in the event block that an appropriate list of values is displayed, and that the user can choose a value from it.

    No event block AT SELECTION-SCREEN ON VALUE-REQUEST can be created for input fields on the selection screen that are declared within the logical database used. You cannot override the input help mechanism of the logical database within the executable program. You can define separate help within the logical database program using the VALUE-REQUEST option in the PARAMETERS and SELECT-OPTIONSstatements.

    Example

    INCLUDE DBXYZSEL

    ...

    PARAMETERS PL_TYPE LIKE SAPLANE-PLANETYPE VALUE-REQUEST.

    ...

    REPORT SAPDBXYZ DEFINING DATABASE XYZ.

    ...

    TABLES SAPLANE.

    ...

    FORM PL_TYPE_VAL.

    ...

    CALL FUNCTION ...

    ...

    ENDFORM.

    AT SELECTION-SCREEN ON HELP-REQUEST

    If the data type of an input field declared in an executable program is defined in the ABAP Dictionary, the documentation of the underlying data element is automatically displayed if the user positions the cursor in that field and presses F1. To create help for input fields that have no Dictionary reference, or to override the help normally linked to the field, you can create an event block for the event

    AT SELECTION-SCREEN ON HELP-REQUEST FOR <field>

    The event is triggered when the user calls the F1 help for the field <field>. If no corresponding event block has been defined, the help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference. If a corresponding event block exists, it takes precedence over the default help mechanism. It is then up to the programmer to ensure that appropriate help is displayed.

    You cannot declare the event block AT SELECTION-SCREEN ON HELP-REQUEST for input fields on the selection screen that are declared within a logical database. You cannot override the help mechanism of a logical database within the program. You can define separate help within the logical database program using the HELP-REQUEST option in the PARAMETERS and SELECT-OPTIONS statements.

    REPORT SELECTION_SCREEN_F1_DEMO.

    PARAMETERS: P_CARR_1 TYPE S_CARR_ID,

    P_CARR_2 TYPE S_CARR_ID.

    AT SELECTION-SCREEN ON HELP-REQUEST FOR P_CARR_2.

    CALL SCREEN 100 STARTING AT 10 5

    ENDING AT 60 10.

    This program declares a selection screen with two parameters that both refer to the data element S_CARR_ID in the ABAP Dictionary. The documentation from the ABAP Dictionary is used for P_CARR_1, and a help screen 100 is called for P_CARR_2. The help screen is defined in the Screen Painter as a modal dialog box with next screen 0. It contains the help text defined as help texts. The screen does not require any flow logic.

    AT SELECTION-SCREEN ON field

    In the PAI event of the selection screen, the event

    AT SELECTION-SCREEN ON field

    event is triggered. The input field field can be checked in the corresponding event block. If an error message occurs within this event block, the corresponding field is made ready for input again on the selection screen.

    Example:

    REPORT event_demo.

    NODES spfli.

    AT SELECTION-SCREEN ON city_fr.

    IF carrid-low EQ 'AA' AND city_fr NE 'NEW YORK'.

    MESSAGE e010(hb).

    ENDIF.

    If the user enters “AA” in the first input field, but not NEW YORK for the departure city, an error message is displayed in the status line until the user enters the correct city.

    AT SELECTION-SCREEN ON RADIOBUTTON

    In the PAI event of the selection screen, the event

    AT SELECTION-SCREEN ON RADIOBUTTON GROUP <radi>

    is triggered when the contents of all of the fields in a radio button group are passed from the selection screen to the ABAP program. To define a radio button group <radi>, use the addition RADIOBUTTON GROUP <radi> in the corresponding PARAMETERS statements. This event block allows you to check the whole group. If an error message occurs within this event block, the radio button group is made ready for input again on the selection screen. The individual fields of radio button groups do not trigger the event AT SELECTION-SCREEN ON <field>.

    REPORT EVENT_DEMO.

    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

    PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',

    R2 RADIOBUTTON GROUP RAD1,

    R3 RADIOBUTTON GROUP RAD1.

    SELECTION-SCREEN END OF BLOCK B1.

    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

    PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',

    R5 RADIOBUTTON GROUP RAD2,

    R6 RADIOBUTTON GROUP RAD2.

    SELECTION-SCREEN END OF BLOCK B2.

    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.

    IF R1 = 'X'.

    MESSAGE W040(HB).

    ENDIF.

    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.

    IF R4 = 'X'.

    MESSAGE W040(HB).

    ENDIF.

    If the user does not change one of the radio button groups, a warning is displayed.

    AT SELECTION-SCREEN ON BLOCK

    In the PAI event of the selection screen, the event

    AT SELECTION-SCREEN ON BLOCK <block>

    is triggered when the contents of all of the fields in a block are passed from the selection screen to the ABAP program. You define a block by enclosing the declarations of the elements in the block between the statements SELECTION-SCREEN BEGIN OF BLOCK <block> and SELECTION-SCREEN END OF BLOCK <block>. You can use this event block to check the consistency of the input fields in the block. If an error message occurs within this event block, the fields in the block are made ready for input again on the selection screen.

    Reward Points if found helpfull..

    Cheers,

    Chandra Sekhar.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 29, 2008 at 06:56 AM

    In short -

    at selection screen is used for validating the values entered in the selection-screen.

    For whole story refer this link -

    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/at_selec.htm

    Regards,

    Amit

    Reward all helpful replies.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:57 AM

    Hi Saurav,

    this is for interactive reporting.in ur basic list when u click on a line this event gets triggered.so the code u write after AT line-selection gets executed.

    Thanks

    swaroop

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.