10-22-2010 8:09 PM
Hello,
I made some researchs and asked some colleagues but I have a problem. I would like to disable a gui status button (to grey it out),
I used this:
SET PF-STATUS 'STATUS_0200' EXCLUDING lt_fcode.
adding the name of my button but the only thing it does is making it disappeared (It is a toggle button between modify and display).
Is there any suggestions to just grey out the button and not removing it?
Thank you!
10-22-2010 8:59 PM
10-25-2010 12:55 PM
Nabheet: I want the toggle button to be disabled on the screen.
anurodh_t: I want to disable it on specific occasions because I am giving access, by authority check, to some people only to use it. The reason why I want to keep the button shown is because I want people to know that, yes, it is indeed possible to modify the fields in my screen but no, they can't do it because they don't have access. Making it disappear would only show, to my opinion, that the possibility might not even exist. Though, someone with the access will have that same button enabled, of course. That is why I want it grey out when not having access. To answer your second questions, I unfortunately haven't seen it yet. Though, I thought it was because of my young experience in SAP (I started at beginning of september).
Thank you for giving me some feedback and I'm sorry if my explanation wasn't clear enough. If I forgot to give important details, please, let me know. Like I said, I am still young on SAP so sometimes, I am not always sure what is important to know or not
Take care!
10-25-2010 12:58 PM
In that case: prevent processing of the okcode in your PAI module if a user isn't allowed to use a button and issue an S-message like 'Not authorised'.
10-23-2010 12:26 PM
Though it is a taoggle button why u want to make it disable it...
i think it is not poss since i havent seen this any any standard status also....
hav u seen like this in any standart status so we can chk for that....
10-25-2010 1:15 PM
I would like to disable a gui status button (to grey it out),
In menu painter choose Goto -> Attributes -> Pushbutton assignment and select Display all . Now once you exlcude specific function it will stay on toolbar greyed out.
Regards
Marcin
09-23-2012 7:11 AM
Yes. This is the right answer if it is a screen Pf-status rather than a report selection screen Pf-status.
10-25-2010 1:17 PM
Hi, try out this code. for specific user, it shows the refresh button, for others it shows disabled. choose icons of your choice from table 'ICON'.
TABLES: SSCRFIELDS.
DATA: ICON_REF(30).
SELECTION-SCREEN BEGIN OF BLOCK B1.
PARAMETERS: P_TEST(10) DEFAULT '246198'.
SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN END OF BLOCK B1.
INITIALIZATION.
IF P_TEST EQ '246198'. " PUT THE AUTHORISED USER ID HERE, OR CHECK AUTHORIZATION
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = 'ICON_REFRESH'
IMPORTING
RESULT = ICON_REF.
MOVE ICON_REF TO SSCRFIELDS-FUNCTXT_01.
ELSE.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = 'ICON_DUMMY'
IMPORTING
RESULT = ICON_REF.
MOVE ICON_REF TO SSCRFIELDS-FUNCTXT_01.
ENDIF.
Regards,
Sumit
10-25-2010 1:19 PM
Goto your pf status. Choose menu goto->attributes->Push button assignment->Display all.
Now use your same syntax SET PF-STATUS 'STATUS_0200' EXCLUDING lt_fcode. It will disable the buttons.
04-25-2014 9:53 AM
If you want to deactivate button altogether, you can go from SE80/Program/GUI Status/Application Toolbar. Go to Change mode, select button and then Extras/Function Active<->Inactive. When deactivated, code will show in red color and button will not appear on the toolbar.