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: 

At selection screen i have 2 check boxes i have to keep one of them checked

Former Member
0 Kudos
423

At selection screen i have 2 check boxes i have to keep one of them checked.i can't keep both unchecked and one of them is checked by default.Please help how to do this?

7 REPLIES 7

Simha_
Advisor
Advisor
0 Kudos
211

Hi,

While defining the checkbox , u give the default value of the check box as 'X'.

Then it will be checked...

Cheers,

SImha.

gopi_narendra
Active Contributor
0 Kudos
211

<b>Check thsi code now</b>

PARAMETERS : p_c1 AS CHECKBOX USER-COMMAND um1 DEFAULT 'X'.
PARAMETERS : p_c2 AS CHECKBOX USER-COMMAND um1.

AT SELECTION-SCREEN.
  IF p_c1 = ' ' AND p_c2 = ' '.
    MESSAGE e000(z1).
  ENDIF.

Regards

Gopi

0 Kudos
211

Thanks Gopi I got it.

Former Member
0 Kudos
211

No that i have done already.But the user can still come on selection Screen nd uncheck it.I have to do a validation on selection screen that both can't be unchecked?Please give directions.

0 Kudos
211

Hi,

Befor executing you check for the check boxes to be checked or not.

If one of the check box is checked then u can proceed , if not then give him a error message saying 'Check atleast one checkbox'.

Cheers,

Simha.

0 Kudos
211

i think you will have to write your logic in the event at selection screen output.

do the validation for if both the check boxes are blank display a error message.

Former Member
0 Kudos
211

Saket,

Why don't you use radio buttons. Your requirement is exactly the situation radio buttons should be used.

Bruce