08-11-2022 12:48 PM
Hi Experts!!
Please help me out with the following problem:
I am writing a program with several screens. Now, I need a requirement like: there will be a check box and a corresponding fields for that on a screen. When the box is checked, then only the fields should become editable, else non-editable. How can I achieve this?
In reports,, how can we achieve this .plz help me with some examples?
Please help me out. Thanks a lot in advance
08-11-2022 12:55 PM
Hi devika96
In your program - in following section you add the statement similar to this - as per your field names.AT SELECTION-SCREEN OUTPUT.
IF your_check_box = 'X'.
LOOP AT SCREEN.
IF screen-name = 'P_SENT'. "<=== your field name to be hidden
screen-invisible = 1. " to hide
screen-input = 0. " to disable
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards,Venkat
08-11-2022 2:09 PM
Hi Venkat ,
below shown is the ouput obtained and it is not hiding any fields. Could u pls guide me
AT SELECTION-SCREEN OUTPUT.
IF p_jda = 'X'.
LOOP AT SCREEN.
IF screen-name = 'P_BWKEY'.
SCREEN-NAME = 'P_RELDAT'.
SCREEN-NAME = 'S_BSART'. "<=== your field name to be hidden
screen-invisible = 1. " to hide
* screen-input = 0. " to disable
MODIFY SCREEN.
ENDIF.
ENDLOOP
08-11-2022 2:21 PM
hi devika96
Please put if statement for each fieldname. as below Loop end loop also to be corrected as below:
Please note that , after checking the checkbox - you need to press Enterkey.
IF p_jda = 'X'.
LOOP AT SCREEN.
IF screen-name = 'P_BWKEY'.
screen-invisible = 1. " to disable
ENDIF.
if SCREEN-NAME = 'P_RELDAT'.
screen-invisible = 1.. " to disable
ENDIF.
MODIFY SCREEN.
ENDLOOP
ENDIF.
IF p_jda NE 'X'. "To enable back - if check box is not selected
LOOP AT SCREEN.
IF screen-name = 'P_BWKEY'.
screen-invisible = 0. " to enable back
ENDIF.
if SCREEN-NAME = 'P_RELDAT'.
screen-invisible = 0.. " to enable back
ENDIF.
MODIFY SCREEN.
ENDLOOP
ENDIF.
regards,
08-12-2022 8:52 AM
venkateswaran.k
No, you do not have to press the enter key after checking the checkbox. For example, this will trigger the PAI on clicking on the checkbox.
PARAMETERS x_box AS CHECKBOX USER-COMMAND 'CHK'.
08-12-2022 11:43 AM
08-19-2022 11:42 AM
08-11-2022 2:48 PM
There's a field attribute Function Code which is triggered when the checkbox is changed. It will be same as pressing a button.