Application Development and Automation 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: 
Read only

Reg check boxes

Former Member
0 Likes
1,166

Hi , I tried to find out how to disable one checkbox at runtime in forums but I could not understand ..so tell me how to do this.

Parameters : check1 as checkbox modif id CH1,

check2 as checkbox modif id CH2.

now when I check one checkbox the otherone has to disable.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,139

HI Bachi



Parameters : check1 as checkbox modif id CH1 USER COMMAND u1,
check2 as checkbox modif id CH2 USER COMMAND u2.

LOOP AT SCREEN.

IF screen-group1 = 'CH1' AND check2 IS NOT INITIAL.
screen-active = 0.
endif.
.
.
.
ENDLOOP.

Pushpraj

Hi , I tried to find out how to disable one checkbox at runtime in forums but I could not understand ..so tell me how to do this.

Parameters : check1 as checkbox modif id CH1,

check2 as checkbox modif id CH2.

now when I check one checkbox the otherone has to disable.

8 REPLIES 8
Read only

Former Member
0 Likes
1,139

Hi,

There is nothing hard to understand in this. Have alook at this


Parameters : check1 as checkbox modif id CH1,
                     check2 as checkbox modif id CH2.


AT SELECTION-SCREEN OUTPUT.         " The event where disable option can be used

LOOP AT SCREEN.
IF check1 =  'X'.                                      " Checking if check1 is checked
IF screen-group1 = 'CH2' .      "assigning the field with the modif value ch2 to identify check2
screen-active = 0.                  " making the field disabled
MODIFY SCREEN.                   " modifying the screen
ENDIF.
ENDIF.
ENDLOOP.

Hope you are clear now

Regards,

Vikranth

Read only

0 Likes
1,139

Here after checking one check box with out executing the program the other one check box has to disable.

dynamically it has to change

Like Radio Button Mechanism

Edited by: Bachi Reddy on Sep 16, 2009 1:25 PM

Edited by: Bachi Reddy on Sep 16, 2009 1:26 PM

Read only

0 Likes
1,139

HI Bachi

USER COMMAND does what you want.

Pushpraj

Read only

0 Likes
1,139

Hi

Use the same code

Parameters : check1 as checkbox modif id CH1 USER COMMAND u1,

check2 as checkbox modif id CH2 USER COMMAND u2.

LOOP AT SCREEN.

IF screen-group1 = 'CH1' AND check2 IS NOT INITIAL.

screen-active = 0.

endif.

.

.

.

ENDLOOP.

But at

INITILIZATION level

give check1 = 'X'.

Regards,

Sreeram

Read only

Former Member
0 Likes
1,140

HI Bachi



Parameters : check1 as checkbox modif id CH1 USER COMMAND u1,
check2 as checkbox modif id CH2 USER COMMAND u2.

LOOP AT SCREEN.

IF screen-group1 = 'CH1' AND check2 IS NOT INITIAL.
screen-active = 0.
endif.
.
.
.
ENDLOOP.

Pushpraj

Read only

Former Member
0 Likes
1,139

add a user command to the parameter (check the online help on PARAMETERS for more info)

This will trigger the AT-SELECTION-SCREEN event, this you can then uses loop at screen and disable / hide, or whatever you want to do with the hceckbox.

Kind regards, Rob Dielemans

Read only

Former Member
0 Likes
1,139

Hi,

Try like below code

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-024.
s_asn   FOR zgr-zasn
                                  MODIF ID aa,
PARAMETER      : cb_test AS CHECKBOX  DEFAULT 'X'
                            USER-COMMAND u1.     " Test run
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
* Do not display asn field when test run
* checkbox is not checked
  LOOP AT SCREEN.
    IF cb_test = space AND screen-group1 = c_aa.
      screen-output = 0.
      screen-active = 0.
      screen-input  = 0.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Regards,

Nandha

Read only

Former Member
0 Likes
1,139

Parameters : check1 as checkbox modif id CH1 USER-COMMAND u1,

check2 as checkbox modif id CH2 USER-COMMAND u2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'CH1' AND check2 IS NOT INITIAL.

screen-active = 1.

screen-input = 0.

endif.

modify screen.

IF screen-group1 = 'CH2' AND check1 IS NOT INITIAL.

screen-active = 1.

screen-input = 0.

endif.

modify screen.

ENDLOOP.