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: 

one doubt regarding check box

Former Member
0 Kudos
102

i have two check boxes.

if i selected one specific check box i want the other to be disabled.

plz tell me the code for that.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
85

Hi Sripathi,

Use LOOP AT SCREEN ...ENDLOOP in AT SELECTION-SCREEN OUTPUT event and disable the check box using SCREEN-ACTIVE = '0'.

PARAMETERS: CB_ONE AS CHECKBOX USER-COMMAND USR.

PARAMETERS: CB_TWO AS CHECKBOX MODIF ID M1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'M1' AND CB_ONE = 'X'.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ELSEIF SCREEN-GROUP1 = 'M1' AND CB_TWO = 'X'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Thanks,

Vinay

4 REPLIES 4

Former Member
0 Kudos
85

Hi,

check this example..

PARAMETERS: p_c1 AS CHECKBOX USER-COMMAND usr1 .

PARAMETERS: p_c2 AS CHECKBOX MODIF ID m1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'M1' AND p_c1 = 'X'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Thanks,

Naren

Former Member
0 Kudos
86

Hi Sripathi,

Use LOOP AT SCREEN ...ENDLOOP in AT SELECTION-SCREEN OUTPUT event and disable the check box using SCREEN-ACTIVE = '0'.

PARAMETERS: CB_ONE AS CHECKBOX USER-COMMAND USR.

PARAMETERS: CB_TWO AS CHECKBOX MODIF ID M1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'M1' AND CB_ONE = 'X'.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ELSEIF SCREEN-GROUP1 = 'M1' AND CB_TWO = 'X'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Thanks,

Vinay

ferry_lianto
Active Contributor
0 Kudos
85

Hi,

Please try this.


parameters: p_check1 as checkbox,
            p_check2 as checkbox.
 
 
at selection-screen output.
 
  loop at screen.
    if screen-name = 'P_CHECK2' and P_CHECK1 = 'X'.
      screen-input = '0'.
      modify screen.
    endif.
  endloop.

.

Regards,

Ferry Lianto

0 Kudos
85

An addition...which ever check box you choose the other one will be disabled...

PARAMETERS: p_c1 AS CHECKBOX USER-COMMAND usr1 modif id m.

PARAMETERS: p_c2 AS CHECKBOX user-command usr2 MODIF ID m1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'M1' AND p_c1 = 'X'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

if screen-group1 = 'M' and p_c2 = 'X'.

screen-input = 0.

modify screen.

endif.

ENDLOOP.

check this and award points if it helps