‎2009 Mar 17 4:08 PM
Hi guys!
I have a question about modify a screen . I have a checkbox in my screen and when it's checked
other field of the screen called name is editable (screen-input = 1) , in the other case is not editable
(screen-input = 0).
I put in my PBO.
IF CHECK IS NOT INITIAL.
LOOP AT SCREEN.
IF SCREEN-NAME = 'MY_FIELD.
SCREEN-INPUT = 1.
MODIFY SCREEN.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
But it only works when I press enter button . How can I do for changing screen field mode without press the button , automatically when the I check field CHECK?.
Thanks a lot.
‎2009 Mar 17 4:15 PM
You need to put FCODE to the check box ( Double click on check box in the layout editor you will get a attribute window , you can find Fcode here)
Please check demo program
demo_dynpro_check_radio
a®
‎2009 Mar 17 4:15 PM
You need to put FCODE to the check box ( Double click on check box in the layout editor you will get a attribute window , you can find Fcode here)
Please check demo program
demo_dynpro_check_radio
a®
‎2009 Mar 17 4:19 PM
Hi,
Add Function Code to the Check box in the check box field Attributes. When ever you clink on this Check box Func code get's triggered which you can handle in PAI of the screen.
‎2009 Mar 17 4:21 PM
There is one event data_changed, which actually track any change of data in the alv grid, you can try to create an implementation for this.
Kuntal
‎2009 Mar 17 4:31 PM
Hi,
Go to screen layout and double on the checkbox.... you will get the properties...
in the properties window set the FCODE which means the function code to some name....
now when you just click on the check box it will trigger PAI and PBO
IF CHECK IS INITIAL. " Change from is not initial to is initial
LOOP AT SCREEN.
IF SCREEN-NAME = 'MY_FIELD.
SCREEN-INPUT = 0. " Change from 1 to 0
MODIFY SCREEN.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.Regards,
Siddarth
‎2009 Mar 18 3:53 AM
Hi,
Use this code, its working:-
You dont need to hit enter. When you select checkbox field is editable else it is grayed out.
When using reporting.
PARAMETERS : p_chk AS CHECKBOX USER-COMMAND abcd.
PARAMETERS : p_param(10) TYPE c MODIF ID gp1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_chk = 'X'.
IF screen-group1 = 'GP1'.
screen-input = 1.
ENDIF.
ELSE.
IF screen-group1 = 'GP1'.
screen-input = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Else if you are using MODULE POOL Programming
Then follow these steps:-
Take a checkbox with name : CHK, Function code : CS and Function type : S
Also take a textbox with group1 as GP1
Now use code in PBO:-
LOOP AT SCREEN.
IF chk = 'X'.
IF screen-group1 = 'GP1'.
screen-input = 1.
screen-active = 1.
ENDIF.
ELSE.
IF screen-group1 = 'GP1'.
screen-input = 0.
screen-active = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Hope this solves your problem.
Regards,
Tarun
Edited by: Tarun Gambhir on Mar 18, 2009 9:32 AM
‎2009 Mar 18 4:31 AM
Hi Ana,
Put your logic in at selection-screen event and give user-command to the check box.
Check the below eg:
PARAMETERS: p_carrid TYPE s_carr_id .
PARAMETERS check AS CHECKBOX USER-COMMAND check.
AT SELECTION-SCREEN.
IF check = 'X'.
LOOP AT SCREEN.
IF screen-name = 'P_CARRID'.
screen-input = 1.
MODIFY SCREEN.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
AT-selection screen event will process whenever an event occurs in the sel. screen. ie, it will trigger when you check the checkbox.
Regards,
Soumya.
‎2009 Mar 24 8:58 AM