‎2009 Apr 29 5:00 AM
I have a button in the application toolbar of the GUI status.I want to disable it and it should be enabled when a certain field in the database table is updated.Please suggest how can I do it.
‎2009 Apr 29 5:05 AM
hello,
TO disable a button use the logic below
DATA: it_ucomm TYPE TABLE OF sy-ucomm.
AT SELECTION-SCREEN OUTPUT.
APPEND :
'PRIN' TO it_ucomm, "for print
'SPOS' TO it_ucomm, "for SAVE
'ONLI' TO it_ucomm, "for execute
'E' TO it_ucomm, "for back
'ENDE' TO it_ucomm, "for exit
'ECAN' TO it_ucomm. "for cancel
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = it_ucomm.
Once the button is clicked, again the above logic can be altered to enable it again.
Regards,
Mansi.
‎2009 Apr 29 6:04 AM
Hi,
You can disable a particular button in the GUI status by excluding that function code while setting the PF status.
Create a perform with name pf_stat_set and write this following code and pass this perform name to the parameter i_callback_pf_status_set of the ALV function module
FORM pf_stat_set USING extab TYPE slis_t_extab.
DATA: w_extab TYPE slis_extab.
w_extab-fcode = 'XXX'. "The function code of the button you want to exclude
APPEND w_extab TO extab.
SET PF-STATUS 'YYYY' EXCLUDING extab.
ENDFORM.
Thanks,
Sowmya