01-18-2008 1:36 AM
Hi experts,
What do I need to do if I want to create a text field that can only be active after a checkbox has been ticked?
I have a text field A and checkbox B with OK_CODE CHECKBOX.
In PBO i've set the screen-input for text field A to '0' meaning that I dont want A to receive any input as yet. Only after I've ticked checkbox B then I want A can receive input. I've tried to set at PAI where when the OK_CODE = CHECKBOX, loop at screen and if screen-name = 'A' then i'll set screen-input for A as 1.
However when I tried to run, the text field A still cannot receive any input. My code at PAI as below:
if ok_code = 'CHECKBOX'.
loop at screen.
if screen-name ='A'.
screen-input = '1'.
modify screen.
endif.
endloop.
endif.
please help. Thanks
endloop
01-18-2008 1:44 AM
check this sample code.. try to implement the same in the PBO of ur screen.
for your easy understanding i had written it for a selection screen.
PARAMETERS : p_c AS CHECKBOX USER-COMMAND u1.
PARAMETERS : p_file TYPE rlgrap-filename.
AT SELECTION-SCREEN OUTPUT.
IF p_c = 'X'. " meaning check box is checked
LOOP AT SCREEN.
IF screen-name = 'P_FILE'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE. " meaning check box is unchecked
LOOP AT SCREEN.
IF screen-name = 'P_FILE'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards
Gopi
01-18-2008 1:44 AM
check this sample code.. try to implement the same in the PBO of ur screen.
for your easy understanding i had written it for a selection screen.
PARAMETERS : p_c AS CHECKBOX USER-COMMAND u1.
PARAMETERS : p_file TYPE rlgrap-filename.
AT SELECTION-SCREEN OUTPUT.
IF p_c = 'X'. " meaning check box is checked
LOOP AT SCREEN.
IF screen-name = 'P_FILE'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE. " meaning check box is unchecked
LOOP AT SCREEN.
IF screen-name = 'P_FILE'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards
Gopi
01-18-2008 2:07 AM