Event - At selection-screen

Hi Friends,
Use of at selection screen event is to perform some validation PBO .. process before output.
But wht is the use of
AT SELCETION-SCREEN ON
AT SELECTION-SCREEN OUTPUT
Please explain with some sample programs.

Hi,
<b>AT SELCETION-SCREEN ON</b>
The event is processed when the selection screen has been processed (at the end of PAI ).
Validation & Checks of inputted values happen here
<b>AT SELECTION-SCREEN OUTPUT.</b>
The event is processed before the display of  selection screen.
<b>You can refer with this example also..</b>
REPORT  z_72105_alv_radio.
TABLES: eban,mara, sscrfields.
TYPE-POOLS: slis.
DATA: BEGIN OF it_eban OCCURS 0,
banfn TYPE eban-banfn,
bnfpo TYPE eban-bnfpo,
bsakz TYPE eban-bsakz,
statu TYPE eban-statu,
ekgrp TYPE eban-ekgrp,
matnr TYPE eban-matnr,
werks TYPE eban-werks,
lgort TYPE eban-lgort,
preis TYPE eban-preis,
peinh TYPE eban-peinh,
END OF it_eban.
DATA: ad_repid TYPE sy-repid,
      matnew TYPE eban-matnr,
      strloc TYPE eban-lgort.
DATA : BEGIN OF it_mara OCCURS 0,
       matnr TYPE mara-matnr,
       END OF it_mara.
DATA : BEGIN OF it_lgort OCCURS 0,
       lgort TYPE eban-lgort,
       END OF it_lgort.
DATA: inum TYPE i VALUE 1,
      icount TYPE i VALUE 0.
DATA: fldcat TYPE slis_t_fieldcat_alv,
      layout TYPE slis_layout_alv,
      e_event TYPE slis_t_event,
      wa_event TYPE slis_alv_event.
INITIALIZATION .
  ad_repid = sy-repid.
  LOOP AT SCREEN.
    IF screen-group1 = 'C1' .
      screen-active  = '0' .
      MODIFY SCREEN .
    ENDIF.
    IF screen-name = 'S_MATNR-HIGH' OR screen-name = 'S_MATNR-LOW' OR screen-name = 'STR-HIGH' OR screen-name = 'STR-LOW'.
      screen-input = '0' .
      MODIFY SCREEN .
    ENDIF.
  ENDLOOP.
  PERFORM fieldcatalog_populate USING fldcat.
  PERFORM layout USING layout.
  PERFORM build_event.
  SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
  PARAMETERS: r1 RADIOBUTTON GROUP prr USER-COMMAND x ,
              r2  RADIOBUTTON GROUP prr .
  SELECTION-SCREEN END OF BLOCK b1.
  SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-000.
  PARAMETERS: material  AS CHECKBOX USER-COMMAND x MODIF ID d1  .
  SELECT-OPTIONS: s_matnr FOR mara-matnr MODIF ID d1.
  PARAMETERS:  storage  AS CHECKBOX USER-COMMAND x MODIF ID d1.
  SELECT-OPTIONS: str FOR eban-lgort MODIF ID d1.
  SELECTION-SCREEN END OF BLOCK b2.
  SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
  SELECT-OPTIONS: banfn  FOR eban-banfn MODIF ID c1.
  SELECTION-SCREEN END OF BLOCK b3.
  SELECTION-SCREEN PUSHBUTTON 1(15)  text-t10 USER-COMMAND fetch .
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF r1 EQ 'X' AND
       screen-group1 = 'C1'.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.
  LOOP AT SCREEN.
    IF r2 EQ 'X' AND
       screen-group1 = 'D1'.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.
  LOOP AT SCREEN.
    IF material EQ 'X' .
      IF screen-name = 'S_MATNR-HIGH' OR screen-name = 'S_MATNR-LOW'.
        screen-input = '1' .
        MODIFY SCREEN .
      ENDIF.
    ELSE.
      IF material NE 'X' .
        IF screen-name = 'S_MATNR-HIGH' OR screen-name = 'S_MATNR-LOW'.
          screen-input = '0' .
          MODIFY SCREEN .
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
  LOOP AT SCREEN.
    IF storage EQ 'X' .
      IF screen-name = 'STR-HIGH' OR screen-name = 'STR-LOW'.
        screen-input = '1' .
        MODIFY SCREEN .
      ENDIF.
    ELSE.
      IF storage NE 'X' .
        IF screen-name = 'STR-HIGH' OR screen-name = 'STR-LOW'.
          screen-input = '0' .
          MODIFY SCREEN .
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
AT USER-COMMAND .
AT SELECTION-SCREEN.
  CASE sscrfields.
    WHEN 'FETCH'.
      PERFORM z_72105_selection.
  ENDCASE.
*&      Form  USER_COMMAND
      text
     -->V_UCOMM    text
     -->SELFIELD   text
