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

Disable single selection input based on check box selection.

Former Member
0 Likes
3,682

Hi,

I need to disable only one selection input based on a check box,

if the check box is selected then the input should be enabled else it should be disabled.

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,604

hi shedon ,

The solution to your problem is quite simple <b>if ur working on dialog programming.</b>

u can <b>perform the following in the PBO</b> of the screen containing the check box :

MODULE STATUS_0100 OUTPUT.

IF CHECK EQ 'X' . " if checked

LOOP AT SCREEN .

IF SCREEN-NAME EQ 'EID'. " 1st element that is enabled after by checkbox

SCREEN-INVISIBLE = 0 .

ENDIF.

MODIFY SCREEN .

IF SCREEN-NAME EQ 'WEMP'. " 2nd element that is enabled SCREEN-INVISIBLE = 0 .

ENDIF.

MODIFY SCREEN .

IF SCREEN-NAME EQ 'SUBMIT'. " 2nd element that is enabled

SCREEN-INVISIBLE = 0 .

ENDIF.

MODIFY SCREEN .

ENDLOOP .

ELSE .

LOOP AT SCREEN .

IF SCREEN-NAME EQ 'EID'.

SCREEN-INVISIBLE = 1 .

ENDIF.

MODIFY SCREEN .

IF SCREEN-NAME EQ 'WEMP'.

SCREEN-INVISIBLE = 1.

SCREEN-INPUT = 0 .

ENDIF.

MODIFY SCREEN .

IF SCREEN-NAME EQ 'SUBMIT'.

SCREEN-INVISIBLE = 1.

ENDIF.

MODIFY SCREEN .

ENDLOOP .

ENDIF.

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

you can continue with ur selection criteria in PAI.

REVERT BACK FOR ANY QUERY.......................

DO REWARD POINTS IF USEFUL

6 REPLIES 6
Read only

Former Member
0 Likes
1,605

hi shedon ,

The solution to your problem is quite simple <b>if ur working on dialog programming.</b>

u can <b>perform the following in the PBO</b> of the screen containing the check box :

MODULE STATUS_0100 OUTPUT.

IF CHECK EQ 'X' . " if checked

LOOP AT SCREEN .

IF SCREEN-NAME EQ 'EID'. " 1st element that is enabled after by checkbox

SCREEN-INVISIBLE = 0 .

ENDIF.

MODIFY SCREEN .

IF SCREEN-NAME EQ 'WEMP'. " 2nd element that is enabled SCREEN-INVISIBLE = 0 .

ENDIF.

MODIFY SCREEN .

IF SCREEN-NAME EQ 'SUBMIT'. " 2nd element that is enabled

SCREEN-INVISIBLE = 0 .

ENDIF.

MODIFY SCREEN .

ENDLOOP .

ELSE .

LOOP AT SCREEN .

IF SCREEN-NAME EQ 'EID'.

SCREEN-INVISIBLE = 1 .

ENDIF.

MODIFY SCREEN .

IF SCREEN-NAME EQ 'WEMP'.

SCREEN-INVISIBLE = 1.

SCREEN-INPUT = 0 .

ENDIF.

MODIFY SCREEN .

IF SCREEN-NAME EQ 'SUBMIT'.

SCREEN-INVISIBLE = 1.

ENDIF.

MODIFY SCREEN .

ENDLOOP .

ENDIF.

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

you can continue with ur selection criteria in PAI.

REVERT BACK FOR ANY QUERY.......................

DO REWARD POINTS IF USEFUL

Read only

0 Likes
1,604

Hi,

Thanks for the reply, but im not working on dialog programming.

Read only

0 Likes
1,604

u can try this

at selection screen.

if checkbox = 'X'.

loop at screen.

if screen-name = the name of ur field which u want 2 hide.

screen-invisible = 1.

screen-active = 0.

modify screen.

endloop.

also in place of ' at selection screen ' try this ' at selection screen output '

Read only

0 Likes
1,604

Hi Sheldon

Please use the event

<b>AT SELECTION-SCREEN OUTPUT.</b>

LOOP AT SCREEN.

IF SCREEN_NAME = <the one which you want to blank>

IF P_YOUR_CHECKBOX = 'X' .

Change SCREEN-VISIBLE or SCREEN-INPUT whichever is relevant

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
1,604

parameters : chk as checkbox user-command u1.

parameters : inp type c modif id MD1.

at selection-screen output.

if chk = 'X'.

loop screen.

if screen-group1 = 'MD1'.

screen-input = 0.

else.

screen-input = 1.

endif.

modify screen.

endloop.

Read only

Former Member
0 Likes
1,604

Hi Seldon,

The below code will solve your proble. Please reward if your problem is solved.

selection-screen begin of block b1.
parameters: v_chk as checkbox user-command rad,
            v_matnr type mara-matnr modif id M1 .
selection-screen end of block b1.


AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
if v_chk = 'X'.
  IF SCREEN-GROUP1 = 'M1'.
    SCREEN-active = 1.
    MODIFY SCREEN.
  ENDIF.
else.
 IF SCREEN-GROUP1 = 'M1'.
    SCREEN-active = 0.
    MODIFY SCREEN.
  ENDIF.
endif.
ENDLOOP.

Thanks,

Suma.