‎2009 Jul 08 3:09 PM
Hi All,
I searched the forum for my problem of enabling and disabling UI elements and got this thread:
Now I am not sure why in my code it is not working:
...
selection-screen begin of block b1 with frame title text-001.
select-options: swcv for p_string.
select-options: namespce for p_string.
parameters: selectal as checkbox default space user-command all.
selection-screen end of block b1.
...
at selection-screen.
perform validate_form.
...
form validate_form.
if sy-ucomm eq 'ALL'.
if selectal eq 'X'.
loop at screen.
if screen-name CP 'SWCV*'.
screen-active = '0'.
elseif screen-name CP 'NAMESPCE*'.
screen-active = '0'.
endif.
modify screen.
endloop.
elseif selectal eq space.
loop at screen.
if screen-name CP 'SWCV*'.
screen-active = '1'.
elseif screen-name CP 'NAMESPCE*'.
screen-active = '1'.
endif.
modify screen.
endloop.
endif.
endif.
endform.
I have tried screen-active and also screen-invisible inplace of it. Passed '0' for disabling and '1' to enabling but somehow it doens't work. In debug mode I have seen that the values are changed from 0 to 1 and 1 to 0 and modify screen is also called, but somehow the UI doesn't reflect the changes?
I want to disable two select-option field SWCV and NAMESPCE when user checks the SELECTAL checkbox.
Please let me know what am I doing wrong?
Regards,
Arpit
‎2009 Jul 08 3:11 PM
‎2009 Jul 08 3:11 PM
‎2009 Jul 08 3:16 PM
try this code
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: swcv FOR p_string MODIF ID a1.
SELECT-OPTIONS: namespce FOR p_string MODIF ID a1 .
PARAMETERS: selectal AS CHECKBOX DEFAULT space USER-COMMAND all.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'A1' .
IF selectal = 'X' .
screen-input = 0 .
ELSE.
screen-input = 1 .
ENDIF.
MODIFY SCREEN .
ENDIF.
ENDLOOP .
‎2009 Jul 08 3:17 PM
This is working for me. Don't need to check sy-ucomm.
selection-screen begin of block b1 with frame title text-001.
select-options: swcv for p_string.
select-options: namespce for p_string.
parameters: selectal as checkbox default space user-command all.
selection-screen end of block b1.
at selection-screen output.
perform validate_form.
form validate_form.
if selectal eq 'X'.
loop at screen.
if screen-name CP 'SWCV*'
or screen-name CP 'NAMESPCE*'.
screen-input = '0'.
endif.
modify screen.
endloop.
elseif selectal eq space.
loop at screen.
if screen-name CP 'SWCV*'
or screen-name CP 'NAMESPCE*'.
screen-input = '1'.
endif.
modify screen.
endloop.
endif.
endform.Regards,
Rich Heilman
‎2009 Jul 08 3:23 PM
Thanks all. It is working now.
Just want to know, why the event at selection-screen didnt work and at selection-screen output worked?
Is it like the second event also makes call back to the report UI?
Thanks again for solving the problem.
Regards,
Arpit
‎2009 Jul 08 3:37 PM
AT SELECTION-SCREEN OUTPUT is the PBO, process before output. We always set screen attributes in the PBO. The AT SELECTION-SCREEN is the PAI, process after input. This is triggered after the user clicks something, and the control is then passed back around to the PBO, where again we set the screen attributes.
Regards,
Rich Heilman