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.

Similar Messages

  • Radio Buttons on Selection Screen

    Hi,
    I have four radio buttons on selection screen in a frame, all belonging to the same group.
    When the program is called using transaction 1, first two radio buttons are displayed. When the program is called using transaction 2, bottom two radio must be displayed.
    I am doing this using the following code.
    The problem is : When last two are displayed, there is empty space left on the top and first two are displayed there is empty space left in the bottom of the frame. How can this be taken care of such there are no empty spaces in the box frame?
    Code:
    Radio Buttons for Table Name
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-005.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_ot   RADIOBUTTON GROUP grp1 MODIF ID one.
    SELECTION-SCREEN COMMENT 5(31) text-001 FOR FIELD p_ot.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_exp   RADIOBUTTON GROUP grp1 MODIF ID one.
    SELECTION-SCREEN COMMENT 5(31) text-002 FOR FIELD p_exp.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_cost   RADIOBUTTON GROUP grp1 MODIF ID two.
    SELECTION-SCREEN COMMENT 5(31) text-003 FOR FIELD p_cost.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_att   RADIOBUTTON GROUP grp1 MODIF ID two.
    SELECTION-SCREEN COMMENT 5(31) text-004 FOR FIELD p_att.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN END OF BLOCK bl1.
    Initialization
    INITIALIZATION.
    Display Table Names depending on transaction calling the program
      PERFORM display_table_names.
    FORM display_table_names.
      DATA : l_mod_id(3) TYPE c.
      IF sy-tcode EQ 'ZVTEST1'.
        l_mod_id = 'ONE'.
      ELSEIF sy-tcode EQ 'ZVTEST2'.
        l_mod_id = 'TWO'.
      ENDIF.
      LOOP AT SCREEN.
        IF screen-group1 EQ l_mod_id.
          screen-invisible   = '1'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " display_table_names

    Hi,
    REPORT  Z_SALES MESSAGE-ID ZZ                          .
    *                             Variables                                *
    DATA: IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
          IT_MSGS LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA: V_FILE TYPE STRING.
    *                         Internal Tables                              *
    DATA: BEGIN OF IT_SALES OCCURS 0,
            AUART,
            VKORG,
            VTWEG,
            BSTKD,
            KUNNR_KUNAG,
            KUNNR_KUNWE,
            KETDAT,
            KPRGBZ,
            PRSDT,
            BSTKD_1,
            KUNNR_KUNAG1,
            KUNNR_KUNWE1,
            KETDAT_1,
            KPRGBZ_1,
            PRSDT_1,
            ZTERM_1,
            INCO1,
            INCO2,
            MABNR,
            KWMENG,
            BSTKD_2,
            KUNNR_KUNAG2,
            KUNNR_KUNWE2,
            KETDAT_2,
            KPRGBZ_2,
            PRSDT_2,
            ZTERM_2,
            INCO1_1,
            INCO2_2,
            KSCHL,
            KBETR,
          END OF IT_SALES.
    *                       Selection-Screen                               *
    *Selection Screen 1
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_FILE(25) TYPE C,
                 O_FILE(25) TYPE C.
    SELECTION-SCREEN END OF BLOCK B1.
    *Selection Screen 2
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
                SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK B2.
    *Selection Screen 3
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
    PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
                UPDATE DEFAULT 'X' MODIF ID BL1.
    SELECTION-SCREEN END OF BLOCK B3.
    *Selection Screen 4
    SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
    PARAMETERS: SES_NAM(25) MODIF ID BL2,
                KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
                LOC_DATE TYPE SY-DATUM MODIF ID BL2,
                USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
    SELECTION-SCREEN END OF BLOCK B4.
    *                     At  Selection-Screen Output                      *
    AT SELECTION-SCREEN OUTPUT.
      IF CAL_TRA = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'BL1'.
            SCREEN-ACTIVE = '1'.
          ENDIF.
          IF SCREEN-GROUP1 = 'BL2'.
            SCREEN-ACTIVE = '0'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF SESSION = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'BL1'.
            SCREEN-ACTIVE = '0'.
          ENDIF.
          IF SCREEN-GROUP1 = 'BL2'.
            SCREEN-ACTIVE = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    *                     At  Selection-Screen                             *
    AT SELECTION-SCREEN.
      PERFORM VALIDATE_MANDATORY_FIELDS.
    *****************            INITIALIZATION         ********************
    INITIALIZATION.
      LOC_DATE  = SY-DATUM - 1.
    *                       Start of Selection                             *
    START-OF-SELECTION.
      V_FILE = P_FILE.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                = V_FILE
          FILETYPE                = 'ASC'
          HAS_FIELD_SEPARATOR     = ' '
        TABLES
          DATA_TAB                = IT_SALES
        EXCEPTIONS
          FILE_OPEN_ERROR         = 1
          FILE_READ_ERROR         = 2
          NO_BATCH                = 3
          GUI_REFUSE_FILETRANSFER = 4
          INVALID_TYPE            = 5
          NO_AUTHORITY            = 6
          UNKNOWN_ERROR           = 7
          BAD_DATA_FORMAT         = 8
          HEADER_NOT_ALLOWED      = 9
          SEPARATOR_NOT_ALLOWED   = 10
          HEADER_TOO_LONG         = 11
          UNKNOWN_DP_ERROR        = 12
          ACCESS_DENIED           = 13
          DP_OUT_OF_MEMORY        = 14
          DISK_FULL               = 15
          DP_TIMEOUT              = 16
          OTHERS                  = 17.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *&      Form  VALIDATE_MANDATORY_FIELDS
    *       text
    FORM VALIDATE_MANDATORY_FIELDS.
      IF P_FILE IS INITIAL OR O_FILE IS INITIAL.
        MESSAGE E000 WITH 'ENTER BOTH THE FILE NAMES'.
      ENDIF.
      IF CAL_TRA = 'X'.
        IF MODE IS INITIAL OR UPDATE IS INITIAL.
          MESSAGE E000 WITH 'ENTER BOTH THE OPTIONS'.
        ENDIF.
        IF SY-SUBRC <> 0.
          IF MODE <> 'A' OR MODE <> 'E' OR MODE <> 'N'
          OR MODE <> 'a' OR MODE <> 'e' OR MODE <> 'n'.
            MESSAGE E000 WITH 'Mode should be either A, E or N'.
          ENDIF.
          IF UPDATE <> 'S' OR UPDATE <> 'A'
          OR UPDATE <> 's' OR UPDATE <> 'a'.
            MESSAGE E000 WITH 'Mode should be either S or A'.
          ENDIF.
        ENDIF.
      ENDIF.
      IF SESSION = 'x'.
        IF SES_NAM   IS INITIAL
        OR KEP_TRAS  IS INITIAL
        OR LOC_DATE  IS INITIAL
        OR USER      IS INITIAL.
          MESSAGE E000 WITH 'ENTER ALL THE FIELDS'.
        ENDIF.
      ENDIF.
    ENDFORM.                    "VALIDATE_MANDATORY_FIELDS
    Regards
    vijay

  • Radio button in selection screen and push button

    Hi experts,
    I want to give radio button in selection screen side by side.
    how we can do this on slection screen.
    secondly i want to resize push button on selection screen.
    please provide me the exact solution.
    thanks
    babbal

    Hi babbal,
    For Your Requriment yo can go to tcode se51 & then give ur program name & give screen number as 1000 because 1000 is default screen for all the programs and in se51 Press Layout button & then you can make changes to the Selection screen according to your requriment
    Hope it will be Helpfull.......!!
    Thanks & Regards,
    Bhushan

  • Problem with Radio Buttons: At Selection-Screen

    Hi,
    i have two radio-buttons in my screen with coding
    PARAMETERS:
                      ST RADIOBUTTON GROUP rad1 DEFAULT 'X',         "stock transport
                      PR RADIOBUTTON GROUP rad1.                     "purchase return
    at selection-screen output.
    if PR = 'X'.
    perform f_selection_request_po_ret.
    endif.
    if ST = 'X'.
    perform f_selection_request_stck_trans.
    endif.
    at selection-screen on value-request for s_ebeln-low.
    perform f_f4_values.
    at selection-screen on value-request for s_ebeln-high.
    perform f_f4_values.
    I need to provide different values in drop-down of select-options according to the radio-button selected.
    Like if PR is selected s_ebeln-low and s_ebeln-high displayed will be different.
    and if ST is selected s_ebeln-low and s_ebeln-high displayed will be different.
    My problem is that the program is taking the values of that radio button which is set to Default. While running the program, if I click on the other radio-button, it is showing the same values, not different.
    Kindly, tell me where I am going wrong in the coding.
    Regards,
    Priyanka.

    Hi,
    For this requirement you have to use the following FM's
    <b>DYNP_VALUES_READ </b>  and DYNP_VALUES_UPDATE
    The one highlighted is the one you need to call in the selection screen events to get the values. Do a where used list on this FM and see how its being used.
      DATA : W_REPID    LIKE D020S-PROG,
             W_DYNNR    LIKE D020S-DNUM,
             I_DYNPREAD LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.
      REFRESH: I_DYNPREAD.
      CLEAR  : I_DYNPREAD,
               W_FILE    .
      I_DYNPREAD-FIELDNAME = C_UXPATH.
      APPEND   I_DYNPREAD.
      CLEAR  : I_DYNPREAD.
      W_REPID = SY-REPID.
      W_DYNNR = C_1000.
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                DYNAME               = W_REPID
                DYNUMB               = W_DYNNR
           TABLES
                DYNPFIELDS           = I_DYNPREAD
           EXCEPTIONS
                INVALID_ABAPWORKAREA = 1
                INVALID_DYNPROFIELD  = 2
                INVALID_DYNPRONAME   = 3
                INVALID_DYNPRONUMMER = 4
                INVALID_REQUEST      = 5
                NO_FIELDDESCRIPTION  = 6
                INVALID_PARAMETER    = 7
                UNDEFIND_ERROR       = 8
                DOUBLE_CONVERSION    = 9
                OTHERS               = 10.
      IF SY-SUBRC EQ 0.
    Successfully read screen. GET the values
        LOOP AT I_DYNPREAD.
          CASE I_DYNPREAD-FIELDNAME.
            WHEN C_UXPATH .
              W_FILE   = I_DYNPREAD-FIELDVALUE.
          ENDCASE.
        ENDLOOP.                "LOOP AT i_dynpread.
      ENDIF.                    "IF sy-subrc EQ 0.
    Cheers
    VJ
    Message was edited by:
            Vijayendra  Rao

  • Regarding radio button and selection screen

    hi
    i have a requirement to grey out one particular select option , if any one of 4 radio button is selected. (total 5 radio buttons ) . 
    how do i proceed .
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE  text-001.
    SELECT-OPTIONS: p_year  for  s021-spmon obligatory,
                    p_kunag  FOR vbrk-kunag  ,
                    p_matnr  FOR vbrp-matnr  ,
                    p_augru  FOR vbrp-augru_auft  ,
                    p_vbeln  FOR vbrk-vbeln  .
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE  text-002.
    PARAMETERS: nrw RADIOBUTTON GROUP g1 default 'X'user-command check,
                mwd RADIOBUTTON GROUP g1user-command check,
                rws RADIOBUTTON GROUP g1user-command check,
                edu RADIOBUTTON GROUP g1user command check
                standard RADIOBUTTON GROUP g1 .
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    i know we need to use at-selection screen output.
    but how do i set ONLY that particular select option , to no input.

    Hi ,
    Use like This
    User Dynamic Selection
    at selection-screen output.
      select single * from t000md.
      loop at screen.
        case screen-group1.
          when 'REL'.
            if not  p_old is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'BEL'.
            if not p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'ARB'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'MTA'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
        endcase.
      endloop.
    Reward Points if it is useful
    Thanks
    Seshu

  • How to handle Event when a radio button in selection screen is clicked

    Hi all,
       What is the Event generated when a radio button is clicked in the selection Screen. My requirement is .If one radio button is clicked a field in selection screen should be greyed.
       Here I used AT SELECTION-SCREEN OUTPUT. but this event is generated only if i press 'ENTER' after clicking the radio button in the selection screen.
       Is there any other way to process this radio button event?
    Thanks&Best Regards,
    Vishnu

    hi,
    try like this
    TABLES : kna1,lfa1.
    SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-002.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : rad_but1 RADIOBUTTON GROUP one DEFAULT 'X' USER-COMMAND ucom.
    SELECTION-SCREEN COMMENT 3(26) text-003.
    SELECT-OPTIONS : kunnr FOR kna1-kunnr.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : rad_but2 RADIOBUTTON GROUP one .
    SELECTION-SCREEN COMMENT 3(26) text-004.
    SELECT-OPTIONS : lifnr FOR lfa1-lifnr.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN:END OF BLOCK blk1.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF rad_but1 = 'X'.
          IF screen-name = 'KUNNR-LOW' OR screen-name = 'KUNNR-HIGH' .
            screen-input = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-name = 'LIFNR-LOW' OR screen-name = 'LIFNR-HIGH'.
            screen-input = '0'.
            REFRESH lifnr.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
        IF rad_but2 = 'X'.
          IF screen-name = 'KUNNR-LOW' OR screen-name = 'KUNNR-HIGH'.
            REFRESH kunnr.
            screen-input = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-name = 'LIFNR-LOW' OR screen-name = 'LIFNR-HIGH'.
            screen-input = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    reward if usefull....

  • Radio button in selection screen

    hi,
    i have an ALV Report, in the selection screen  there are 2 radio buttons.
    RB1 default 'X'.
    and
    RB2
    and there are 5 select-options.
    the issue is , the radio button  RB1 IS default when RB1 is there one of the select option should be disabled.
    and when we click on RB2 the select option should be enabled.
    the selec option is
    select - option : s_bukrs for bseg-bukrs.
    please help with the code.
    thanks in advance

    Hi,
    Try this code,
    TABLES : KNA1,EKKO.
    PARAMETERS : C1     RADIOBUTTON GROUP VIJJ USER-COMMAND VJY ,
                 C2       RADIOBUTTON GROUP VIJJ .
    SELECT-OPTIONS : S_CUSTNO FOR KNA1-KUNNR MODIF ID AKP DEFAULT 1000 TO 1033.
    INITIALIZATION.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF C1 = 'X'.
          IF SCREEN-GROUP1 = 'VKP'.
            SCREEN-INPUT   = 0.
            SCREEN-ACTIVE  = 0.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'PKP'.
            SCREEN-INPUT   = 0.
            SCREEN-ACTIVE  = 0.
            MODIFY SCREEN.
          ENDIF.
        ELSEIF C2 = 'X'.
          IF SCREEN-GROUP1 = 'PKP'.
            SCREEN-INPUT   = 0.
            SCREEN-ACTIVE  = 0.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'AKP'.
            SCREEN-INPUT   = 0.
            SCREEN-ACTIVE  = 0.
            MODIFY SCREEN.
          ENDIF.
    ENDIF.
    ENDLOOP.
    Regards,
    Vijay

  • Radio button and selection screen

    hi
    my requirement is that if the user enters some particular combination of value in the select options and clicks a particular radio button there should be an error message displayed.
    1)  I am getting the error message in the form a dialog box , but it has only option of  exit , and the user is thrown of the screen. my requirement is that after the error message the user must still be at the same screen so that he can enter new values.
    2)  the code that i have written also has one more anamoly that the displaying of error depends upon the sequence of  actions .
      if  i enter the value in the select option first and then click the radio button then the error message is displayed which is correct.
    but it doesnt work i click the radio button first and then enter the value, the program is executed and NO ERROR message is flashed.
    here is what i have written
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE  text-001.
    SELECT-OPTIONS: p_year  for  s021-spmon obligatory ,
                    p_kunag  FOR vbrk-kunag  ,
                    p_matnr  FOR vbrp-matnr  ,
                    p_augru  FOR vbrp-augru_auft modif id a1 ,
                    p_vbeln  FOR vbrk-vbeln  .
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE  text-002.
    PARAMETERS:  nrw RADIOBUTTON GROUP g1 user-command check,
                 mwd RADIOBUTTON GROUP g1 ,
                 rws RADIOBUTTON GROUP g1 ,
              edu RADIOBUTTON GROUP g1 ,
             standard RADIOBUTTON GROUP g1 default 'X' .
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    at selection-screen output.
       loop at screen.
       if nrw = 'X' and p_augru-low EQ 'MWD'.
           MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.
    endif.
       endloop.
    START-OF-SELECTION.
    CASE 'X'.
    WHEN nrw.
    PERFORM set_dates_nrw.
          PERFORM load_data_nrw.
          PERFORM get_cust_info_nrw.
          PERFORM set_alv_field_cat_nrw.
          PERFORM display_alv_nrw.
    endcase.

    Hi
    Change this piece of code
    at selection-screen output.
    loop at screen.
    if nrw = 'X' and p_augru-low EQ 'MWD'.
    MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.
    endif.
    endloop.
    by
    <b>at selection-screen.
    if nrw = 'X' and p_augru-low EQ 'MWD'.
    MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.
    endif.</b>
    Reward points if useful.
    Regards,
    Atish

  • Regarding Radio button in selection screen?

    Hi experts,
    In my selection screen I am having two radio buttons.
    By default I am selecting the first radiobutton and displaying a selection block correspoding to that below.
    If I am selecting second radio button I want to display another selection block regarding to that second radio button.
    At that time first selection block should be hidden or should be disabled.
    Please help me out with sample codings.
    Thanks,
    Sakthi.

    Hi ,
    Try like this..
    TABLES : mara.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE select.
    PARAMETERS : p1 RADIOBUTTON GROUP rado USER-COMMAND hi DEFAULT 'X',
                 p2 RADIOBUTTON GROUP rado.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 .
    SELECT-OPTIONS : s_hello FOR mara-matnr MODIF ID m1,
                     s_hi FOR mara-mtart NO-EXTENSION NO INTERVALS MODIF ID m2.
    SELECTION-SCREEN END OF BLOCK b2 .
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        CASE screen-group1.
          WHEN 'M1'.
            IF p1 = 'X'.
              screen-active = 1.
            ELSE.
              screen-active = 0.
            ENDIF.
          WHEN 'M2'.
            IF p2 = 'X'.
              screen-active = 1.
            ELSE.
              screen-active = 0.
            ENDIF.
        ENDCASE.
        MODIFY SCREEN.
      ENDLOOP.
    AT SELECTION-SCREEN ON s_hi.
      CHECK sy-ucomm NE 'HI'.
    START-OF-SELECTION.
      IF p1 = 'X'.
        WRITE 'hi'.
      ENDIF.
    cheers,
    Sai

  • HR-ABAP: Defaulting Radio Button on Selection Screen of PNP LDB

    Hi all,
    I am using PNP LDB (Logical Database) for program which is used for Payroll Results.
    Now I have a requirement wherein it is necessary to select 'Up to today' as default on the selection screen.
    We are having 4.7C version of SAP. I tried following code in INITIALIZATION event:
    Initializing Selection Screen Data Selection Option to 'Up To Today'
    INITIALIZATION:
      MOVE:  'X'    TO    pnptimr4, " This is the option which I want as Default selection.
             space  TO    pnptimr1,
             space  TO    pnptimr2,
             space  TO    pnptimr3,
             space  TO    pnptimr5,
             space  TO    pnptimr6.
    But still I dont see this Radiobutton getting selected as Default selection while running the program.
    By Default it selects Option : 'Other Period' (pnptimr6).
    Any Idea how to resolve this ??
    Regards,
    Avinash

    hi...
    When the INITIALIZATION event occurs, you can set default values for the selection screen.
    The fields for the data selection are defined in structure QPPNP.
    Possible values for field PNPTIMED are:
    D     =      Today (key date)
    M     =     Current month
    Y     =     Current year
    P     =     To current date
    F     =     From today (from current date)
    The person selection fields are defined in include program DBPNPSEL. They are internal tables that must be filled using APPEND.
    so in intialization you have to write code as
    PNPTIMED : P.
    so up date will be defaulted in selection screen.
    award points if helpful.

  • Restriction on length of the name given to a radio button in selection scr

    Hi,
    Is there any length restriction for the name given to a radio button in SELECTION SCREEN?
    I need to display a 35 char name for a radio button.

    It can be upto 8 characters long. But here is a solution to your problem:
    selection-screen begin of line.
    parameters: rb_opt1 radiobutton group mygrp.
    selection-screen comment 5(35) text-s01 for field rb_opt1.
    selection-screen end of line.
    selection-screen begin of line.
    parameters: rb_opt2 radiobutton group mygrp.
    selection-screen comment 5(35) text-s02 for field rb_opt2.
    selection-screen end of line.
    and then just double click on the text objects to write your own texts.
    Hope it helps.

  • Bypassing selection screen events

    hi all,
    i have some validation code for fields under "At selection screen"
    and code for disabling fields under "At selection screen output"
    now when i select the radio button "At selection screen" is triggered and error is shown before "At selection screen output"
    could get triggered , hence the selected radio button is selcted but the corresponding feild remains disabled as "At selection screen output" did not got triggered.
    can anyone help me out.

    If you need to validate fields only before extecution, You can code in this way.
    at selection-screen.
    if sy-ucomm EQ 'ONLI'.
    Validations...
    endif.
    at selection-screen output.
    Regards
    Sathar

  • Selection screen modification based on various buttons in selection screen

    Hi,
    I have 1 query related with Selection screen modification.
    In my Report Program,I have created GUI Status for my selection screen
    Now 2 buttons in application toolbar are coming on selection sceen.
    For this i used,'At selection screen output' event.
    And there are 2 blocks on selection screen.
    If user press button1 then block2 should not display.
    and if user press button2 then block1 should not display.
    but the problem is i m not getting reqd result and also while doing debugging its not showing me sy-ucomm value.
    Any pointers on this.
    Thanks,
    Mamta

    Hi Mamta,
       have it in a group then you can write code accordingly see sample example,
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS       : p_r1 RADIOBUTTON GROUP rad
                            USER-COMMAND clk DEFAULT 'X'.            " upload Radio Button
    SELECTION-SCREEN COMMENT 5(35) text-003.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN : BEGIN OF BLOCK 001 WITH FRAME TITLE text-001.
    PARAMETERS: p_upl       LIKE rlgrap-filename MODIF ID a           "Upload File
                             DEFAULT 'c:\temp\parbmat.xls',
                p_werks     like t001w-werks MODIF ID a,              "Plant
    PARAMETERS: p_rest      LIKE rlgrap-filename MODIF ID a           "Dwonload File Path
                             DEFAULT 'c:\temp\Success.xls'.
    SELECTION-SCREEN : END OF BLOCK 001.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_r2 RADIOBUTTON GROUP rad.
    SELECTION-SCREEN COMMENT 5(35) text-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN : BEGIN OF BLOCK 002 WITH FRAME TITLE text-002.
    PARAMETERS     : p_plant  LIKE marc-werks MODIF ID b.                "Plant
    PARAMETERS     : p_lgort  LIKE mard-lgort MODIF ID b.                "Storage Location
    PARAMETERS     : p_vkorg  LIKE mvke-vkorg MODIF ID b.                "Sales Organization
    PARAMETERS     : p_vtweg  LIKE mvke-vtweg MODIF ID b.                "Distribution Channel
    SELECT-OPTIONS : s_mat FOR  mara-matnr MODIF ID b.                  "Material No No
    SELECT-OPTIONS : s_dat FOR  mara-ersda MODIF ID b.                  "Date on Record Created
    PARAMETERS     : p_down LIKE rlgrap-filename MODIF ID b
                      DEFAULT 'c:\temp\Material Master.xls'.           "Download File Path
    SELECTION-SCREEN : END OF BLOCK 002.
    AT SELECTION-SCREEN OUTPUT.
    *Inactive Fields depending on the radio button
      LOOP AT SCREEN.
        IF p_r1 = 'X'.
          IF screen-group1 = 'B'.
            screen-active = 0.
          ENDIF.
        ELSEIF p_r2 = 'X'.
          IF screen-group1 = 'A'.
            screen-active = 0.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Edited by: suresh suresh on Jul 28, 2009 12:42 PM
    Edited by: suresh suresh on Jul 28, 2009 12:42 PM

  • 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

  • How to get rid of the loop in ALV output from At selection screen event?

    I have several push buttons on a selection screen.
    Clikc on a button, then it pops up an editable ALV report. (This gets triggered AT SELECTION SCREEN event.). REUSE_ALV_GRID_DISPLAY_LVC..
    On the ALV output, I enabled F4 for a couple of fields. Once I click on the F4 button, ONF4 method gets triggerd and a pop up appears with custom search helps.
    choose a line and it fills the cell.
    Upto this it works fine.
    Now I click on the BACK button at the ALV output, it takes me to the selection screen. I click on the button again, it show the editable ALV. Now when I click on the F4 button, the pop up comes up twice and the cell gets filled from the second pop - up.
    How to control this?
    Probably I am not refreshing something?
    (I am using REUSE_ALV_GRID_DISPLAY_LVC and tooks ome code for ONF4 event from BCALV_*DATATYPES (forgot the exact name) program.)
    Thanks,
    Ven

    Hi,
    FORM refresh_grid USING  pw_grid TYPE REF TO cl_gui_alv_grid.
    *Work area
      DATA : wal_stable TYPE lvc_s_stbl.
      CHECK NOT pw_grid IS INITIAL.
      wal_stable-col = c_check.
      wal_stable-row = c_check.
    *Method to refresh grid
      CALL METHOD  pw_grid->refresh_table_display
           EXPORTING
             is_stable      = wal_stable
             i_soft_refresh = c_check
           EXCEPTIONS
             finished       = 1
             OTHERS         = 2.
    ENDFORM.                    " refresh_grid
    Thanks,
    Sree.

Maybe you are looking for