‎2006 Oct 02 11:00 PM
Hi all,
I have two radio buttons and three parameters. if the user chooses radio button1 i would like all the fields to be enabled for input. if the user chooses radio button2 I would like only the first field to be enabled for input.
please let me know what's wrong in this code. If I use
"AT selection-screen output". this code is working properly.
please let me know if this is possible with just
"At selection-screen".
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.
PARAMETERS: R1 RADIOBUTTON GROUP GR1 DEFAULT 'X',
R2 RADIOBUTTON GROUP GR1.
SELECTION-SCREEN SKIP 1.
PARAMETERS: P1 LIKE LIKP-VBELN MODIF ID BL1,
P2 TYPE I DEFAULT 1 MODIF ID BL5,
P3 LIKE T001W-WERKS MODIF ID BL5.
SELECTION-SCREEN END OF BLOCK BLK1.
AT SELECTION-SCREEN.
IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1' OR SCREEN-GROUP1 = 'BL5'.
SCREEN-INPUT = '1'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
ELSEIF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-INPUT = '1'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
CONTINUE.
ELSEIF SCREEN-GROUP1 = 'BL5'.
SCREEN-INPUT = '0'.
SCREEN-INTENSIFIED = '0'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
ENDIF.
Thanks,
Ganesh.
‎2006 Oct 02 11:08 PM
Hi,
Check your modified code..The changes are marked in bold..
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.
PARAMETERS: R1 RADIOBUTTON GROUP GR1 DEFAULT 'X' <b>USER-COMMAND UCOMM,</b>
R2 RADIOBUTTON GROUP GR1.
SELECTION-SCREEN SKIP 1.
PARAMETERS: P1 LIKE LIKP-VBELN MODIF ID BL1,
P2 TYPE I DEFAULT 1 MODIF ID BL5,
P3 LIKE T001W-WERKS MODIF ID BL5.
SELECTION-SCREEN END OF BLOCK BLK1.
<b>AT SELECTION-SCREEN OUTPUT.
IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL5'.
screen-input = '0'.
MODIFY SCREEN.
endif.
ENDLOOP.
endif.</b>
Thanks,
Naren
Message was edited by: Narendran Muthukumaran
‎2006 Oct 02 11:03 PM
The AT selection-screen output event is the PBO(process before output) and the AT selection-screen event is like the PAI(process after input) this is where you do the validations. When modifing the screen, you should always do this in the AT selection-screen OUTPUT event.
So.... change it back to the AT SELECTION-SCREEN OUTPUT
<b>AT SELECTION-SCREEN OUTPUT.</b>
IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1' OR SCREEN-GROUP1 = 'BL5'.
SCREEN-INPUT = '1'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
.....Regards,
Rich Heilman
‎2006 Oct 02 11:08 PM
‎2006 Oct 02 11:08 PM
Hi,
Check your modified code..The changes are marked in bold..
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.
PARAMETERS: R1 RADIOBUTTON GROUP GR1 DEFAULT 'X' <b>USER-COMMAND UCOMM,</b>
R2 RADIOBUTTON GROUP GR1.
SELECTION-SCREEN SKIP 1.
PARAMETERS: P1 LIKE LIKP-VBELN MODIF ID BL1,
P2 TYPE I DEFAULT 1 MODIF ID BL5,
P3 LIKE T001W-WERKS MODIF ID BL5.
SELECTION-SCREEN END OF BLOCK BLK1.
<b>AT SELECTION-SCREEN OUTPUT.
IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL5'.
screen-input = '0'.
MODIFY SCREEN.
endif.
ENDLOOP.
endif.</b>
Thanks,
Naren
Message was edited by: Narendran Muthukumaran
‎2006 Oct 02 11:23 PM
Hi,
If I use At selection-screen output to do this. once the uer enters some values in these fields Where do i write my code that processes these values.
Do i use At selection-screen for processing ?
Thanks,
Ganesh.
‎2006 Oct 02 11:24 PM
‎2006 Oct 02 11:28 PM
Hi,
In this code If i choose R2 and then R1 again I am not getting the second and third fields displayed.
How do i do that ?
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.
PARAMETERS: R1 RADIOBUTTON GROUP GR1 DEFAULT 'X' USER-COMMAND UCOMM,
R2 RADIOBUTTON GROUP GR1.
SELECTION-SCREEN SKIP 1.
PARAMETERS: P1 LIKE LIKP-VBELN MODIF ID BL1,
P2 TYPE I DEFAULT 1 MODIF ID BL5,
P3 LIKE T001W-WERKS MODIF ID BL5.
SELECTION-SCREEN END OF BLOCK BLK1.
AT SELECTION-SCREEN OUTPUT.
IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL5'.
screen-input = '0'.
MODIFY SCREEN.
endif.
ENDLOOP.
endif.
AT SELECTION-SCREEN.
IF R1 = 'X'.
IF P1 IS INITIAL OR P2 IS INITIAL OR P3 IS INITIAL.
MESSAGE ' PLEASE ENTER VALUES FOR ALL THE FIELDS ' TYPE 'W'.
ENDIF.
ENDIF.
Thanks,
Ganesh.
Message was edited by: mg s
‎2006 Oct 02 11:34 PM
You need to check the sy-ucomm so that you validation does not happen when selecting radiobuttons.
at selection-screen.
<b>check sy-ucomm <> 'UCOMM'.</b>
if r1 = 'X'.
if p1 is initial or p2 is initial or p3 is initial.
message ' PLEASE ENTER VALUES FOR ALL THE FIELDS ' type 'W'.
endif.
endif.
Regards,
Rich Heilman
‎2006 Oct 02 11:36 PM
Hi,
Add the changes that are marked in bold..
IF R1 = 'X' <b>AND SY-UCOMM <> 'UCOMM'</b>.
IF P1 IS INITIAL OR P2 IS INITIAL OR P3 IS INITIAL.
Thanks,
Naren
‎2006 Oct 02 11:42 PM