‎2005 Dec 02 9:03 AM
Is there any way to disable buttons in APPLICATION TOOLBAR of Gui Status through ABAP code?
I have to disable button Save When click on button Change and vice versa.
Thanks
Christian
‎2005 Dec 02 9:08 AM
you should write in sy-ucom of change button.
when 'CHANGE'.
SET PF_STATUS 'STAT' EXCLUDING '<b>SAVE</b>'.
SAVE if Fcode of savebutton.
regards
vijay
‎2005 Dec 02 9:06 AM
Hi Christian,
1. As far as i know, there is no such direct
way to AFFECT the buttons on the gui - status toolbar.
2. This is the reason why there are 3 -4
different GUI STATUS
for ADD,EDIT,Delete,View.
(in almost all sap transactions)
The toolbar has to explicitly set
thru SET PF-STATUS
depending upon the operation (add,edit,del ,view etc)
Hope it helps.
Regards,
Amit M.
Message was edited by: Amit Mittal
‎2005 Dec 02 9:08 AM
you should write in sy-ucom of change button.
when 'CHANGE'.
SET PF_STATUS 'STAT' EXCLUDING '<b>SAVE</b>'.
SAVE if Fcode of savebutton.
regards
vijay
‎2005 Dec 02 9:18 AM
mmmmh
in PBO I have:
MODULE PBO OUTPUT.
SET PF-STATUS 'GS_100' EXCLUDING 'SAVE'.
...
this becouse initially I don't wont use SAVE button.
In PAI I have:
CASE save_ok.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK' OR 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'SWITCH'.
PERFORM switch_edit_mode.
WHEN 'SAVE'.
PERFORM save_alv_update.
WHEN OTHERS.
ENDCASE.
Thi is the form:
FORM switch_edit_mode.
IF go_grid->is_ready_for_input( ) EQ 0.
SET PF-STATUS 'GS_100'.
CALL METHOD go_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
ELSE.
SET PF-STATUS 'GS_100' EXCLUDING 'SAVE'.
CALL METHOD go_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
ENDIF.
ENDFORM.
But GUI STATUS not change! SAVE is always EXCLUDE.
‎2005 Dec 02 9:35 AM
hi,
Why dont you simply create another GUI_status..i did many a times such thing, where excluding '****' quite complicated to handle.
you can craete a PF-STATUS 'GUI_200' to inlcude the SAVE buton with all other button.
if ..
SET PF-STATUS 'GS_100'.
ELSE.
SET PF-STATUS 'GS_200'.
ENDIF.
cheers
‎2005 Dec 02 9:52 AM
It don't works! It display always GS_100...where I wrong?
PAI module:
SET PF-STATUS 'GS_100'.
FORM when CHANGE BUTTON is pressed:
if ..
SET PF-STATUS 'GS_100'.
ELSE.
SET PF-STATUS 'GS_200'.
ENDIF.
‎2005 Dec 02 10:11 AM
hi,
that simply means that the control is not going to the 'else ' branch.
just put a break in that else branch..and run the program..and see control is going there at all..you may need to verify the IF condition..i think its remaining true..when its expected to be false.
revrt back, if its not the problem.
‎2005 Dec 02 10:34 AM
Hi Christian,
Actually there is no need to SET PF-STATUS in PAI in WHEN 'SWITCH' code as once it goes to PBO module it will again set PF-STATUS EXCLUDING 'SAVE' all the time.
So you have to change the PBO Module logic as follows,
MODULE PBO OUTPUT.
IF <your condition>.
SET PF-STATUS 'GS_100'.
ELSE.
SET PF-STATUS 'GS_100' EXCLUDING 'SAVE'.
ENDIF.
ENDMODULE.
and then remove the SET PF-STATUS statements from
SWITCH_EDIT_MODE subroutine..
Best way is to set a flag (a global variable) in SWITCH_EDIT_MODE and use it in PBO instead of go_grid->is_ready_for_input..
Some thing like the following,
in your SWITCH_EDIT_MODE routine,
IF gv_edit EQ 'X'.
CLEAR gv_edit.
****other code here to disable grid
ELSE.
gv_edit = 'X'.
****other code here to enable grid
ENDIF.
In your PBO module,
MODULE PBO OUTPUT.
IF gv_edit EQ space.
SET PF-STATUS 'GS_100'.
ELSE.
SET PF-STATUS 'GS_100' EXCLUDING 'SAVE'.
ENDIF.
ENDMODULE.
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni
‎2005 Dec 02 10:36 AM