FORM user_command USING v_ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
  IF v_ucomm = 'PREVIOUS'.
    inum = inum - 1.
    IF inum = 0.
      inum = inum + 1.
      icount = 0.
      MESSAGE e000(z_72105_msg).
    ELSE.
      icount = 0.
      LOOP AT it_eban.
        DELETE it_eban.
      ENDLOOP.
      PERFORM z_72105_selection.
    ENDIF.
  ENDIF.
  IF v_ucomm = 'NEXT'.
    LOOP AT it_mara .
      icount = icount + 1 .
    ENDLOOP.
    inum = inum + 1.
    IF inum GT icount  .
      inum = inum - 1 .
      icount = 0 .
      MESSAGE e000(z_72105_msg).
    ELSE.
      icount = 0.
      LOOP AT it_eban .
        DELETE it_eban .
      ENDLOOP.
    ENDIF.
    PERFORM z_72105_selection.
  ENDIF.
ENDFORM.                    "user_command
**&      Form  z_72105_selection
      text
FORM z_72105_selection .
END-OF-SELECTION.
START-OF-SELECTION.
  SELECT DISTINCT matnr FROM eban INTO TABLE it_mara WHERE matnr IN s_matnr.
  READ TABLE it_mara INTO matnew INDEX inum.
  SELECT * FROM eban INTO CORRESPONDING FIELDS OF TABLE it_eban
  WHERE matnr = matnew.
  SELECT DISTINCT lgort FROM eban INTO TABLE it_lgort WHERE lgort IN str.
  READ TABLE it_lgort INTO strloc INDEX inum.
  SELECT * FROM eban INTO CORRESPONDING FIELDS OF TABLE it_eban
  WHERE lgort = strloc.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
    I_INTERFACE_CHECK                 = ' '
    I_BYPASSING_BUFFER                = ' '
    I_BUFFER_ACTIVE                   = ' '
      i_callback_program                = ad_repid
      i_callback_pf_status_set          = 'SET_PF_STATUS'
      i_callback_user_command            = 'USER_COMMAND'
    I_CALLBACK_TOP_OF_PAGE            = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    I_CALLBACK_HTML_END_OF_LIST       = ' '
    I_STRUCTURE_NAME                  =
    I_BACKGROUND_ID                   = ' '
    I_GRID_TITLE                      =
    I_GRID_SETTINGS                   =
     is_layout                         = layout
     it_fieldcat                       = fldcat
    IT_EXCLUDING                      =
    IT_SPECIAL_GROUPS                 =
    IT_SORT                           =
    IT_FILTER                         =
    IS_SEL_HIDE                       =
    I_DEFAULT                         = 'X'
    I_SAVE                            = ' '
    IS_VARIANT                        =
     it_events                         = e_event
    IT_EVENT_EXIT                     =
    IS_PRINT                          =
    IS_REPREP_ID                      =
    I_SCREEN_START_COLUMN             = 0
    I_SCREEN_START_LINE               = 0
    I_SCREEN_END_COLUMN               = 0
    I_SCREEN_END_LINE                 = 0
    I_HTML_HEIGHT_TOP                 = 0
    I_HTML_HEIGHT_END                 = 0
    IT_ALV_GRAPHICS                   =
    IT_HYPERLINK                      =
    IT_ADD_FIELDCAT                   =
    IT_EXCEPT_QINFO                   =
    IR_SALV_FULLSCREEN_ADAPTER        =
  IMPORTING
    E_EXIT_CAUSED_BY_CALLER           =
    ES_EXIT_CAUSED_BY_USER            =
    TABLES
      t_outtab                          = it_eban
  EXCEPTIONS
    PROGRAM_ERROR                     = 1
    OTHERS                            = 2
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
  I_CALLBACK_PROGRAM                = ' '
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = ' '
  I_CALLBACK_TOP_OF_PAGE            = ' '
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
  I_BACKGROUND_ID                   = ' '
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
  IS_LAYOUT                         =
  IT_FIELDCAT                       =
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =
  IT_EVENTS                         =
  IT_EVENT_EXIT                     =
  IS_PRINT                          =
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  I_HTML_HEIGHT_TOP                 = 0
  I_HTML_HEIGHT_END                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  IR_SALV_FULLSCREEN_ADAPTER        =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
  TABLES
    t_outtab                          =
EXCEPTIONS
  PROGRAM_ERROR                     = 1
  OTHERS                            = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.                    " z_72105_selection
*&      Form  set_pf_status
      text
     -->RT_EXTAB   text
FORM set_pf_status USING rt_extab  TYPE slis_t_extab .
  SET PF-STATUS 'SET_PF_STATUS' .
ENDFORM .                    "SET_PF_STATUS

