Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Changing fields with radiobuttons

Former Member
0 Likes
423

Hi all!

I have a group of radiobuttons in a selection screen and when a radiobutton is chosen I want some output fields on the selection screen to be changed right away. Does anyone know how to solve this?

Thanks

Magnus

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
397

in the AT SELECTION-SCREEN event, you can write the code to disable the fields depending on the radio button selection,

AT selection-screen output.

if rdb1 = 'X'.

loop at screen.

if screen-name = 'xyz'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

4 REPLIES 4
Read only

Former Member
0 Likes
398

in the AT SELECTION-SCREEN event, you can write the code to disable the fields depending on the radio button selection,

AT selection-screen output.

if rdb1 = 'X'.

loop at screen.

if screen-name = 'xyz'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
397

Please see the following example.



report zrich_0001.


parameters: p_rad1 radiobutton group grp1 default 'X'
<b>                         user-command check.</b>
parameters: p_rad2 radiobutton group grp1 .

parameters: p_fld1(10) type c.
parameters: p_fld2(10) type c.

at selection-screen output.


loop at screen.

<b>if p_rad1 = 'X'
  and screen-name = 'P_FLD2'.
 screen-input = '0'.
endif.

if p_rad2 = 'X'
  and screen-name = 'P_FLD1'.
 screen-input = '0'.
endif.</b>

modify screen.
endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
397

Hi ,

Try this code.


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-100.
PARAMETERS: rad_locl RADIOBUTTON GROUP main
                                            MODIF ID aa USER-COMMAND abc
                                                            DEFAULT 'X',
            rad_appl RADIOBUTTON GROUP main MODIF ID aa .

SELECTION-SCREEN END OF BLOCK b1 .

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-101.
PARAMETERS: p_lcl TYPE rlgrap-filename MODIF ID bb.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-101.
PARAMETERS: p_appl(150) MODIF ID cc.
SELECTION-SCREEN END OF BLOCK b3.
*
AT SELECTION-SCREEN ON P_LCL.
MESSAGE I032(ZI) WITH 'TEST'.
*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_lcl.
  CALL FUNCTION 'F4_FILENAME'
       EXPORTING
            program_name  = syst-cprog
            dynpro_number = syst-dynnr
            field_name    = ''
       IMPORTING
            file_name     = p_lcl.

AT SELECTION-SCREEN OUTPUT .
*Selection by local file
  IF rad_locl = 'X'.
    PERFORM deactivate USING 'CC'.
  ELSE.
    PERFORM deactivate USING 'BB'.
  ENDIF  .

*&---------------------------------------------------------------------*
*&      Form  deactivate
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_0041   text
*----------------------------------------------------------------------*
FORM deactivate USING    value(p_grp).

  LOOP AT SCREEN.
    screen-active = '1'.
    IF screen-group1 = p_grp.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Regards,

Raghav

Read only

Former Member
0 Likes
397

Refer this link;

Regards,

ravi