Skip to Content
avatar image
Former Member

Enabling/disabling a parameter based on radiobutton

Hello experts,

I have a selection screen that has 3 radiobuttons named 'Display', 'Add' and 'Edit'.

Below the edit radiobutton I have a parameter named Ship-to code and here is what I want to do:

the parameter 'Ship-to code' must not be enabled if the user clicks on either the 'Display' or

'Add' radiobutton. It will only be enabled if user clicks on the 'Edit' radiobutton.

Again, thank you guys and have a nice day!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    May 25, 2006 at 08:11 AM

    JUST COPY AND PASTE.....

    Parameters: rd1 RADIOBUTTON group g1 default 'X' user-command ch ,

    rd2 RADIOBUTTON group g1 ,

    rd3 RADIOBUTTON group g1 ,

    kishan1(10) type c modif id ID1.

    AT SELECTION-SCREEN.

    check sy-ucomm = 'CH'.

    AT SELECTION-SCREEN output.

    IF rd1 = 'X' or rd2 = 'X'.

    LOOP AT SCREEN.

    IF screen-group1 = 'ID1' .

    screen-input = '0'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ENDIF.

    IF RD3 = 'X'.

    LOOP AT SCREEN.

    IF screen-group1 = 'ID1' .

    screen-input = '1'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ENDIF.

    <b> 2) CHECK THAT ONE IF U WANT TO PARAMETER DISPLAY ONLY CLICK OF EDIT....</b>

    Parameters: rd1 RADIOBUTTON group g1 default 'X' user-command ch ,

    rd2 RADIOBUTTON group g1 ,

    rd3 RADIOBUTTON group g1 ,

    kishan1(10) type c modif id ID1.

    AT SELECTION-SCREEN.

    check sy-ucomm = 'CH'.

    AT SELECTION-SCREEN output.

    IF rd1 = 'X' or rd2 = 'X'.

    LOOP AT SCREEN.

    IF screen-group1 = 'ID1' .

    screen-active = '1'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ENDIF.

    IF RD3 = 'X'.

    LOOP AT SCREEN.

    IF screen-group1 = 'ID1' .

    screen-active = '0'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 25, 2006 at 08:16 AM

    There you go ...

    REPORT zzsorttry .

    DATA : t_marc TYPE STANDARD TABLE OF marc WITH HEADER LINE.

    PARAMETERS: p_rad1 RADIOBUTTON GROUP rad1 user-command RAD

    DEFAULT 'X',

    p_rad2 RADIOBUTTON GROUP rad1 ,

    p_rad3 RADIOBUTTON GROUP rad1 .

    PARAMETERS : p_date TYPE sy-datum.

    AT SELECTION-SCREEN OUTPUT.

    IF p_rad2 EQ 'X' OR p_rad3 EQ 'X'.

    LOOP AT SCREEN.

    IF screen-name EQ 'P_DATE'.

    screen-input = '0'.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 25, 2006 at 08:21 AM
    chk this , this works good
    
    *&---------------------------------------------------------------------*
    *& Report  YCHATEST                                                    *
    *&                                                                     *
    *&---------------------------------------------------------------------*
    *&                                                                     *
    *&                                                                     *
    *&---------------------------------------------------------------------*
    
    REPORT  ychatest                                .
    DATA : flag(1).
    
    PARAMETERS : display  RADIOBUTTON GROUP  r1 user-command r,
                 add  RADIOBUTTON GROUP r1,
                 edit  RADIOBUTTON GROUP r1,
                 p_ship MODIF ID sh.
    
    AT SELECTION-SCREEN.
      IF sy-ucomm = 'R'.
        IF display = 'X' OR
            add = 'X'.
          flag = '0'.
        ELSEIF edit = 'X'.
          flag = '1'.
        ENDIF.
      ENDIF.
    
    AT SELECTION-SCREEN OUTPUT.
    
    
      LOOP AT SCREEN.
        IF screen-group1 = 'SH'.
          screen-input = flag.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 25, 2006 at 08:08 AM

    Hi,

    REPORT DEMO_AT_SELECTION_ON_RADIO .

    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

    PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',

    R2 RADIOBUTTON GROUP RAD1,

    R3 RADIOBUTTON GROUP RAD1.

    SELECTION-SCREEN END OF BLOCK B1.

    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

    PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',

    R5 RADIOBUTTON GROUP RAD2,

    R6 RADIOBUTTON GROUP RAD2.

    SELECTION-SCREEN END OF BLOCK B2.

    parameters : P_para1 type xxx modif id 'G1'.

    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.

    loop at screen.

    if scree-group = 'G1'.

    screen-active = 0.

    endif.

    endloop.

    Regards,

    Ravi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 26, 2006 at 08:45 AM

    Hi Vijay ,

    Why have u assigned my points from 10 to 2 , r u not satisfied with my answer

    Add comment
    10|10000 characters needed characters exceeded