Similar Messages

  • Enforcing event AT-SELECTION-SCREEN OUTPUT

    Hi Gurus
    Does anybody know how to force event AT-SELECTION-SCREEN OUTPUT ?
    What I'm aiming for is changing screen somewere outside of this event. For example.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_param.
      IF p_param = 'change'.
        changes_in_screen = 'X'.
        *???*   "forcing AT-SELECTION-SCREEN OUTPUT event
      ENDIF.
    AT-SELECTION-SCREEN OUTPUT.
      IF changes_in_screen = 'X'.
        LOOP AT SCREEN.
          "do something
        ENDLOOP.
      ENDIF.
    I would be grateful for any hints.

    One alternative to define two selection screens.  First selection screen (default selection screen of report #1000) having Client_type.  After user hits execute (F8) then show the second selection screen with corresponding parameters.
    PARAMETERS: p_client(1).
    SELECTION-SCREEN BEGIN OF SCREEN 9000 AS WINDOW.
    PARAMETERS: p_name(20),
                p_lname(20),
                p_cname(20),
                p_oname(20).
    SELECTION-SCREEN END OF SCREEN 9000.
    AT SELECTION-SCREEN OUTPUT.
      CHECK sy-dynnr = '9000'.
    *  Hide corresponding fields on second selection screen
    *  based on values of P_CLIENT.
    *  Also should make key parameters obligatory!
    START-OF-SELECTION.
      CALL SELECTION-SCREEN 9000 STARTING AT 5 5.
    Another alternative is to use a dialog/module pool program to handle this.  Such screen field controlling can easily be done in dialog programs because you have full PAI/PBO control, unlike report program selection screen 1000.  Unfortunately in a dialog program it is not easy to reproduce the functionality of a select-option.

  • Regarding the event AT SELECTION-SCREEN ON FIELD ..

    Hi experts,
    Can u plz tell the real advantage of the event AT SELECTION-SCREEN ON FIELD than
    AT SELECTION-SCREEN ..
    in which type of situations  AT SELECTION-SCREEN ON FIELD is needed??
    Thanks & Regards,
    sathish.

    Hi,
    when we are going to do two are more field validations at a time
    we can use AT SELECTION-SCREEN ON <fieldname>.
    if it is there single field we can use AT SELECTION-SCREEN.
    have a look.
    select-options: s_vbeln like vbak-vbeln,
                          s_vkorg like vbak-vkorg,
                          s_vtweg like vbak-vtweg,
                          s_matnr like vbap-matnr.
    AT SELECTION-SCREEN ON s_vbeln.
    select----
    if sy-subrc <> 0.
    error message.
    endif.
    AT SELECTION-SCREEN ON s_vkorg.
    select----
    if sy-subrc <> 0.
    error message.
    endif.
    AT SELECTION-SCREEN ON s_vtweg.
    select----
    if sy-subrc <> 0.
    error message.
    endif.
    AT SELECTION-SCREEN ON s_matnr.
    select----
    if sy-subrc <> 0.
    error message.
    endif.
    Regards.
    sriram.

  • Event at selection-screen output

    Hi all,
    we have common include for all the reports. Now i need to add few selects to all screens based upon some conditions.so i added the seletions to the common include. Based upon some conditions ,i need to activate or deactivate these selections. this can be done at the event at seleciton-screen output. so i did that but few programs are giging dump as these programs already have the above mentioned event(ie at selection-screen output) now how to solve this issue.
    Please suggest me .
    Thanks
    Jaffer Vali shaik

    Hi Jaffer,
    The conditions to display the additional selection, are they based on user input data? If not, you could try to put the logic in the initialization event. Check the 'where-used list' to see whether all programs accessing this common include already has initialization event or not.
    If the display for selection are based on other selection criteria, then you need to evaluate the common include. Based on your project standard, does the include should have events processing in it? If yes, maybe the few programs that cause shortdump should move their logic to this common include (using the SY-REPID condition).
    Regards,
    Dewi

  • Query related to at selection screen event & at selection-screen output

    Hi all,
    thanks in advance
    i have two radio buttons say rd1 & rd2
    on my selection screen i have date,period,year and these fields r mandatory fields
    when i try to select the radio button rd2 then it is not disabling the fields period and year rather it is checking the fields for mandatory and vicevesr
    here is the code plz help me out
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
        IF rd1 = 'X'.
          IF screen-group1  = 'GR1'.
            screen-input  = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
        IF rd2 = 'X'.
          IF screen-group1  = 'GR2'.
            screen-input  = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN.
    blank period is not allowed
        IF monat[] IS INITIAL.
          MESSAGE e008.
        ENDIF.
    blank fiscal year is not allowed
        IF gjahr[] IS INITIAL.
          MESSAGE e009.
        ENDIF.
    blank document date is not allowed
        IF bldat[] IS INITIAL.
          MESSAGE e020.
        ENDIF.
    awiting for all u r replies

    I UNDERSTOOD Y U HAVE GIVE ERROR MESSAGE,
    WHEN U R DECLARING THE VALUES AS OBLIGATORY BEFORE, THEN NO NEED TO GIVE MESSAGES IN AT SELECTION SCREEN.
    BUT BASED ON SOME CONDITIONS, IF U WANT TO MAKE THEM OBLIGATORY DYNAMICALLY THEN GIVE THE CONDITION ALSO
    EXAMPLE
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF a = 'X'.
          IF screen-group1 = 'GR2'.
            screen-input = 0.
                 ELSE.
           SCREEN-INPUT = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
        IF c = 'X'.
          IF screen-group1 = 'GR1'.
            screen-input = 0.
         ELSE.
           SCREEN-INPUT = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN.
    IF  d is initial.
    MESSAGE e009.
    ENDIF.
    start-of-selection.
    write b.
    2ND EXAMPLE:
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF a = 'X'.
          IF screen-group1 = 'GR2'.
            screen-input = 0.
                 ELSE.
           SCREEN-INPUT = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
        IF c = 'X'.
          IF screen-group1 = 'GR1'.
            screen-input = 0.
         ELSE.
           SCREEN-INPUT = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN.
    IF B = 5 AND d is initial.
    MESSAGE e009.
    ENDIF.
    start-of-selection.
    write b.
    I HAVE SENT U TWO EXAMPLES, IN THE SEOND EXMAPLE, IT WORKS FINE AS U HAVE GIVEN SOME OTHER CONDITION.
    IN THE FIRST EXAMPLE, AS IT WILL NOT WORK AS IAM CHECKING ONLY INITIAL CONDITION.
    FOR CHECKING ONLY INITIAL CONDITION, NO NEED TO WRITE IT AT SELECTION SCREEN , U CAN DIRECTLY DECLARE AS OBLIGATORY IN THE BEGINING IT SELF.
    JUST COPY AND PASTE MY TWO PROGRAMS AND FIND OUT THE DIFFERENCE IAM EXPLAINING
    Message was edited by: Hymavathi Oruganti

  • 'SET PF-STATUS EXCLUDING fcode' not working in Selection Screen event

    Hi all,
    I am trying to set PF-Status dynamically in Selection Screen based on Radio button.
    For that i have inserted following code under event --> AT SELECTION-SCREEN OUTPUT
    * SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS: s_inc  RADIOBUTTON GROUP rad DEFAULT 'X'
                       USER-COMMAND inc MODIF ID mod,
                p_inc(10) MODIF ID m1,
                s_lbr  RADIOBUTTON GROUP rad,
                p_lbr(10) MODIF ID m2.
    SELECTION-SCREEN END OF BLOCK b1.
    *  AT SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      REFRESH fcode.
      IF s_inc IS INITIAL.
        APPEND 'CRTE' TO fcode.
        APPEND 'CHNG' TO fcode.
        APPEND 'DISP' TO fcode.
        APPEND 'PRNI' TO fcode.
        APPEND 'CRTL' TO fcode.
        SET PF-STATUS 'STATUS_IN' EXCLUDING fcode.
      ELSE.
        SET PF-STATUS 'STATUS_IN'.
      ENDIF.
    Though s_inc is initial, i can see all the buttons from Status 'STATUS_IN' after execution of above code. EXCLUDING statement is not taking any effect which we normally get in Module pool program.
    Please tell me what went wrong in above code?

    Problem solved ......Thanks Keshav,
    Giving code correction -->
    * SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS: s_inc  RADIOBUTTON GROUP rad DEFAULT 'X'
                       USER-COMMAND inc MODIF ID mod,
                p_inc(10) MODIF ID m1,
                s_lbr  RADIOBUTTON GROUP rad,
                p_lbr(10) MODIF ID m2.
    SELECTION-SCREEN END OF BLOCK b1.
    *  AT SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      REFRESH fcode.
      IF s_inc IS INITIAL.
        APPEND 'CRTI' TO fcode.
        APPEND 'CHGI' TO fcode.
        APPEND 'DISI' TO fcode.
        APPEND 'DELI' TO fcode.
        APPEND 'PRNI' TO fcode.
        APPEND 'CRTL' TO fcode.
        APPEND 'DATA' TO fcode.
      ELSE.
        APPEND 'CHGL' TO fcode.
        APPEND 'DISL' TO fcode.
        APPEND 'PRNL' TO fcode.
      ENDIF.
      CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
        EXPORTING
          p_status        = 'STATUS_IN'
          P_PROGRAM       = sy-repid
        TABLES
          p_exclude       = fcode

  • Issue with AT SELECTION-SCREEN ON event

    Hi Experts!!
    In the below code, p_jan, p_feb are showing as blank though they are filled in. Is this how this event works?
    PARAMETERS: p_categ TYPE zpycateg,
                             p_jan TYPE sy-datum,
                             p_feb TYPE sy-datum.
    AT SELECTION-SCREEN ON p_categ.
    IF NOT p_jan IS INITIAL.
    ENDIF.
    Please help me out.

    Hi
    That event works for P_CATEG, here other parameters of the screen can't been seen.
    If you want to do a validation has to check several parameters of a selection-screen you should use the event AT SELECTION-SCREEN.
    Anyway if you think it's better the event AT SELECTION-SCREEN ON <screen field>, the values of other fields can be picked up bu fm DYNP_VALUES_READ
    AT SELECTION-SCREEN ON P_CATEG.
      DATA: T_FIELDS TYPE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.
      T_FIELDS-FIELDNAME = 'P_JAN'. APPEND T_FIELDS.
      T_FIELDS-FIELDNAME = 'P_FEB'. APPEND T_FIELDS.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          DYNAME     = SY-REPID
          DYNUMB     = SY-DYNNR
        TABLES
          DYNPFIELDS = T_FIELDS.
      READ TABLE T_FIELDS WITH KEY FIELDNAME = 'P_JAN'.
      IF NOT T_FIELDS-FIELDVALUE IS INITIAL.
      ENDIF.
    Max

  • Radio button on selection screen event issue.

    Hi all,
    I have two radio buttons and two input mandatory fields on selection screen.
    - If  first radio button selected then some value 'ABC' should fill in second input field.(because it is a mandatory field)
    - If  second radio button selected then some value 'XYZ' should fill in first input field..(because it is a mandatory field)
    If suppose, user deletes first input value (ABC) and selects second Radio then, ABC to automatically display on first input field as this is mandatory. Same like,If he deletes second input field value and selects first radio, it should display XYZ in second input field. (As these fields are mandatory and requires some value).
    I tried with below code, but not working. Appreciate your quick response.
    PARAMETER          ppart RADIOBUTTON GROUP src  DEFAULT 'X'.
    SELECT-OPTIONS  p_sndprn FOR edoc_stat-sndprn OBLIGATORY DEFAULT 'ABC'.
    PARAMETER         psndr RADIOBUTTON GROUP src.
    SELECT-OPTIONS p_sendid FOR zabc-sndlad OBLIGATORY DEFAULT 'XYZ'.   
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP src.
    IF SSCRFIELDS-UCOMM = 'PRGP'.
      IF ppart EQ 'X'.
           P_SENDID-LOW = 'XYZ'.
      ELSE.
          P_SNDPRN-LOW = 'ABC'.
      ENDIF.
    ENDIF.
    Thanks,
    Ranjith.

    Search the forum... don't make fields obligatory and use event AT SELECTION-SCREEN OUTPUT.

  • Radiobutton during at selection-screen event is not triggered

    Hi experts,
    I have this event:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file
    perform f_file_sel.
    I want to select a file according to the radiobuttons on the selection screen, but during the f_file_sel form I recognized, that the radiobutton which I selected is not triggered.
    It's only triggered after 'start-of-selection'.
    How can I force the program to trigger it when f_file_sel is processing?

    Hi,
    SELECT-OPTIONS : so_matnr1    FOR  mvke-matnr MODIF ID id1,
                                    so_matnr2   FOR  mara-wrkst MODIF ID id2.
    PARAMETERS : rb_mat TYPE c RADIOBUTTON GROUP rbg DEFAULT 'X' USER-COMMAND hid,
                              rb_var TYPE c RADIOBUTTON GROUP rbg.
    LOOP AT SCREEN.
        IF rb_mat EQ c_x.
          IF screen-group1 EQ  'ID2'.
            screen-input = '0'.
          ENDIF.
        ENDIF.
        IF rb_var EQ c_x.
          IF screen-group1 EQ 'ID1'.
            screen-input = '0'.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Apply this piece of code to your requirement with files in place of fields.Hope your issue will be resolved.
    Regards,
    Anand.

  • 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.

  • At selection screen-calling two events

    Hi experts,
       I have the following requirement-
    I am supposed to have 2 radio buttons and a text box to enter a file name on the selection-screen and based on the button the user selects i need to provide F4 help for the text box. If the user selects the 1st radio button, i need to provide F4 help to get a presentation server file and if he chooses the 2nd one an F4 help for application server file needs to be triggered.
    I have 2 at selection-screen events- one for radio button and the other for F4 help  and the problem is only one gets triggered at one go.
       Could somebody please tell me how to capture radio button values in the event at selection-screen on value request?
    Thanks and Regatrds,
    Pallavi

    code-
    data:lw_flag(1).
    PARAMETERS:p_mode1 RADIOBUTTON group g1 default 'X',
               p_mode2 RADIOBUTTON group g1 .
    parameter p_desti type string.
    AT SELECTION-SCREEN.
    if sy-ucomm eq 'g1'.
      if p_mode1 eq 'X'.
           lw_flag = 'X'.
      elseif p_mode2 eq 'X'.
         lw_flag = ' '.
      endif.
    endif.
      IF p_desti IS INITIAL.
        MESSAGE E001(0).
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_desti.
    *Display the pop up to accept the file name
    if lw_flag = 'X'.
    PERFORM f4_get_filename_presentation.
    else.
    PERFORM f4_get_filename_application.
    endif.

  • At Selection-screen Events!

    Hi!
      Pls tell me the order of selection screen events in sequence
    Pls give some sample program for validation of selection screen i/p without using search helps.
      Thanks

    Hi Rahul
    Basic form
    AT SELECTION-SCREEN.
    Additions
    1. ... ON psel
    2. ... ON END OF sel
    3. ... ON VALUE-REQUEST FOR psel_low_high .
    4. ... ON HELP-REQUEST FOR psel_low_high
    5. ... ON RADIOBUTTON GROUP radi
    6. ... ON BLOCK block
    7. ... OUTPUT
    Effect
    This event only makes sense in reports, i.e. in programs set to type 1 in the attributes. Type 1 programs are started via a logical database and always have a selection screen where the user can specify the database selections.
    The event is processed when the selection screen has been processed (at the end of PAI ).
    If an error message ( MESSAGE Emnr ) is sent during the event, all fields on the selection screen become ready for input.
    After further user input, AT SELECTION-SCREEN is executed again.
    Note
    You should only perform very expensive checks with AT SELECTION-SCREEN if the program is then started (not every time the user presses ENTER). Here, you can read the system field SSCRFIELDS-UCOMM (provided a statement TABLES SSCRFIELDS exists). If the field has one of the values 'ONLI' (= Execute) or 'PRIN' (= Execute and Print), the report is then started, i.e. the selection screen is closed and the processing continues with START-OF-SELECTION . Remember that the selection screen (and thus also AT SELECTION-SCREE N ) is also processed in variant maintenance and with SUBMIT VIA JOB . You can determine which of these applies by calling the function module RS_SUBMIT_INFO .
    Addition 1
    ... ON psel
    Effect
    This event is assigned to the selection screen fields corresponding to the report parameter or selection criterion psel .
    If the report starts an error dialog at this point, precisely these fields become ready for input.
    Addition 2
    ... ON END OF sel
    Effect
    For each selection criterion sel on the selection screen, you can call a further screen by pressing a pushbutton. On this screen, you can enter any number of single values and ranges for the selection criterion sel .
    When this screen has been processed (i.e. at the end of PAI for this screen), the event AT SELECTION-SCREEN ON END OF sel is executed.
    At this point, all the values entered are available in the internal table sel .
    Addition 3
    ... ON VALUE-REQUEST FOR psel_low_high
    Effect
    With this addition, the field psel_low_high is either the name of a report parameter or of the form sel-LOW or sel-HIGH , where sel is the name of a selection criterion. The effect of this is twofold:
    The pushbutton for F4 (Possible entries) appears beside the appropriate field.
    When the user selects this pushbutton or presses F4 for the field, the event is executed. You can thus implement a self-programmed possible entries routine for the input/output fields of the selection screen. If the program contains such an event and the user presses F4 , the system processes this rather than displaying the check table or the fixed values of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field. You can, for example, use the CALL SCREEN statement to display a selection list of possible values. The contents of the field psel_low_high at the end of this processing block are copied to the appropriate input/output field.
    This addition is only allowed with report-specific parameters (PARAMETERS ) or selection options (SELECT-OPTIONS ). For database-specific parameters or selection options, you can achieve the same effect by using the addition VALUE-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the value help in the database program SAPDBxyz .
    Addition 4
    ... ON HELP-REQUEST FOR psel_low_high
    Effect
    As with the addition ON VALUE-REQUEST the field psel_low_high is either the name of a report parameter or of the form sel-LOW or sel-HIGH , where sel is the name of a selection criterion. When the user presses F1 on the relevant field, the subsequent processing block is executed. You can thus implement a self-programmed help for the input/output fields of the selection screen. If the program contains such an event and the user presses F1 , the system processes this rather than displaying the documentation of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field.
    This addition is only allowed with report-specific parameters (PARAMETERS ) or selection options (SELECT-OPTIONS ). For database-specific parameters or selection options, you can achieve the same effect by using the addition HELP-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the help in the database program SAPDBxyz .
    Addition 5
    ... ON RADIOBUTTON GROUP radi
    <u><b>Effect</b></u>
    This event is assigned to the radio button groups on the selection screen defined by PARAMETERS par RADIOBUTTON GROUP radi .
    If the report starts an error dialog at this point, precisely these fields of the radio button group radi become ready for input again.
    <b>
    Addition 6</b>
    ... ON BLOCK block
    Effect
    <b><i>This event is assigned to the blocks on the selection screen defined by SELECTION-SCREEN BEGIN/END OF BLOCK block .
    If the report starts an error dialog at this point, precisely these fields of the block block become ready for input again.</i></b>
    <u><b>Note</b></u>
    In which sequence are the events AT SELECTION-SCREEN ON psel ... , AT SELECTION-SCREEN ON RADIOBUTTON GROUP ... , AT SELECTION-SCREEN ON BLOCK ... , AT SELECTION-SCREEN processed?
    <i>The AT SELECTION-SCREEN ON psel ... events assigned to the parameters or selection options are executed in the sequence they are declared in the program, i.e. in the sequence they appear on the selection screen.
    The events assigned to the radio button groups are executed according to the first parameter of the radio button group.
    The events assigned to the blocks are executed "from the inside to the outside".</i>
    <b>Example</b>
    SELECT-OPTIONS SEL0 FOR SY-TVAR0.
    SELECTION-SCREEN BEGIN OF BLOCK BL0.
    SELECT-OPTIONS SEL1 FOR SY-TVAR1.
    SELECTION-SCREEN BEGIN OF BLOCK BL1.
    PARAMETERS P0 RADIOBUTTON GROUP RADI.
    PARAMETERS P1 RADIOBUTTON GROUP RADI.
    SELECTION-SCREEN BEGIN OF BLOCK BL2.
    PARAMETERS P3.
    SELECTION-SCREEN END   OF BLOCK BL2.
    SELECT-OPTIONS SEL2 FOR SY-TVAR2.
    SELECTION-SCREEN END   OF BLOCK BL1.
    SELECTION-SCREEN END   OF BLOCK BL0.
    <b>Sequence:</b>
    AT SELECTION-SCREEN ON...
    SEL0
    SEL1
    RADIOBUTTON GROUP RADI
    P3
    BLOCK BL2
    SEL2
    BLOCK BL1
    BLOCK BL0
    AT SELECTION-SCREEN is executed at the very end.
    <b>Addition 7</b>
    ... OUTPUT
    <u>Effect</u>
    <b>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.</b>
    <u><b>Example</b></u>
    <b>Output all fields of the
    SELECT-OPTION NAME
    highlighted:</b>
    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.
    <i><b>The addition MODIF ID XYZ to the key word SELECT-OPTIONS assigns all fields of the selection option NAME to a group you can read in the field SCREEN-GROUP1 . At PBO of the selection screen, all these fields are then set to highlighted.
    </b></i>
    check these links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/10/e7dbde82ba11d295a40000e8353423/content.htm
    Reward all helpfull answers
    Regards
    Pavan

  • Need help to disable input selection-screen - very urgent

    Hi SAP experts,
    I have a requirement where in I need to disable ( Grey out ) the input fileds on the selection screen .
    My problem is as I am using ABAP query I am not able to use any events ( AT SELECTION-SCREEN OUTPUT ).
    My selection screen looks like this
    MATERIAL NUMBER ( SELECT-OPTIONS)
    MATERIAL TYPE ( PARAMETERS )
    Now I want to add one more check box below the above fields on the selection-screen.When I click on the check-box,the MATERIAL NUMBER  must be greyed out and MATERIAL TYPE should remain the same.
    Please let me know the coding for the same. All answers would be rewarded.
    Thanks in Advance,
    Suresh.

    Hi,
    Check out these codes.
    1.
    TABLES : mara, makt.
    parameter: p_matnr type mara-matnr,
               p_maktx type makt-maktx.
    at selection-screen output.
    select single maktx
    from makt
    into p_maktx
    where matnr = p_matnr
    and spras = 'EN'.
    loop at screen.
      if screen-name = 'P_MAKTX'.
        screen-input = 0.
        modify screen.
      endif.
    endloop.
    2.
    TABLES : mara, makt.
    TYPES:BEGIN OF tp_maktx,
          maktx TYPE makt-maktx,
          END OF tp_maktx.
    DATA:t_maktx TYPE STANDARD TABLE OF tp_maktx,
         wa_maktx TYPE tp_maktx.
    SELECT-OPTIONS: s_matnr FOR mara-matnr.
    SELECT-OPTIONS: s_maktx FOR makt-maktx.
    INITIALIZATION.
      REFRESH s_maktx[].
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'S_MAKTX-LOW' or screen-name = 'S_MAKTX-HIGH'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
      REFRESH s_maktx[].
      if s_matnr[] is not initial.
      SELECT maktx FROM makt
      INTO TABLE t_maktx
      WHERE matnr IN s_matnr
      AND spras = 'EN'.
      endif.
      LOOP AT t_maktx INTO wa_maktx.
        s_maktx-low = wa_maktx-maktx.
        APPEND s_maktx.
        CLEAR:wa_maktx.
      ENDLOOP.
    3.
    TABLES : mara, makt.
    parameter p_cb1 type c as checkbox.
    parameter p_cb2 type c as checkbox.
    parameter p_cb3 type c as checkbox.
    initialization.
    loop at screen.
    if screen-name = 'P_CB3'.
    screen-invisible = 1.
    modify screen.
    endif.
    endloop.
    at selection-screen output.
    *loop at screen.
    *if screen-name = 'P_CB3'.
    *screen-invisible = 1.
    *modify screen.
    *endif.
    *endloop.
    loop at screen.
    if p_cb1 = 'X'.
      if screen-name = 'P_CB2'.
      screen-invisible = 1.
      modify screen.
      endif.
      if screen-name = 'P_CB3'.
      screen-invisible = 0.
      modify screen.
      endif.
    endif.
    if p_cb2 = 'X'.
      if screen-name = 'P_CB3'.
      screen-invisible = 1.
      modify screen.
      endif.
      if screen-name = 'P_CB1'.
      screen-invisible = 0.
      modify screen.
      endif.
    endif.
    if p_cb3 = 'X'.
      if screen-name = 'P_CB1'.
      screen-invisible = 1.
      modify screen.
      endif.
      if screen-name = 'P_CB2'.
      screen-invisible = 0.
      modify screen.
      endif.
    endif.
    endloop.
    Reward if helpful..
    Regards.

  • Custom error messages in selection-screen

    Hello All,
    I have one query. I have developed a vendor aging report. In the SELECT-OPTIONS, there are 5 fields namely company code, business area, vendor group, vendor code and cash management group. What the user wants is if he enters any invalid value in any of the 5 fields, custom error message should be displayed like 'invalid company code' etc. I think we have to write these messages in 'at-selection-screen' event. Can u help me out with a sample code snippet w.r.t the above program? I have written the code as:
    AT SELECTION-SCREEN.
      IF S_BUKRS ne BSIK-BUKRS.
      MESSAGE e000. 'invalid company code' TYPE 'E'.
      ENDIF.
    But not giving the correct output.i.e. even if I enter a valid company code, the error message is displayed. Can u help me in solving this problem?
    Thanks and Regards,
    Satvik
    Edited by: Satvikpanchal on Jul 22, 2011 9:42 AM

    Hi,
      use AT SELECTION-SCREEN on S_BUKRS-low.
    Use select query for checking the Company code in T001 table check the
    Company code already exist or not? If it is not there show the message.
    Code like
    AT SELECTION-SCREEN on S_BUKRS-low.
    select single bukrs into lv_bukrs
          from T001 where bukrs = s_bukrs-low.
    if sy-subrc NE 0.
    MESSAGE e000. 'invalid company code' TYPE 'E'.
    ENDIF.
    i think you company code is select option so you have to check S_BUKRS-high also.
    using the event AT SELECTION-SCREEN on S_BUKRS-high.
    Regards,
    DHina..

  • Selection screen field

    Hi,
    A field in the selection screen of the report program should be disabled by default.
    I have written the logic for the same in at selection-screen output.
    If the user enters value in another field in selection screen,the field should be enabled for input.
    When the user executes the program,o/p is displayed.
    When the user clicks back button in the o/p screen,the field is again shown in disabled mode as the event at selection screen o/p is being triggered.
    The field should be enabled when the user cliks back button in the o/p.
    How to achieve this? => by writing the code. And we cannot do that for you.
    Moderator Message:
    Also,
    Total Questions:  141 (102 unresolved)
    suggests that you do not get back to the people who spend time on your issues. Be a responsible forum member by acknowledging people's time and effort.
    Edited by: kishan P on Nov 11, 2010 4:16 PM

    Hi,
    If i understood correctly you requirement you just have to make use of a global variable i.e. gv_enabled, which will be used as flag. Before disable the field in at selection-screen output event, check if gv_enabled is initial. When you enable the field for input, for the first time just move 'X' to gv_enabled.
    Best Regards
    George Zervas

Maybe you are looking for

  • Error during deploying SOA Composite

    I have created a SOA Composite in which I am trying to access an External Web Service. The compilation goes fine but its failing at the time of deployment to Soa Server. My BPEL consists of following activities-> RecieveInput-> Assign -> Invoke -> As

  • Can't re-install Bluetooth on Windows vista 64 bit - Satellite A305

    I am having a problem with my bluetooth on my new Toshiba A305-S6843 machine. It is running Vista 64-bit version. Previously, the machine had version 6.10.02T Build 20080128 on it, but the bluetooth radio would not enable. The device was recognized i

  • DBMS_PROFILER - only anonymous

    I am trying to get over with DBMS_PROFILER, but I face a problem, that I can't get through. I followed the tutorial on this page: http://www.oracleflash.com/44/Write-fast-and-efficient-PLSQL---DBMS_PROFILER.html and everything was fine till I did not

  • Ibase Component Tab is Empty while creating POD from CRM

    After doing certain actions in CRM where the ISU tab is displayed for a BP, after performing the action (for example, creating a POD) the ISU tab does not disappear (as it used to). Instead, a blank screen displays that requires the user to close the

  • FM 9: Cannot apply conditional tags

    I've been able to create conditional text tags, apply them, and see the conditional indicators fine in several documents using FM 9. Recently, in a new book, I'm unable to apply conditional tags. I believe I've figured out the new UI, since condition