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: 

How to determine whether Save button disabled

Former Member
0 Kudos

Hello,

I need to know whether some user added fields should be disabled or not depending on whether the current transaction only allows the user to look at the data or not. At the moment I check the sy-tcode whether it contains any of the transactions of which I know that they are for data display only. This is not very satisfactory as the code will break when a new transaction is created that serves for data display only.

So I would like to check whether the Save button in the horizontal button bar (left to the three buttons for Back, Finish, Cancel) is disabled or not. Does anybody know how to do this?

Thanks, Oliver Plohmann

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Disabling and enabling are the functionalities that we can set in pf-status.

if you set ok-code for save it will display else it will not.

u can do this dynamically using this

SET PF-STATUS '1000' EXCLUDING itab.

in the itab u have set the ok-codes which are to be diaplayed,.

regds

gv

5 REPLIES 5

Former Member
0 Kudos

Disabling and enabling are the functionalities that we can set in pf-status.

if you set ok-code for save it will display else it will not.

u can do this dynamically using this

SET PF-STATUS '1000' EXCLUDING itab.

in the itab u have set the ok-codes which are to be diaplayed,.

regds

gv

0 Kudos

Hello,

thanks for the answer. What I precisely want to do is to query whether the save button is disabled or not. I don't want to change its state but figure out in what state it is in. I can't get hold of its status using LOOP AT SCREEN. Do you know how to query its state?

Thanks for any answer.

Regards, Oliver Plohmann

0 Kudos

You can use the command GET PF-STATUS with addiction EXCLUDING ITAB.

It should return the name of status and (in ITAB) the functions that are inactives

0 Kudos

Hi,

thanks for the answer. What I get with GET PF-STATUS is the current status, which turned out to be GLOBAL. And that doesn't tell me much. I need the specific function code of the save button. I think I will have to dive into SAP's own includes to figure out how they are doing this.

Regarsd, Oliver

Former Member
0 Kudos

Perhaps you can find a table with the pf-status and the matching configuration of this status? Then you would be able to check it.