Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Disable push button Gui Status

Former Member
0 Likes
2,723

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,108

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

8 REPLIES 8
Read only

Former Member
0 Likes
1,108

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

Read only

Former Member
0 Likes
1,109

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

Read only

0 Likes
1,108

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.

Read only

0 Likes
1,108

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

Read only

0 Likes
1,108

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.

Read only

0 Likes
1,108

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.

Read only

0 Likes
1,108

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

Read only

0 Likes
1,108

Debugging said me that enter in the ELSE statment..