Selection screen processing

Hello,
I want to update a selection screen field according to the values of two others. The two other field values wait for pressing Enter before passing their values. But I want to get the values of these fields when the focus is changed to the third field which I want to update. Which processing block should I use?
Thx,
Ali

write the code as follows..
initialization.
      ur code......
at selection-screen output.
     loop at screen.
           check ur condition.
           modify screen.
     endloop.
reward points please..

Similar Messages

  • Accessing WS data set during selection screen processing in BG processing

    Hello ABAPers,
    I am attempting to access a working storage table variable that is set during selection screen processing after the user submits the program to background processing (using F9).
    I have tried using export to memory id in the at selection screen section and then import from memory id in the start-of-selection section, but it does not seem to work all of the time.  Is there a better way of doing this?
    Thanks

    bump

  • Can Selection Screen processing events be triggered manually?

    Good day!
    I have a Selection Screen where a user can select a value from a drop-down box.  If a particular value is used, I assign default text to another Selection Screen field.
    However, because choosing the drop-down value doesn't trigger a Selection Screen processing event (AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT) the value doesn't get updated on the screen field, even though it gets updated in memory.  It only updates on the screen if the user selects a radio button value for another field because that triggers the Selection Screen processing events.
    I've read about various methods in an attempt to get this to work, but nothing is working.  Is there ANY way to trigger SAP to go to these events?
    Thanks, and points for all helpful advice!
    Dave

    Hi dave,
    1. Selecting a listbox on selection screen,
        and immediately populating a field value on the screen.
    2. just copy paste to get a taste of it.
    3.
    REPORT ABC.
    TYPE-POOLS : VRM.
    DATA : VALUES TYPE VRM_VALUES.
    DATA : VW LIKE LINE OF VALUES.
    DATA : FLAG TYPE C.
    PARAMETERS : LIST TYPE C AS LISTBOX VISIBLE LENGTH 10
    <b>USER-COMMAND ABC.</b>
    PARAMETERS : A(10) TYPE C.
    INITIALIZATION.
      VW-KEY = '1'.
      VW-TEXT = 'SUN'.
      APPEND VW TO VALUES.
      VW-KEY = '2'.
      VW-TEXT = 'MON'.
      APPEND VW TO VALUES.
      VW-KEY = '3'.
      VW-TEXT = 'TUE'.
      APPEND VW TO VALUES.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID              = 'LIST'
          VALUES          = VALUES
        EXCEPTIONS
          ID_ILLEGAL_NAME = 1
          OTHERS          = 2.
    <b>AT SELECTION-SCREEN  OUTPUT.
    A = LIST.</b>
    regards,
    amit m.

  • Selection screen processing in Module pool

    Dear Friends,
    I am preparing a module pool, in which from one screen, i have to call a selection screen. I want to define this selection screen in the same program. Under which event block, i can define this selection screen?
    Once its called, how can i process the selection screen ( like START-OF-SELECTION etc ?). If i use a LEAVE TO LIST-PROCESSING to display some output, how can i process the user actions in this list?
    Thanking you in anticipation.
    Deepak

    HI Max,
    Thanks a lot for your reply. It was really helpfull. But my problem is not yet solved.
    When i call the selection screen from the PBO of a screen, the selection screen is not being displayed. Only the blank screen is displayed. So i tried another way. I put the CALL SELECTION-ECREEN  statement in the USER_COMMAN_100 module of PAI of the previous screen. (ie when user choose a button from the tool bar, in the initial screen the selection screen will be displayed.)
    module user_command_0100 input.
      OK_SAVE = OK100.
      CLEAR OK100.
      CASE OK_SAVE.
        WHEN 'LIST'.
          CALL SELECTION-SCREEN 200.
          IF SY-SUBRC = 0.
            PERFORM PROCESS_LIST.
          ELSE.
            leave screen.
          ENDIF.
    endmodule.                 " USER_COMMAND_0100  INPUT
    form process_list.
    ... reading database...
    IF SY-SUBRC = 0.
      LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 100.
      SET PF-STATUS 'GUI_LIST'.
        LOOP AT ITAB.
          WRITE :/ ITAB-BUKRS, ITAB-BELNR, ITAB-GJAHR.
        ENDLOOP.
      LEAVE SCREEN.
      ENDIF.
    endform.                    " PROCESS_LIST
    Now i have two problems to solve.
    1. I want to come back to the same selection screen (screen no 200) instead of screen 100, when the user click 'back' button in the list. but if i specify screen no 200 in
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 100.
    it gives runtime error. ( Msg: Selection screen ZTEST3 0200 was not called using CALL SELECTION-SCREEN). How to return back to selection screen?
    and
    2. If the user selects a line from the list(PICK/F2), that value has to be passed to the input field of first screen( ie the initial screen from where i called the selection screen : screen no 100) For this, where can i write the code to process the user actions in the list?
    Thanking you in anticipation
    Deepak

  • Selections Screen Processing

    I have a selection screen with several select-options, most of which
    allow multiple selections and/or ranges.
    These selection crietera have to be used to retrieve data for
    a report.  I can generate a first SQL statement to retrieve all
    the records meeting the top-level selection criteria.  And then I would
    have to filter the data using several loops to apply the other
    selection criteria.  I could also create one or more views in the dictionary
    to reduce the need for this loop processing.
    What is the best way to proceed?

    Depend on ur database then you can decide ,You could write Normal select query with having join select query .
    Please take up in internal table only 3 tables for each join query and if you take more than 3 tables and it would be performance issue.
    and also try to use for all entries and it gives better option.

  • AT selection-screen : Processed 2 times!

    I do have a selection screen
    and event at-selection-screen.
    Some checkbox with usercommand
    When box is uncheck something has to be done but it is done 2 times!
    any idea +?

    My selection screens are generated by another program
    Here is the generated code!
    REPORT main_****.
    CALL SCREEN 0005.
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN  .
    SELECTION-SCREEN BEGIN OF BLOCK b_plan WITH FRAME TITLE box_plan.
    SELECTION-SCREEN PUSHBUTTON /01(20) p_9360 USER-COMMAND pl_9360.
    SELECTION-SCREEN PUSHBUTTON 26(20) p_0031 USER-COMMAND pl_0031.
    SELECTION-SCREEN PUSHBUTTON 51(20) p_7320 USER-COMMAND pl_7320.
    SELECTION-SCREEN PUSHBUTTON 76(20) p_7460 USER-COMMAND pl_7460.
    SELECTION-SCREEN PUSHBUTTON /01(20) p_0030 USER-COMMAND pl_0030.
    SELECTION-SCREEN PUSHBUTTON 26(20) p_3250 USER-COMMAND pl_3250.
    SELECTION-SCREEN PUSHBUTTON 51(20) p_4350 USER-COMMAND pl_4350.
    SELECTION-SCREEN PUSHBUTTON /01(20) p_6150 USER-COMMAND pl_6150.
    SELECTION-SCREEN PUSHBUTTON 26(20) p_0035 USER-COMMAND pl_0035.
    SELECTION-SCREEN PUSHBUTTON 51(20) p_4370 USER-COMMAND pl_4370.
    SELECTION-SCREEN PUSHBUTTON /01(20) p_0007 USER-COMMAND pl_0007.
    SELECTION-SCREEN PUSHBUTTON 26(20) p_7440 USER-COMMAND pl_7440.
    SELECTION-SCREEN PUSHBUTTON 51(20) p_4360 USER-COMMAND pl_4360.
    SELECTION-SCREEN END OF BLOCK b_plan .
    SELECTION-SCREEN END OF SCREEN 100.
    SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b_stat WITH FRAME TITLE box_stat.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 01(20) pstt_01
    FOR FIELD pst_01.
    PARAMETERS pst_01 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_01.
    SELECTION-SCREEN COMMENT 26(20) pstt_05
    FOR FIELD pst_05.
    PARAMETERS pst_05 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_05.
    SELECTION-SCREEN COMMENT 51(20) pstt_08
    FOR FIELD pst_08.
    PARAMETERS pst_08 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_08.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 01(20) pstt_03
    FOR FIELD pst_03.
    PARAMETERS pst_03 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_03.
    SELECTION-SCREEN COMMENT 26(20) pstt_06
    FOR FIELD pst_06.
    PARAMETERS pst_06 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_06.
    SELECTION-SCREEN COMMENT 51(20) pstt_10
    FOR FIELD pst_10.
    PARAMETERS pst_10 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_10.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 01(20) pstt_04
    FOR FIELD pst_04.
    PARAMETERS pst_04 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_04.
    SELECTION-SCREEN COMMENT 26(20) pstt_07
    FOR FIELD pst_07.
    PARAMETERS pst_07 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_07.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b_stat .
    SELECTION-SCREEN END OF SCREEN 200.
    SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b_licha WITH FRAME TITLE box_lich.
    DATA : g_licha TYPE mch1-licha.
    SELECT-OPTIONS : so_licha FOR g_licha.
    SELECTION-SCREEN END OF BLOCK b_licha .
    SELECTION-SCREEN END OF SCREEN 300.
    SELECTION-SCREEN BEGIN OF SCREEN 333 AS SUBSCREEN.
    SELECTION-SCREEN INCLUDE BLOCKS b_stat.
    SELECTION-SCREEN INCLUDE BLOCKS b_licha.
    SELECTION-SCREEN INCLUDE BLOCKS b_plan.
    SELECTION-SCREEN END OF SCREEN 333.
    SELECTION-SCREEN BEGIN OF SCREEN 666 AS SUBSCREEN.
    SELECTION-SCREEN END OF SCREEN 666.
    SELECTION-SCREEN BEGIN OF SCREEN 999 AS SUBSCREEN.
    SELECTION-SCREEN END OF SCREEN 999.
    SELECTION-SCREEN BEGIN OF SCREEN 0005.
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR
    17
    LINES,
        TAB (20) button1 USER-COMMAND push1 DEFAULT SCREEN 333,
        TAB (20) button2 USER-COMMAND push2 DEFAULT SCREEN 666,
        TAB (20) button3 USER-COMMAND push3 DEFAULT SCREEN 999,
                      END OF BLOCK mytab.
    SELECTION-SCREEN END OF SCREEN 0005.
    INITIALIZATION.
      SET  PF-STATUS 'STAT'.
      sy-title = '-= [ MDi Cockpit ] =-'.
      TABLES zvmdi16. RANGES : r_status FOR zvmdi16-zzmdistat.
      r_status-sign = 'I'. r_status-option = 'EQ'.
      MOVE 'ACB' TO p_9360.
      MOVE 'Avilés' TO p_0030.
      MOVE 'Cockerill Sambre' TO p_6150.
      MOVE 'EKO Stahl GmbH' TO p_0007.
      MOVE 'Etxebarri' TO p_0031.
      MOVE 'Galvalange' TO p_3250.
      MOVE 'Gijón' TO p_0035.
      MOVE 'Sagunto' TO p_7440.
      MOVE 'Sidmar' TO p_7320.
      MOVE 'Sollac Atlantique' TO p_4350.
      MOVE 'Sollac Lorraine' TO p_4370.
      MOVE 'Sollac Méditerranée' TO p_4360.
      MOVE 'Stahlwerke Bremen' TO p_7460.
      MOVE '01-Initialized' TO pstt_01.
      MOVE '01' TO r_status-low. APPEND r_status.
      MOVE '03-Send to Plant' TO pstt_03.
      MOVE '03' TO r_status-low. APPEND r_status.
      MOVE '04-Analysis by Plant' TO pstt_04.
      MOVE '04' TO r_status-low. APPEND r_status.
      MOVE '05-Pending at Plant' TO pstt_05.
      MOVE '05' TO r_status-low. APPEND r_status.
      MOVE '06-Updated for Leverage' TO pstt_06.
      MOVE '06' TO r_status-low. APPEND r_status.
      MOVE '07-Wait for new MDI Message' TO pstt_07.
      MOVE '07' TO r_status-low. APPEND r_status.
      MOVE '08-Returned to Leverage' TO pstt_08.
      MOVE '08' TO r_status-low. APPEND r_status.
      MOVE '10-Ignore MDI Message' TO pstt_10.
      MOVE '10' TO r_status-low. APPEND r_status.
    AT SELECTION-SCREEN OUTPUT.
      MOVE 'Vendor Batch' TO %_so_licha_%_app_%-text.
      MOVE 'Plant' TO box_plan.
      MOVE 'MDi Status' TO box_stat.
      MOVE ' Main Selection ' TO button1 .
      MOVE ' Status Information ' TO button2 .
      MOVE ' Error Information ' TO button3 .
    AT SELECTION-SCREEN.
      IF sy-ucomm CS 'PL_'.
        IF r_status[] IS INITIAL.
          MESSAGE e398(00) WITH 'No Status have been selected!'.
        ELSE.
          SUBMIT zvl_mdi_errorwf_plant
                WITH s_licha IN so_licha
                WITH s_plant = sy-ucomm+3
                WITH s_status IN r_status
          AND RETURN.
        ENDIF.
      ELSEIF sy-ucomm CS 'PST_'.
        DELETE r_status WHERE low = sy-ucomm+4.
        IF sy-subrc NE 0.
          MOVE  sy-ucomm+4(2) TO r_status-low. APPEND r_status.
        ENDIF.
        CLEAR sy-ucomm.
      ENDIF.

  • Issue with tabbed block in selection screen

    Hi All,
    I have created a report program with the following code.
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
    PARAMETERS: p1 TYPE c LENGTH 10.
    SELECTION-SCREEN END OF SCREEN 100.
    SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    PARAMETERS: q1 TYPE c LENGTH 10.
    SELECTION-SCREEN END OF SCREEN 200.
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                      TAB (20) button1 USER-COMMAND push1,
                      TAB (20) button2 USER-COMMAND push2,
                      END OF BLOCK mytab.
    INITIALIZATION.
      button1 = 'Selection Screen 1'.
      button2 = 'Selection Screen 2'.
      mytab-prog = sy-repid.
      mytab-dynnr = 0100.
      mytab-activetab = 'PUSH1'.
    AT SELECTION-SCREEN.
      CASE sy-dynnr.
        WHEN 1000.
          CASE sy-ucomm.
            WHEN 'PUSH1'.
              mytab-dynnr = 100.
            WHEN 'PUSH2'.
              mytab-dynnr = 200.
          ENDCASE.
      ENDCASE.
    Execute the program and click on the second tab-page. Now, click on the 'Execute' button or press F8 (there is no specific functionality coded here).
    The issue now is that the first tab-page is displayed, instead of the second tab remaining displayed. I require the navigation to remain within the second tab-page after the EXECUTE button is clicked.
    Could someone help me out with this issue?
    Regards,
    Dinup
    Edited by: Dinup Sudhakaran on Feb 18, 2008 1:40 PM

    Hi,
    Go through below document with example code.
    It will help you.
    Tabstrip Controls on Selection Screens
    As with screens, you can now use tabstrip controls on selection screens. To do this, you must define a tabstrip area and the associated tab pages, and assign a subscreen to the tab pages. You do not have to (indeed, cannot) declare the tabstrip control or program the screen flow logic in your ABAP program, since both are automatically generated.
    To define a tabstrip area with tab pages, use the following statements in your selection screen definition:
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK <tab_area> FOR <n> LINES,
                      TAB (<len>) <tab1> USER-COMMAND <ucom1>
                                  [DEFAULT [PROGRAM <prog>] SCREEN <scrn>],
                      TAB (<len>) <tab2> USER-COMMAND <ucom2>
                                  [DEFAULT [PROGRAM <prog>] SCREEN <scrn>],
                      END OF BLOCK <tab_area>.
    This defines a tabstrip control <tab_area> with size <n>. The tab pages <tab1>, <tab2>… are assigned to the tab area. <len> defines the width of the tab title. You must assign a function code <ucom> area to each tab title. You can find out the function code from the field SY-UCOMM in the AT SELECTION-SCREEN event.
    For each tab title, the system automatically creates a character field in the ABAP program with the same name. Before the selection screen is displayed, you can assign a text to the field. This then appears as the title of the corresponding tab page on the selection screen.
    You must assign a subscreen to each tab title. This will be displayed in the tab area when the user chooses that title. You can assign one of the following as a subscreen:
    A subscreen screen defined using the Screen Painter.
    A selection screen subscreen, defined in an ABAP program.
    You can make the assignment either statically in the program or dynamically at runtime. If, at runtime, one of the tab titles has no subscreen assigned, a runtime error occurs.
    Static assignment
    Use the DEFAULT addition when you define the tab title. You can specify an ABAP program and one of its subscreens. If you do not specify a program, the system looks for the subscreen in the current program. When the user chooses the tab title, it is activated, and the subscreen is assigned to the tabstrip area. The static assignment is valid for the entire duration of the program, but can be overwritten dynamically before the selection screen is displayed.
    Dynamic assignment
    For each tab area, the system automatically creates a structure in the ABAP program with the same name. This structure has three components – PROG, DYNNR, and ACTIVETAB. When you assign the subscreens statically, the structure contains the name of the ABAP program containing the subscreen, the number of the subscreen, and the name of the tab title currently active on the selection screen (and to which these values are assigned). The default active tab page is the first page. You can assign values to the fields of the structure before the selection screen is displayed, and so set a subscreen dynamically.
    If you assign a normal subscreen screen to a tab title, the dialog modules containing its flow logic must be defined in the current ABAP program. If the subscreen is a selection screen, user actions will trigger the AT SELECTION-SCREEN event and its variants (see Selection Screen Processing). This includes when the user chooses a tab title. If one selection screen is included on another, AT SELECTION-SCREEN will be triggered at least twice – firstly for the "included" selection screen, then for the selection screen on which it appears.
    REPORT demo_sel_screen_with_tabstrip.
    DATA flag(1) TYPE c.
    SUBSCREEN 1
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p1(10) TYPE c,
                p2(10) TYPE c,
                p3(10) TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN END OF SCREEN 100.
    SUBSCREEN 2
    SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
    PARAMETERS: q1(10) TYPE c OBLIGATORY,
                q2(10) TYPE c OBLIGATORY,
                q3(10) TYPE c OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN END OF SCREEN 200.
    STANDARD SELECTION SCREEN
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                      TAB (20) button1 USER-COMMAND push1,
                      TAB (20) button2 USER-COMMAND push2,
                      TAB (20) button3 USER-COMMAND push3
                                       DEFAULT SCREEN 300,
                      END OF BLOCK mytab.
    INITIALIZATION.
      button1 = text-010.
      button2 = text-020.
      button3 = text-030.
      mytab-prog = sy-repid.
      mytab-dynnr = 100.
      mytab-activetab = 'BUTTON1'.
    AT SELECTION-SCREEN.
      CASE sy-dynnr.
        WHEN 1000.
          CASE sy-ucomm.
            WHEN 'PUSH1'.
              mytab-dynnr = 100.
              mytab-activetab = 'BUTTON1'.
            WHEN 'PUSH2'.
              mytab-dynnr = 200.
              mytab-activetab = 'BUTTON2'.
          ENDCASE.
        WHEN 100.
          MESSAGE s888(sabapdocu) WITH text-040 sy-dynnr.
        WHEN 200.
          MESSAGE s888(sabapdocu) WITH text-040 sy-dynnr.
      ENDCASE.
    MODULE init_0100 OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'MOD'.
          CASE flag.
            WHEN 'X'.
              screen-input = '1'.
            WHEN ' '.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      MESSAGE s888(sabapdocu) WITH text-050 sy-dynnr.
      CASE sy-ucomm.
        WHEN 'TOGGLE'.
          IF flag = ' '.
            flag = 'X'.
          ELSEIF flag = 'X'.
            flag = ' '.
          ENDIF.
      ENDCASE.
    ENDMODULE.
    START-OF-SELECTION.
      WRITE: / 'P1:', p1,'Q1:', q1,
             / 'P2:', p2,'Q2:', q2,
             / 'P3:', p3,'Q3:', q3.
    This program defines two selection screens – 100 and 200, as subscreens, and places a tabstrip control area with three tab pages on the standard selection screen. A subscreen screen 300 (from the same program) is assigned statically to the third tab page.
    The layout of screen 300 is:
    The input/output fields P1 to Q3 are defined by using the parameters from the ABAP program The pushbutton has the function code TOGGLE.
    The screen flow logic for screen 300 is as follows:
    PROCESS BEFORE OUTPUT.
      MODULE init_0100.
    PROCESS AFTER INPUT.
      MODULE user_command_0100.
    Both dialog modules are defined in the ABAP program.
    When you run the program, the standard selection screen appears. In the INITIALIZATION event, the texts are defined on the tab titles, the subscreen selection screen 100 is assigned to the tab area, and the first tab title is activated.
    User actions on the selection screen are processed in the AT SELECTION-SCREEN event block. In particular, it is here that the subscreens are assigned and tab titles activated when the user chooses one of the first two tab titles. This is not necessary for the third tab title, since the dynamic assignment (screen 300) is always placed in the structure MYTAB when the user chooses it.
    Before the subscreen screen is displayed, the PBO module INIT_100 is executed. User actions on the subscreen screen trigger the PAI module. This includes when the user chooses a tab title. After that, the AT SELECTION-SCREEN event is triggered.
    Messages in the status line show where an action has been processed.

  • At selection-screen output and  at selection-screen on

    Hi Experts,
    I had coded in both at selection-screen output for disabling input of certain fields and at selection-screen for validation like this:
    AT SELECTION-SCREEN output.
      IF p_amt = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_AMT'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_B4C'.
              screen-input = '1'.
            WHEN 'P_AFC'.
              screen-input = '1'.
            WHEN 'P_COM'.
              screen-input = '1'.
            WHEN 'P_COM1'.
              screen-input = '1'.
            WHEN 'P_COM2'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_amt = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_AMT'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_B4C'.
              screen-input = '1'.
            WHEN 'P_AFC'.
              screen-input = '1'.
            WHEN 'P_COM'.
              screen-input = '1'.
            WHEN 'P_COM1'.
              screen-input = '1'.
            WHEN 'P_COM2'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_pdf = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_PDF'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_PATH'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_afc = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'S_FID-LOW' OR 'S_FID-HIGH'.
              screen-input = '0'.
            WHEN 'S_ORG-LOW' OR 'S_ORG-HIGH'.
              screen-input = '0'.
            WHEN 'S_OFF-LOW' OR 'S_OFF-HIGH'.
              screen-input = '0'.
            WHEN 'S_DAT-LOW' OR 'S_DAT-HIGH'.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    AT selection-screen on block b5.
    if p_tst is initial.
      message text-016 type 'E'.
    endif.
    AT selection-screen on block b2.
    if p_amt ne 'X' and p_pdf ne 'X'.
    if s_fid is initial and s_org is initial.
    message text-000 type 'E'.
    endif.
    if s_dat is initial.
    message text-000 type 'E'.
    endif.
    endif.
    when i comment out at selection-screen validations the input is disabled for the screen fields as set, else the validations are executed first.
    Any solution for this???
    Thanks in advance.

    AT SELECTION-SCREEN
    Syntax
    AT SELECTION-SCREEN selscreen_event.
    Effect
    This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
    Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
    AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
    Note
    The event blocks after AT SELECTION-SCREEN are implemented internally as procedures. Declarative statments in these event blocks create local data.

  • Problem in enabling the selection screen

    Hi ,
    I have problem in enabling the selection screen.
    i have radio button and based on the radio button i need to make the date field as mandatory.
    When i tried this with at selection screen on radio button group XXX, itu2019s not triggering.
    Could you please help me by resolving the above problem?
    Vijay

    Hi,
    see the sap documentation
    ... RADIOBUTTON GROUP group [USER-COMMAND fcode]
    Effect:
    This addition specifies that the input field is displayed as a radio button in the first position on the selection screen, and the output field is displayed next to it on the right. The radio button is selected if the value of para is "X" or "x". Otherwise, it is not selected.
    group is used to define the radio button group for the parameter. The name group is entered directly as a character string with a maximum of 4 characters. Within a selection screen, there must be a minimum of two parameters in the same radio button group. There cannot be more than one radio button group with the same name in one program, even if they are defined in different selection screens.
    The parameter must be specified with the type c and length 1. Explicit length specification using len is not permitted. If the addition TYPE is used, it can only be followed by the generic type c or a non-generic data type of type
    In a radio button group, only one parameter can be defined with the addition DEFAULT, and the specified value must be "X". By default, the first parameter in a radio button group is set to the value "X", and the rest are set to " ".
    The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly, and have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects any radio button of the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields. If a function code used in the GUI status of the selection screen is specified for fcode, the selection screen processing is affected accordingly.
    Note:
    It is recommended to define the radio buttons of a radio button group directly underneath each other. If the selection screen also contains other elements, it is recommended to define each radio button group within a block surrounded by a frame.
    Regards,
    Venkatesh

  • Dynamic text in selection screen

    Hi all,
    I have one requirement in selection screen. I have a parameter and one pushbutton in selection screen .
    To the right side of the parameter, i need to display the text based on some manipulation in a internal in the program.
    If I click on the pushbutton in selection screen , manipulations will be done in the program in a internal table. if the result is ok i need to display the text in the right side of the parameter otherwise no need to display.
    How can I achieve this.
    Urgent
    Thanks
    Saravana

    Hi
    Write the code in the
    AT selection-screen ON PARAMETER of the Button.
    So when pressed on button, that code will do some process and the result will be displayed.
    check it, whether it displays the text or not on selection screen.
    see the doc
    AT SELECTION-SCREEN - selscreen_event
    Syntax
      | { ON {para|selcrit} }
      | { ON END OF selcrit }
      | { ON BLOCK block }
      | { ON RADIOBUTTON GROUP radi }
      | { }
      | { ON {HELP-REQUEST|VALUE-REQUEST}
      |   FOR {para|selcrit-low|selcrit-high} }
      | { ON EXIT-COMMAND }.
    Alternatives:
    1. ... OUTPUT
    2. ... ON {para|selcrit}
    3. ... ON END OF selcrit
    4. ... ON BLOCK block
    5. ... ON RADIOBUTTON GROUP radi
    6. ... { }
    7. ... ON {HELP-REQUEST|VALUE-REQUEST} FOR
          {para|selcrit-low|selcrit-high} }
    8. ... ON EXIT-COMMAND
    Effect
    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.
    Alternative 1
    ... OUTPUT
    Effect
    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.
    Note
    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.
    Alternative 2
    ... ON {para|selcrit}
    Effect
    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.
    No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
    Note
    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.
    Alternative 3
    ... ON END OF selcrit
    Effect
    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.
    Alternative 4
    ... ON BLOCK block
    Effect
    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.
    Alternative 5
    ... ON RADIOBUTTON GROUP radi
    Effect
    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.
    Note
    The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par.
    Alternative 6
    Effect
    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.
    Alternative 7
    ... ON { HELP-REQUEST | VALUE-REQUEST } FOR
        {para|selcrit-low|selcrit-high} }
    Effect
    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.
    In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary.
    Notes
    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.
    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.
    Alternative 8
    ... ON EXIT-COMMAND
    Effect
    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.
    Example
    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.
    REPORT demo_at_selection_screen.
    Global data
    DATA: sflight_tab TYPE TABLE OF sflight,
          sflight_wa  LIKE LINE  OF sflight_tab.
    Selection screens
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECTION-SCREEN BEGIN OF SCREEN 500.
      SELECT-OPTIONS s_conn FOR sflight_wa-connid.
      DATA s_conn_wa LIKE LINE OF s_conn.
    SELECTION-SCREEN END OF SCREEN 500.
    Handling selection screen events
    AT SELECTION-SCREEN ON p_carrid.
      IF p_carrid IS INITIAL.
        MESSAGE 'Please enter a value' TYPE 'E'.
      ENDIF.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                          ID 'CARRID' FIELD p_carrid
                          ID 'ACTVT'  FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE 'No authorization for carrier' TYPE 'E'.
      ELSEIF sy-subrc <> 0.
        MESSAGE 'Error in authority check' TYPE 'A'.
      ELSE.
        IF sy-ucomm = 'ONLI'.
          CALL SELECTION-SCREEN '0500'.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
      IF sy-dynnr = '0500'.
        IF s_conn IS INITIAL.
          MESSAGE 'Please enter values' TYPE 'W'.
        ELSE.
          SELECT *
                 FROM sflight
                 INTO TABLE sflight_tab
                 WHERE carrid = p_carrid AND
                       connid IN s_conn.
          IF sy-subrc <> 0.
            MESSAGE 'No flights found' TYPE 'E'.
          ENDIF.
        ENDIF.
      ENDIF.
    Main program
    START-OF-SELECTION.
    Reward points if useful
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • Selection Screen Parameter behaving strangely.

    This one is too weird to believe.  Here's what's happening.  I have a normal abap list report with a checkbox parameter.  I set the value to 'X' initialization and it works the first time the selection screen is presented.  Upon running the program I turn off the checkbox.  I want the value to be re-initialized to 'X' whenever the selection screen appears.  The problem is when F3 is pressed on the list screen, the initialization is invoked and the parameter set to 'X' but the selection screen appears without the checkbox selected.  I have verified this through the debugger.  Is there a better to change the values of selection screen parameters?

    Hello Scott,
    I'm not sure if you know about this, so I would explain it to you.
    In case of selection-screen processing, the UCOMM value is to be obtained from the structure SSCRFIELDS, as against the structure SY(ST) in case of normal screen processing.
    Consider the following code snippet.
    ====================================================
    tables sscrfields.
    parameters : p_check          as checkbox.
    data        :w_do_not_reset type flag.
    at selection-screen output.
      if w_do_not_reset eq space.
        p_check = 'X'.
      endif.
    at selection-screen.
      if sscrfields-ucomm eq space.
        w_do_not_reset = 'X'.
      else.
        clear w_do_not_reset.
      endif.
    start-of-selection.
      write : p_check.
    ====================================================
    As the example illustrates, we need to declare the structure SSCRFIELDS with a tables statement and use the value of SSCRFIELDS-UCOMM.
    Hope this helps.
    Regards,
    Anand Mandalika.
    P.S. : If you are satisfied with the solution, please award the points.

  • SELECTION SCREEN ON

    HI
    GIVE ME EXPLANATION ON SELECTION-SCREEN-ON??

    Hi Abhi,
    AT SELECTION-SCREEN - selscreen_event
    Syntax
      | { ON {para|selcrit} }
      | { ON END OF selcrit }
      | { ON BLOCK block }
      | { ON RADIOBUTTON GROUP radi }
      | { }
      | { ON {HELP-REQUEST|VALUE-REQUEST}
      |   FOR {para|selcrit-low|selcrit-high} }
      | { ON EXIT-COMMAND }.
    Alternatives:
    1. ... OUTPUT
    2. ... ON {para|selcrit}
    3. ... ON END OF selcrit
    4. ... ON BLOCK block
    5. ... ON RADIOBUTTON GROUP radi
    6. ... { }
    7. ... ON {HELP-REQUEST|VALUE-REQUEST} FOR
          {para|selcrit-low|selcrit-high} }
    8. ... ON EXIT-COMMAND
    Effect
    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.
    Alternative 1
    ... OUTPUT
    Effect
    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.
    Note
    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.
    Alternative 2
    ... ON {para|selcrit}
    Effect
    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.
    No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
    Note
    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.
    Alternative 3
    ... ON END OF selcrit
    Effect
    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.
    Alternative 4
    ... ON BLOCK block
    Effect
    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.
    Alternative 5
    ... ON RADIOBUTTON GROUP radi
    Effect
    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.
    Note
    The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par.
    Alternative 6
    Effect
    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.
    Alternative 7
    ... ON { HELP-REQUEST | VALUE-REQUEST } FOR
        {para|selcrit-low|selcrit-high} }
    Effect
    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.
    In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary.
    Notes
    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.
    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.
    Alternative 8
    ... ON EXIT-COMMAND
    Effect
    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.
    Example
    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.
    REPORT demo_at_selection_screen.
    Global data
    DATA: sflight_tab TYPE TABLE OF sflight,
          sflight_wa  LIKE LINE  OF sflight_tab.
    Selection screens
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECTION-SCREEN BEGIN OF SCREEN 500.
      SELECT-OPTIONS s_conn FOR sflight_wa-connid.
      DATA s_conn_wa LIKE LINE OF s_conn.
    SELECTION-SCREEN END OF SCREEN 500.
    Handling selection screen events
    AT SELECTION-SCREEN ON p_carrid.
      IF p_carrid IS INITIAL.
        MESSAGE 'Please enter a value' TYPE 'E'.
      ENDIF.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                          ID 'CARRID' FIELD p_carrid
                          ID 'ACTVT'  FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE 'No authorization for carrier' TYPE 'E'.
      ELSEIF sy-subrc <> 0.
        MESSAGE 'Error in authority check' TYPE 'A'.
      ELSE.
        IF sy-ucomm = 'ONLI'.
          CALL SELECTION-SCREEN '0500'.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
      IF sy-dynnr = '0500'.
        IF s_conn IS INITIAL.
          MESSAGE 'Please enter values' TYPE 'W'.
        ELSE.
          SELECT *
                 FROM sflight
                 INTO TABLE sflight_tab
                 WHERE carrid = p_carrid AND
                       connid IN s_conn.
          IF sy-subrc <> 0.
            MESSAGE 'No flights found' TYPE 'E'.
          ENDIF.
        ENDIF.
      ENDIF.
    Main program
    START-OF-SELECTION.
    <b>Reward points if this helps,</b>
    Kiran

  • At selection-screen value- help

    Hi All,
    I have a requirement that based on a radio button one at selection-screen value-help is triggered and on based on a different radio button another at selection-screen value-help should be triggered.
    can it be achieved.
    Regards,
    Jeetu

    AT SELECTION-SCREEN - selscreen_event
    Syntax
      | { ON {para|selcrit} }
      | { ON END OF selcrit }
      | { ON BLOCK block }
      | { ON RADIOBUTTON GROUP radi }
      | { }
      | { ON {HELP-REQUEST|VALUE-REQUEST}
      |   FOR {para|selcrit-low|selcrit-high} }
      | { ON EXIT-COMMAND }.
    Alternatives:
    1. ... OUTPUT
    2. ... ON {para|selcrit}
    3. ... ON END OF selcrit
    4. ... ON BLOCK block
    5. ... ON RADIOBUTTON GROUP radi
    6. ... { }
    7. ... ON {HELP-REQUEST|VALUE-REQUEST} FOR
          {para|selcrit-low|selcrit-high} }
    8. ... ON EXIT-COMMAND
    Effect
    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.
    Alternative 1
    ... OUTPUT
    Effect
    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.
    Note
    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.
    Alternative 2
    ... ON {para|selcrit}
    Effect
    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.
    No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
    Note
    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.
    Alternative 3
    ... ON END OF selcrit
    Effect
    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.
    Alternative 4
    ... ON BLOCK block
    Effect
    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.
    Alternative 5
    ... ON RADIOBUTTON GROUP radi
    Effect
    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.
    Note
    The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par.
    Alternative 6
    Effect
    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.
    Alternative 7
    ... ON { HELP-REQUEST | VALUE-REQUEST } FOR
        {para|selcrit-low|selcrit-high} }
    Effect
    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.
    In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary.
    Notes
    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.
    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.
    Alternative 8
    ... ON EXIT-COMMAND
    Effect
    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.
    Example
    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.
    REPORT demo_at_selection_screen.
    Global data
    DATA: sflight_tab TYPE TABLE OF sflight,
          sflight_wa  LIKE LINE  OF sflight_tab.
    Selection screens
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECTION-SCREEN BEGIN OF SCREEN 500.
      SELECT-OPTIONS s_conn FOR sflight_wa-connid.
      DATA s_conn_wa LIKE LINE OF s_conn.
    SELECTION-SCREEN END OF SCREEN 500.
    Handling selection screen events
    AT SELECTION-SCREEN ON p_carrid.
      IF p_carrid IS INITIAL.
        MESSAGE 'Please enter a value' TYPE 'E'.
      ENDIF.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                          ID 'CARRID' FIELD p_carrid
                          ID 'ACTVT'  FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE 'No authorization for carrier' TYPE 'E'.
      ELSEIF sy-subrc <> 0.
        MESSAGE 'Error in authority check' TYPE 'A'.
      ELSE.
        IF sy-ucomm = 'ONLI'.
          CALL SELECTION-SCREEN '0500'.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
      IF sy-dynnr = '0500'.
        IF s_conn IS INITIAL.
          MESSAGE 'Please enter values' TYPE 'W'.
        ELSE.
          SELECT *
                 FROM sflight
                 INTO TABLE sflight_tab
                 WHERE carrid = p_carrid AND
                       connid IN s_conn.
          IF sy-subrc <> 0.
            MESSAGE 'No flights found' TYPE 'E'.
          ENDIF.
        ENDIF.
      ENDIF.
    Main program
    START-OF-SELECTION.

  • Difference between At selection-screen  and At selection-screen field

    I need to know the difference between
    Difference between At selection-screen  and At selection-screen field
    Regards
    Shashi

    Hi,
    AT SELECTION-SCREEN is the event triggered in the PAI of the selection screen.
    AT SELECTION-SCREEN on field field_name is the event specific to the field and is triggered when u press enter in that field.
    AT SELECTION-SCREEN selscreen_event.
    Effect
    This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
    Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
    AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
    SELECTION-SCREEN FIELD SELECTION
    FOR {NODE|TABLE} node [ID id].
    Effect
    This statement defines a node node in the structure of the logical database for field selection. If a node belongs to type T, you can use the TABLE addition instead of NODE. The statement cannot be used for type C nodes. .
    If a node is defined for field selection, you can use an executable program linked to the logical database in the GET statement to control which fields in the node are to be read by the logical database. If you use the function module LDB_PROCESS, the FIELD_SELECTION parameter must be specified accordingly.
    for more details check this link...
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm
    Regards,
    Priyanka.

  • ALV selection screen

    Hi,
    Iam new to A.L.V and have few queries.please tell me the coding for the below.
    At selection screen:
    Process the following validations for selection screen fields and display the appropriate error messages.
    1.     Validate  the Date From (SAP Transaction Date ) against VEKP –Created-On Date .
    2.     Validate  the Date From (SAP Transaction Date ) against VEKP –Created-On Date .
    3.     Validate the Plant From (Transaction Source Location ) against VEKP – Shipping Point.
    4.     Validate the Plant To (Transaction Destination Location ) against VEKP – Shipping Point.
    5.     Validate the Pallet ID against VEKP – Handling Unit.
    6.      If Date From field is blank, display an appropriate error message.
    7.     If Plant From field is blank, display an appropriate error message.
    Kindly send me the coding for this.
    Regards,
    Tanya

    Hi,
    the code is  :
    *For VEKP-Created-on-date :
    AT SELECTION-SCREEN ON s_erdat.
      IF NOT s_erdat[] IS INITIAL.
        SELECT erdat FROM VEKP    INTO VEKP-ERDAT
                      WHERE ERDAT IN s_erdat.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE 'Enter a valid created date' Type E.
        ENDIF.
    Else ( for question 6& 7)
    MESSAGE 'Enter a date in the Date From field' Type E.
      ENDIF.
    from 1 to 2, the above was the code.. and from 3 to 5 - the else paart is not requried..

Maybe you are looking for

  • Question regardin Receiver Determination

    Hi, IS there any way to determine the receiver from multiple receivers based on value which is coming from User defined function? I tried XPATH but I am able to populate only Sender Message Type in that. In my requirements I've to put condition based

  • APP prinout

    Hi gurus, I have an issue with the prinout. I have run the payment proposal for a usd payment. it gives me the message payment run successful. posting done. when i click on prinout, it gives me a message scheduled. However when i check in sp01, i don

  • When I click on a link nothing happens

    The cursor changes to the pointing hand but nothing happens when I click.

  • Photoshop CC - where art thou?

    Hi!I would like to install Photoshop CC on my machine. I don't see it in 'APPS' on my Creative Cloud desktop though. All I see is Photoshop CC 2014 - which I have installed and will not open some of my work files (which were created in Photoshop CC).

  • ITunes batch tag rename - 'processing' or immediate - why?

    Right, so I've been renaming some of the genre tags of my mp3s. Select a load, 'get info', change the genre, click OK. Sometimes the change happens immediately and is reflected in the song list. Other times a dialogue box appears, says 'processing' a