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: 

How to disable a checkbox

former_member687052
Participant
0 Kudos
87

Hi,

I have scenario where I have 4check boxes in my selection screen.. P_PRI, P_QUA, P_NEW and P_INV.

<b>P_PRI, P_QUA, P_NEW</b> will be selected(X) by default.

I have a requirement like when I select the fourth Checkbox <b>P_INV</b>, the two check boxes P_QUA and P_NEW should be unchecked and should be disabled(uneditable mode) and at the same time I have to generate some warning message(Later it will display the output after showing the warning message).

Is it possible to disable a checkbox..? If so, please tell me how to do that.

Can anyone provide me the sample code how to do this.

This is the selection screen logic I was talking about.

***********************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK CHOOSE WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(15) TEXT-002.

SELECTION-SCREEN POSITION 18.

PARAMETERS: P_PRI AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 31(15) TEXT-003.

SELECTION-SCREEN POSITION 48.

PARAMETERS: P_QUA AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 61(15) TEXT-004.

SELECTION-SCREEN POSITION 78.

PARAMETERS: P_NEW AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK CHOOSE.

SELECTION-SCREEN BEGIN OF BLOCK PRICE WITH FRAME TITLE TEXT-006.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(15) TEXT-007.

SELECTION-SCREEN POSITION 18.

PARAMETERS: P_INV AS CHECKBOX.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK PRICE.

***********************************************************************************

Thanks in advance.

regards,

Paddu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
60

Hi Paddu,

Check this out...I didn't include Warning message but once you are satisfied with this code...we can add it easily


SELECTION-SCREEN BEGIN OF BLOCK CHOOSE WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(15) TEXT-002.
SELECTION-SCREEN POSITION 18.
PARAMETERS: P_PRI AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN COMMENT 31(15) TEXT-003.
SELECTION-SCREEN POSITION 48.
PARAMETERS: P_QUA AS CHECKBOX MODIF ID m1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 61(15) TEXT-004.
SELECTION-SCREEN POSITION 78.
PARAMETERS: P_NEW AS CHECKBOX MODIF ID m1 DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK CHOOSE.

SELECTION-SCREEN BEGIN OF BLOCK PRICE WITH FRAME TITLE TEXT-006.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(15) TEXT-007.
SELECTION-SCREEN POSITION 18.
PARAMETERS: P_INV AS CHECKBOX USER-COMMAND P_INV.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK PRICE.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    IF p_inv = 'X' AND screen-group1 = 'M1'.
      p_qua = ''.
      p_new = ''.
      screen-input = '0'.
    ENDIF.
    MODIFY SCREEN.

ENDLOOP.

Regards,

Vivek

2 REPLIES 2

Former Member
0 Kudos
60

this you can handle in AT SELECTION-SCREEN OUTPUT event.

Please check these threads for more details -

For At selection screen output

Using this you should be able to code your logic.

Former Member
0 Kudos
61

Hi Paddu,

Check this out...I didn't include Warning message but once you are satisfied with this code...we can add it easily


SELECTION-SCREEN BEGIN OF BLOCK CHOOSE WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(15) TEXT-002.
SELECTION-SCREEN POSITION 18.
PARAMETERS: P_PRI AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN COMMENT 31(15) TEXT-003.
SELECTION-SCREEN POSITION 48.
PARAMETERS: P_QUA AS CHECKBOX MODIF ID m1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 61(15) TEXT-004.
SELECTION-SCREEN POSITION 78.
PARAMETERS: P_NEW AS CHECKBOX MODIF ID m1 DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK CHOOSE.

SELECTION-SCREEN BEGIN OF BLOCK PRICE WITH FRAME TITLE TEXT-006.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(15) TEXT-007.
SELECTION-SCREEN POSITION 18.
PARAMETERS: P_INV AS CHECKBOX USER-COMMAND P_INV.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK PRICE.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    IF p_inv = 'X' AND screen-group1 = 'M1'.
      p_qua = ''.
      p_new = ''.
      screen-input = '0'.
    ENDIF.
    MODIFY SCREEN.

ENDLOOP.

Regards,

Vivek