2006 Mar 28 7:41 AM
Hi frnd's
I had 6 checkboxes in a program.
If i select 1 checkbox field the other should be made invisible.
help me.
2006 Mar 28 8:01 AM
Hi suganya,
this is working fine..
parameters : chk1 as checkbox modif id B1 user-command com1.
parameters : chk2 as checkbox modif id B2 user-command com1.
parameters : chk3 as checkbox modif id B3 user-command com1.
parameters : chk4 as checkbox modif id B4 user-command com1.
parameters : chk5 as checkbox modif id B5 user-command com1.
parameters : chk6 as checkbox modif id B6 user-command com1.
at selection-screen output.
loop at screen.
if chk1 is not initial or chk2 is not initial or chk3 is not initial
or chk4 is not initial or chk5 is not initial or chk6 is not initial.
if chk1 NE 'X' and screen-group1 = 'B1'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk2 NE 'X' and screen-group1 = 'B2'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk3 NE 'X' and screen-group1 = 'B3'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk4 NE 'X' and screen-group1 = 'B4'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk5 NE 'X' and screen-group1 = 'B5'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk6 NE 'X' and screen-group1 = 'B6'.
screen-input = '0'.
screen-invisible = '1'.
endif.
endif.
modify screen.
kindly reward points if it helps you
regards
satesh
2006 Mar 28 7:44 AM
Set the MODIF ID of the checkboxes and when one is checked
LOOP AT SCREEN.
IF screen-group = 'MOD'.
screen-invisible = '1'.
ENDIF.
ENDLOOP.
2006 Mar 28 7:51 AM
but the checkboxes are not created in groups, created as individual checkboxes,then how can i do it.
it is an modulepool program
2006 Mar 28 7:52 AM
parameters: p1 as checkbox user-command chk,
p2 as checkbox user-command chk,
p3 as checkbox user-command chk,
p4 as checkbox user-command chk,
p5 as checkbox user-command chk,
p6 as checkbox user-command chk.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p1 = 'X'.
IF SCREEN-NAME = 'P2' OR
SCREEN-NAME = 'P3' OR
SCREEN-NAME = 'P4' OR
SCREEN-NAME = 'P5' OR
SCREEN-NAME = 'P6'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
2006 Mar 28 7:53 AM
Set the function code attribute of the checkbox on your screen and then in your PBO, just apply the logic as above.
2006 Mar 28 8:01 AM
Hi suganya,
this is working fine..
parameters : chk1 as checkbox modif id B1 user-command com1.
parameters : chk2 as checkbox modif id B2 user-command com1.
parameters : chk3 as checkbox modif id B3 user-command com1.
parameters : chk4 as checkbox modif id B4 user-command com1.
parameters : chk5 as checkbox modif id B5 user-command com1.
parameters : chk6 as checkbox modif id B6 user-command com1.
at selection-screen output.
loop at screen.
if chk1 is not initial or chk2 is not initial or chk3 is not initial
or chk4 is not initial or chk5 is not initial or chk6 is not initial.
if chk1 NE 'X' and screen-group1 = 'B1'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk2 NE 'X' and screen-group1 = 'B2'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk3 NE 'X' and screen-group1 = 'B3'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk4 NE 'X' and screen-group1 = 'B4'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk5 NE 'X' and screen-group1 = 'B5'.
screen-input = '0'.
screen-invisible = '1'.
endif.
if chk6 NE 'X' and screen-group1 = 'B6'.
screen-input = '0'.
screen-invisible = '1'.
endif.
endif.
modify screen.
kindly reward points if it helps you
regards
satesh
2006 Mar 28 8:13 AM
Hi Suganya,
the above code works for all check boxes.. not only for the first one..
clicking on any one of them will make all others invisible...
regards
satesh