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: 

Radio buttons in dynpro with mandatory field

Former Member
0 Kudos
219

I have two radio buttons in a group and a field that should be mandatory when one (the first one) is checked.

So when the other is checked it should not be mandatory.

The problem is that when I check the second the field is mandatory until I have put something in the field. In that moment, the field is not mandatory. What I want is to make the field not mandatory when the second is checked so the status of the field was changed to not required in that moment not when I put something in it.

Thank you

6 REPLIES 6

Former Member
0 Kudos
160

Hi,

Maria ,

did u do the groupings on the radio buttons ..

vijay.

former_member181962
Active Contributor
0 Kudos
160

Hi Maria,

To start with, yo uhave to remove the mandatory(Obligatory) addition for both of the parameters .

refer this link for some idea:

Regards,

Ravi

Former Member
0 Kudos
160

Assign a Function code for that radio button.

In the PAI event,

if sy-ucomm = 'RADI' and r1 = 'X' and field1 is initial.

*Give error message.

endif.

Regards,

Prakash.

Former Member
0 Kudos
160

Hi Maria,

I think you have two possibility.

One is to check the "mandatory field" by programming and not with the attribute in the dynpro.

The second way is making a loop at screen in the PBO and depend on with radio button is checked modify the required field of screen table for the field of your interest .

I hope this can help you.

bye

enzo

Former Member
0 Kudos
160

check the progrm demo_dynpro_check_radio

regards,

vijay.

0 Kudos
160

Yes, they are grouped. But I have only determined the mandatory field when one is checked not for both.