Application Development 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: 

Changing the Selection Screen on the selection of a radio button

Former Member
0 Kudos

Hi experts,

I am stuck with a situation here.

I have a selection screen with 2 blocks.

The first block contains 5 radio buttons.

The second block contains 7 select options fields.

Now i want to show different select options when the user selects different radio buttons.

For example, when the user selects radio button 1, select options 1, 2, 3, 4, and 5 should be shown.

When the user selects radio button2, select options 3, 4, 5, 6, and 7 should be shown.

How do i go about implementing this????

I guess i need to do the coding in event "AT SELECTION-SCREEN OUTPUT".

Should i use MODIF ID????

Please help.

Points will be awarded.

Thanks and Regards

Gaurav Kumar Raghav

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Gaurav,

Look in the sample code.


TABLES : MARA,SSCRFIELDS.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS : RB1 RADIOBUTTON GROUP RB1 USER-COMMAND COM MODIF ID R11,
             RB2 RADIOBUTTON GROUP RB1 MODIF ID R12,
             RB3 RADIOBUTTON GROUP RB1 MODIF ID R13.
SELECTION-SCREEN : END OF BLOCK B1.

SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR MODIF ID R11,
                S_MTART FOR MARA-MTART MODIF ID R12,
                S_MBRSH FOR MARA-MBRSH MODIF ID R13.
SELECTION-SCREEN : END OF BLOCK B2.


AT SELECTION-SCREEN OUTPUT.
IF RB1 = 'X'.
LOOP AT SCREEN.
 IF SCREEN-GROUP1 = 'R11'.
   SCREEN-INTENSIFIED = '1'.
   SCREEN-ACTIVE      = 1.
   SCREEN-DISPLAY_3D  = '1'.
  MODIFY SCREEN.
 ENDIF.
 IF SCREEN-GROUP1 = 'R12'.
  SCREEN-INTENSIFIED = '0'.
  SCREEN-ACTIVE      = 0.
  SCREEN-DISPLAY_3D  = '0'.
  MODIFY SCREEN.
 ENDIF.

 IF SCREEN-GROUP1 = 'R13'.
  SCREEN-INTENSIFIED = '0'.
  SCREEN-ACTIVE      = 0.
  SCREEN-DISPLAY_3D  = '0'.
  MODIFY SCREEN.
 ENDIF.

ENDLOOP.
ENDIF.

5 REPLIES 5

JozsefSzikszai
Active Contributor
0 Kudos

>

> I guess i need to do the coding in event "AT SELECTION-SCREEN OUTPUT".

> Should i use MODIF ID????

yes is the answer to both of your questions!

USER COMMAND addition to the RADIOBUTTONS

MODIF ID additions to the SELECT-OPTIONS (I think different number for each select option)

in the AT SELECTION_SCREEN OUTPUT you check which RADIOBUTTON is active and turn on/off (by setting screen-active) the select options accordingly

Former Member
0 Kudos

Use AT SELECTION-SCREEN

not AT SELECTION-SCREEN OUTPUT.

cause output addition makes it a PBO not PAI

check ur requirement & use the events accordingly

group all select options under one group which you want to show on selection of radio button

under AT SELECTION-SCREEN

loop at screen and change the property "ACTIVE (0/1)" for the group you want

& don't forget to modify screen table in the end.

one more thing u should do is use addition USER-COMMAND with your radio buttons.


PARAMETERS : r1 RADIOBUTTON GROUP r1 USER-COMMAND f1,
             r2 RADIOBUTTON GROUP r1.
PARAMETERS : p1 TYPE c MODIF ID a,
             p2 TYPE c MODIF ID b.

AT SELECTION-SCREEN . " output
  LOOP AT SCREEN .
    IF r2 = 'X' AND screen-name = 'P1'.
      screen-active = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Edited by: mrugesh phatak on Oct 8, 2008 11:00 AM

former_member226519
Active Contributor
0 Kudos

yes, used screen groups.

at selection-screen output you can make groups invisible

loop at screen.

if screen-group = xy

screen-invisible = '1'.

modify screen.

endif.

endloop.

Former Member
0 Kudos

Hi Gaurav,

Look in the sample code.


TABLES : MARA,SSCRFIELDS.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS : RB1 RADIOBUTTON GROUP RB1 USER-COMMAND COM MODIF ID R11,
             RB2 RADIOBUTTON GROUP RB1 MODIF ID R12,
             RB3 RADIOBUTTON GROUP RB1 MODIF ID R13.
SELECTION-SCREEN : END OF BLOCK B1.

SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR MODIF ID R11,
                S_MTART FOR MARA-MTART MODIF ID R12,
                S_MBRSH FOR MARA-MBRSH MODIF ID R13.
SELECTION-SCREEN : END OF BLOCK B2.


AT SELECTION-SCREEN OUTPUT.
IF RB1 = 'X'.
LOOP AT SCREEN.
 IF SCREEN-GROUP1 = 'R11'.
   SCREEN-INTENSIFIED = '1'.
   SCREEN-ACTIVE      = 1.
   SCREEN-DISPLAY_3D  = '1'.
  MODIFY SCREEN.
 ENDIF.
 IF SCREEN-GROUP1 = 'R12'.
  SCREEN-INTENSIFIED = '0'.
  SCREEN-ACTIVE      = 0.
  SCREEN-DISPLAY_3D  = '0'.
  MODIFY SCREEN.
 ENDIF.

 IF SCREEN-GROUP1 = 'R13'.
  SCREEN-INTENSIFIED = '0'.
  SCREEN-ACTIVE      = 0.
  SCREEN-DISPLAY_3D  = '0'.
  MODIFY SCREEN.
 ENDIF.

ENDLOOP.
ENDIF.

Former Member
0 Kudos

Hi Mukesh,

Thanks a lot.

That solved my issue.

Also thanks to Volker and murugesh.

Thanks and regards

Gaurav Raghav