Application Development 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: 

Disabling Gui status buttons

Former Member
0 Kudos

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!

9 REPLIES 9

nabheetscn
Active Contributor
0 Kudos

You are doing it in a report or screen..?

Nabheet

0 Kudos

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!

0 Kudos

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'.

Former Member
0 Kudos

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....

MarcinPciak
Active Contributor

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

0 Kudos

Yes. This is the right answer if it is a screen Pf-status rather than a report selection screen Pf-status.

Former Member
0 Kudos

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

kesavadas_thekkillath
Active Contributor
0 Kudos

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.

former_member183994
Active Participant
0 Kudos

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.