‎2021 Apr 15 11:45 AM
when i select a radiobutton, a parameter must become mandatory, how do i do?
‎2021 Apr 15 12:17 PM
‎2021 Apr 15 12:21 PM
mark.fry999
Hi Luca,
as far as I know, you'll have to do this manually with checking in AT-SELECTION-SCREEN. At least that's how I've done it in the past as you cannot define a selection-screen field as OBLIGATORY if there are radiobutton-dependent cases where it doesn't need to be filled.
Hope this helps!
Cheers
Bärbel
‎2021 Apr 15 1:32 PM
‎2021 Apr 15 1:48 PM
I think you can set/change the required parameter of a certain field in the AT SELECTION SCREEN OUTPUT event, so that the mandatory part is changed together with the radio button selection.
So something like this:
AT SELECTION-SCREEN OUTPUT.
IF relevant_radio_button EQ abap_true.
LOOP AT SCREEN.
IF screen-name = 'P_FIELD'.
screen-required = '2'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.And of course assign a USER-COMMAND to the radio button group, so each change of option would trigger a round-trip (and thus make sure the OUTPUT event is triggered.
(code is written by heart, not completely sure the syntax 100% correct).