‎2006 Feb 01 3:13 PM
Hello,
I have a SELECTION-SCREEN, including a PARAMETER defined as CHECKBOX. Now I want to open fields for input, when the parameter is checked and close them, if it is not checked. How can I solve the problem?
thx
Mike
‎2006 Feb 01 3:18 PM
Hi Mike,
Should be something like this (sorry, but I am not in front of a SAP system right now...) :
AT SELECTION-SCREEN OUTPUT.
IF p_check = 'X'.
LOOP AT SCREEN.
CHECK screen-name = 'P_INPUT'.
screen-active = 1.
MODIFY screen.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
CHECK screen-name = 'P_INPUT'.
screen-active = 0.
MODIFY screen.
ENDLOOP.
ENDIF.Best regards,
Guillaume
‎2006 Feb 01 3:18 PM
Hi Mike,
Should be something like this (sorry, but I am not in front of a SAP system right now...) :
AT SELECTION-SCREEN OUTPUT.
IF p_check = 'X'.
LOOP AT SCREEN.
CHECK screen-name = 'P_INPUT'.
screen-active = 1.
MODIFY screen.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
CHECK screen-name = 'P_INPUT'.
screen-active = 0.
MODIFY screen.
ENDLOOP.
ENDIF.Best regards,
Guillaume
‎2006 Feb 01 3:21 PM
Hi
Use the USER-COMMAND addition while you define your checkbox:
PARAMETERS check AS CHECKBOX USER-COMMAND chk.
PARAMETERS p_bukrs LIKE t001-bukrs MODIF ID chk.
DATA: fl_input_off.
AT SELECTION-SCREEN OUTPUT.
CHECK check = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'CHK'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
max
‎2006 Feb 01 3:21 PM
Here is a sample.
report zrich_0002.
parameters: p_check1 as checkbox user-command check default 'X',
p_input(20) type c modif id CHK.
at selection-screen output.
if p_check1 = 'X'.
loop at screen.
if screen-group1 = 'CHK'.
screen-invisible = '0'.
screen-active = '1'.
modify screen.
endif.
endloop.
endif.
if p_check1 = space.
loop at screen.
if screen-group1 = 'CHK'.
screen-invisible = '1'.
screen-active = '0'.
modify screen..
endif.
endloop.
endif.
Regards,
Rich Heilman
‎2006 Feb 01 3:22 PM
Hi Mike,
You can do this way.
At SELECTION-SCREEN.
IF P_CHECK = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_WERKS'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.