11-23-2005 3:30 PM
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.
11-23-2005 3:35 PM
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
11-23-2005 3:35 PM
11-23-2005 3:40 PM
11-23-2005 4:14 PM
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
11-23-2005 3:42 PM
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
11-23-2005 3:47 PM
By Srinivas code,it will remove the icon from the PF-status.It will not grey out.
11-23-2005 3:55 PM
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
11-23-2005 3:56 PM
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
11-23-2005 4:01 PM
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
11-23-2005 4:06 PM
11-23-2005 4:06 PM
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
11-23-2005 4:10 PM
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
11-23-2005 4:13 PM