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: 

Checkbox Property

Former Member
0 Kudos
146

Hi frnd's

I had 6 checkboxes in a program.

If i select 1 checkbox field the other should be made invisible.

help me.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
110

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

6 REPLIES 6

Former Member
0 Kudos
110

Set the MODIF ID of the checkboxes and when one is checked

LOOP AT SCREEN.

IF screen-group = 'MOD'.

screen-invisible = '1'.

ENDIF.

ENDLOOP.

0 Kudos
110

but the checkboxes are not created in groups, created as individual checkboxes,then how can i do it.

it is an modulepool program

Former Member
0 Kudos
110
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.

0 Kudos
110

Set the function code attribute of the checkbox on your screen and then in your PBO, just apply the logic as above.

Former Member
0 Kudos
111

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

0 Kudos
110

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