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

parameter mandatory

Luca_Cavarretta
Explorer
1,504

when i select a radiobutton, a parameter must become mandatory, how do i do?

4 REPLIES 4
Read only

cris_hansen
Product and Topic Expert
Product and Topic Expert
0 Likes
1,259

Hi Luca,

You can check this question/answer and this ABAP documentation (in German).

Regards,

Cris

Read only

BaerbelWinkler
SAP Champion
SAP Champion
1,259

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

Read only

0 Likes
1,259

what should I write inside the AT-SELECTION-SCREEN. ?

Read only

Patrick_vN
Active Contributor
1,259

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).