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: 

Greying out Icons in pf-Status

Former Member
0 Kudos

Hi,

at run time I wan to disable ( Gray them out ) and enable Icons from my application toolbar in a Pf-status.

Basically , the screen displays a number of records, and when they get to the last record, I want the icon I have created to move to the last record , grayed out, and the same for the first record.

13 REPLIES 13

Former Member
0 Kudos

You will have to basically set your pf-status with the option EXCLUDING fcodes, where fcodes can be just one fcode of your pushbuttons on the menu, or it can be an internal table of several fcodes, if you are disabling them. This will disable them and to re-enable them you just have to set pf-status without the option EXCLUDING.


IF <mycondition>
  SET PF-STATUS <mystatus> EXCLUDING 'ABCD'.
*-- or SET PF-STATUS <mystatus> EXCLUDING fcodes_itab ]
*   where fcodes_itab has more than one fcodes
ELSE.
  SET PF-STATUS <mystatus>.
ENDIF.

Regards,

Srinivas

0 Kudos

This you need to do in your PBO.

0 Kudos

Will this not remove it completely, instead of greying it out?

0 Kudos

Here are the steps.

1. Go to your menu in change mode and set the attribute as mentioned by Rich either for all the inactive buttons or just a few.

2. In your PBO, use the logic I gave you before, pasted below again.


IF <mycondition>
  SET PF-STATUS <mystatus> EXCLUDING 'ABCD'.
*-- or SET PF-STATUS <mystatus> EXCLUDING fcodes_itab ]
*   where fcodes_itab has more than one fcodes
ELSE.
  SET PF-STATUS <mystatus>.
ENDIF.

Please close the post if answered.

Srinivas

abdul_hakim
Active Contributor
0 Kudos

Hi

You store the function codes of the buttons you don't need in an itab.

In the PBO

Based on your condition use.

SET PF-STATUS 'STAT' EXCLUDING ITAB.

Regards,

Abdul

Former Member
0 Kudos

By Srinivas code,it will remove the icon from the PF-status.It will not grey out.

0 Kudos

In order to grey-out instead of removing altogether, you still need to do ....

SET PF-STATUS '0100' EXCLUDING....

Also you need to change a setting in the gui status.

Go into your gui status by double clicking on the status name, click Go To --> Attributes --> PushButton Assignment. You will get a dialog box, select the radiobutton for "Display All". Save and activate. Now instead of the buttons being removed, they will be greyed out.

This should solved your problem. Please don't forget to award points and close your post.

Thanks.

Regards,

Rich HEilman

0 Kudos

Hi Phani,

Is there any command that will just grey out a button on the application toolbar, instead of removing it? If it is a button on your screen, then you can do it, but if it is on the application toolbar, what command greys them out?

Srinivas

0 Kudos

Actually, in Rich's suggestion (which by the way is excellent), if you just want your pushbutton to be greyed out, then you select the radiobutton "Function Selection" and by pressing the "Functions" button you can specify which functions you want greyed out. That way you will avoid showing all the inactive buttons as greyed out.

Srinivas

0 Kudos

How do I do this at run time?

0 Kudos

Hi,

The PF-STATUS / EXCLUDING should grey out the icons. It greys out the Menu options also.

If you want a full-fledged example for you case of last/first record navigation, check out the SAP program for Custome Master Display. It does this for the tabstrips:

Program MF02DFT0, form tabstrip_blaetter_tasten.

The F Code 'VW' is for next recors, 'RW' is for previous. It has the EXCLUDING logic. The PF-Status is 700A and is displayed via form SET_PF_STATUS in SAPMF02D.

Good luck,

Bhanu

0 Kudos

The attributes, you have to set them up during the creation of your menu. What that setting does is, if there is a menu function that you inactivate either in runtime or during definition, it will be greyed out.

But inactivating a function code during runtime, you still have to follow my first option using the EXCLUDING option.

Srinivas

0 Kudos

Like I said, you still have to use the EXCLUDING extension, setting the attributes only changes how the buttons are inactivated(removed, greyed out)

Regards,

Rich Heilman