cancel
Showing results for 
Search instead for 
Did you mean: 

Disable a Button on the Application Tool bar

Former Member
0 Kudos

Can any one let me know how to disable a Button on the application toolbar based on a flag. i.e. If the flag is set the button should be enabled and if the flag is empty then the button should be disabled.

Regards,

Swamy Mantha.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

when you say excluding button, this removes the button completely.

instead, if you want to disable button..

Set pf-status 'ABC' excluding itab.

double click on ABC, goto -> attributes -> push button assignment -> display all.

the buttons whose fcodes are passed to itab gets <b>grayed out (gets inactive)</b>.

depending on your condition, populate itab with the fcodes required.

Regards,

Sailaja.

Reward points, if answer is helpful

pradiptakumar_mishra
Participant
0 Kudos

Dear Sailaja,

Thanks for this info. It really worked. Many many thanks . Though I can't award points as am not the one who put the qt, still in future u'll get my points.

With Rgds

Pradipta

Former Member
0 Kudos

Hi silaja,

The answer given by u really solved my problem. I am awarding u maximum points.

Regards,

Swamy Mantha.

Former Member
0 Kudos

Hi Sailaja

One question. I want to disable a button after v press that button once i.e., total alv grid is displayed.

Should i write <b>set pf-status 'ZINV' EXCLUDING ' TRAN '.</b> in pai.

below is my code .Please chk & help me. i made that to display all as u mentioned earlier.

MODULE pai INPUT.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.

LEAVE TO SCREEN 0.

CALL METHOD g_grid->free.

FREE g_grid.

<b>WHEN 'TRAN'.

PERFORM transfer.

if SAVE_ok = 'TRAN'.

set pf-status 'ZINV' EXCLUDING ' TRAN '.

endif.</b>

WHEN OTHERS.

  • do nothing

ENDCASE.

CLEAR save_ok.

ENDMODULE.

Thanks

Swati

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

U can use this statement

SET PF-STATUS 'STA3' EXCLUDING TAB.

STA3 -


Name of the STATUS.

ITAB -


Will contain the Function-code that corresponds to the Button on the application.

Fill itab with function code that u want to diasble.

Refresh the itab before u append function code based on the condition.

it will be executed in the PBO event.

U can use syntax suggested by akshay.

Regards

Manoj

pradiptakumar_mishra
Participant
0 Kudos

Dear Manoj

Thnx for the reply.

This piece of code will simply hide the function buttons from the status bar.I want them to be in-active not invisible.

Hope you are getting wht am suggesting at.

With Rgds

Pradipta

pradiptakumar_mishra
Participant
0 Kudos

Hi all

Using the Excluding addition with set pf-status will simply hide the function button.I don't think it'll simple make the function buttons as in-active.

I have been trying for the same also.I tried using looping through screen . but it also don't serve the purpose.

So if anyone has some other ideas pls lemme know.

thnx in advance

With Regds

Pradipta

Former Member
0 Kudos

Hi,

Refer this thread:

Regards,

Gayathri

Former Member
0 Kudos

Hi,

Check following example for your requirement:

TYPES: BEGIN OF TAB_TYPE,

FCODE LIKE RSMPE-FUNC,

END OF TAB_TYPE.

DATA: TAB TYPE STANDARD TABLE OF TAB_TYPE WITH

NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,

WA_TAB TYPE TAB_TYPE.

CLEAR TAB.

MOVE 'DELE' TO WA_TAB-FCODE.

APPEND WA_TAB TO TAB.

MOVE 'AUSW' TO WA_TAB-FCODE.

APPEND WA_TAB TO TAB.

SET PF-STATUS 'STA3' EXCLUDING TAB.

Regds,

Akshay

Note:Pls mark helpful answers.

former_member181962
Active Contributor
0 Kudos

Usage:

DATA fcode TYPE TABLE OF sy-ucomm.

...

MODULE status_0100 OUTPUT.

APPEND 'CHANGE' TO fcode.

APPEND 'SAVE' TO fcode.

SET PF-STATUS 'STATUS_0100' EXCLUDING fcode.

ENDMODULE.

Regards,

Ravi

Former Member
0 Kudos

hi,

Use this

<b> SET PF-STATUS 'STA3' EXCLUDING TAB1</b>

Regards,

Santosh

Former Member
0 Kudos

Use the SET PF-STATUS with the EXCLUDINg option.

Regards,

Ravi