2010 Sep 23 7:13 PM
Hello,
I have a problem with my selection screen and some radio buttons.
I have tried to switch dynamically a display on my screen based on radiobuttons. When I click on the first radiobutton, there is one specific field and when the second is selected, two others parameters I asked instead of the other one. So everything works well, using a u201Cuser-commandu201D on the radiobutton parameter declaration to allow the switch. Though, since some fields are u201Crequiredu201D (OBLIGATORY), if one is missing a value, I canu2019t make the switch at all, asking me to fill the fields first. Since the switch of radio button doesnu2019t require the fields to be filled, is there a way to somehow u201Cbypassu201D the required fields for the radiobutton change? Hereu2019s what I have tried so far:
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF pa_vac = gc_true.
IF screen-group1 = 'BL1'.
screen-active = '1'.
screen-required = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'BL2'.
screen-active = '0'.
screen-required = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'BL1' OR screen-group1 = 'BL3'.
screen-required = '1'.
ENDIF.
ELSE.
IF screen-group1 = 'BL1'.
screen-active = '0'.
screen-required = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'BL2'.
screen-active = '1'.
screen-required = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'BL2' OR screen-group1 = 'BL3'.
screen-required = '1'.
ENDIF.
ENDIF.
ENDLOOP.Thank you for your help everyone!
Please use code tags
Edited by: Rob Burbank on Sep 23, 2010 2:17 PM
2010 Sep 27 8:44 AM
Hi PAQUEJO,
As said by Rob & Ravi you should nott use OBLIGATORY to make a field required when dealing with radiobuttons. To get the required functionality. in AT SELECTION-SCREEN event put validations based on function code 'ONLI', for example :
AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'ONLI'.
"Put your conditions here like say your parameter is P_PARA then
IF P_PARA IS INITIAL.
MESSAGE E000(Z123) WITH 'Please fill field PARA'.
ENDIF.
ENDCASE.
Hope this will help.
Thanks & Regards,
Rock.
Hello,
I have a problem with my selection screen and some radio buttons.
I have tried to switch dynamically a display on my screen based on radiobuttons. When I click on the first radiobutton, there is one specific field and when the second is selected, two others parameters I asked instead of the other one. So everything works well, using a u201Cuser-commandu201D on the radiobutton parameter declaration to allow the switch. Though, since some fields are u201Crequiredu201D (OBLIGATORY), if one is missing a value, I canu2019t make the switch at all, asking me to fill the fields first. Since the switch of radio button doesnu2019t require the fields to be filled, is there a way to somehow u201Cbypassu201D the required fields for the radiobutton change? Hereu2019s what I have tried so far:
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF pa_vac = gc_true.
IF screen-group1 = 'BL1'.
screen-active = '1'.
screen-required = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'BL2'.
screen-active = '0'.
screen-required = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'BL1' OR screen-group1 = 'BL3'.
screen-required = '1'.
ENDIF.
ELSE.
IF screen-group1 = 'BL1'.
screen-active = '0'.
screen-required = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'BL2'.
screen-active = '1'.
screen-required = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'BL2' OR screen-group1 = 'BL3'.
screen-required = '1'.
ENDIF.
ENDIF.
ENDLOOP.Thank you for your help everyone!
Please use code tags
Edited by: Rob Burbank on Sep 23, 2010 2:17 PM
2010 Sep 23 7:19 PM
This is a pretty common problem. You'll have to remove the "obligatory" option and do the testing in the program.
Rob
2010 Sep 27 8:36 AM
Hi,
Remove obligatory and put your validaton on while execute the sy-ucom = 'ONLI'.
2010 Sep 27 8:44 AM
Hi PAQUEJO,
As said by Rob & Ravi you should nott use OBLIGATORY to make a field required when dealing with radiobuttons. To get the required functionality. in AT SELECTION-SCREEN event put validations based on function code 'ONLI', for example :
AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'ONLI'.
"Put your conditions here like say your parameter is P_PARA then
IF P_PARA IS INITIAL.
MESSAGE E000(Z123) WITH 'Please fill field PARA'.
ENDIF.
ENDCASE.
Hope this will help.
Thanks & Regards,
Rock.
2014 Aug 28 10:30 AM
Thanks for your answer, very helpful even after years !
Best regards,
Paskalo