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: 

Add custom button to application toolbar of VA01/VA02

Former Member
0 Kudos
4,505

Hi guys,

Is there a way to add a custom button to the application toolbar (pf-status) of the standard SAP screen VA01/VA02?

I would like to do this without directly modifying the standard program SAPMV45A or SAPMV45B. Any exits or solutions that can be done to implement this?

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
966

I solved this using a reference to this post:

http://scn.sap.com/thread/1668540

Basically, these are the steps:

1. create a dummy program and copy the pf-status 'U' from SAPMV45B

2. create an implicit enhancement in include program MV45AF0C_CUA_SETZEN at the bottom of form CUA_SETZEN.

3. set the pf-status of the dummy program to overwrite the original pf-status set by the standard program code.


Hope this can be of help to others.

6 REPLIES 6

Former Member
0 Kudos
966

Think about what you have asked...if you are able to add a button (or at least an entry in the drop down menus, which might be easier), what happens if the user presses the button?   You have to have code somewhere to detect that user command and act upon it!  And since the button would be inside the VAxx processing programs, you'd have to have code somewhere.

0 Kudos
966

Yes i am fully aware of that. I only need to know if there's a way to add a custom button in the toolbar or in the dropdown menus without directly modifying any of the standard programs.

Any help is appreciated. Anyone?

Former Member
0 Kudos
967

I solved this using a reference to this post:

http://scn.sap.com/thread/1668540

Basically, these are the steps:

1. create a dummy program and copy the pf-status 'U' from SAPMV45B

2. create an implicit enhancement in include program MV45AF0C_CUA_SETZEN at the bottom of form CUA_SETZEN.

3. set the pf-status of the dummy program to overwrite the original pf-status set by the standard program code.


Hope this can be of help to others.

0 Kudos
966

Thank you very much Jason. It was very helpfull to me. I had followed your steps and succed adding a Print button.
Thanks!

0 Kudos
966

Hi Maria,

After read all I also want to try this, but a bit confused where should I write code for user command of newly added PF Status.

Hope You guide my in this regard.

0 Kudos
966

Hi Swadhin.

I followed Jason's steps, but with the help of the steps that are in the link mentioned by Jason as well.
Anyway, I leave you here a resume of both posts:

1) Create a Z program. (Z_NEW_STATUS for example),


2) Copy the standard status gui with the transaction SE41. (In my case I had to copy the status 'U' from SAPMV45B into a new one, that I named 'ZU').


3) Change those statuses however u want (create new function code for the new button)


4) Create enhancement option IN THE END of CUA_SETZEN form in MV45AF0C_CUA_SETZEN Include with code like this:
IF modul-pool EQ 'SAPMV45B'.

     IF t185v-status EQ 'U'.
          SET PF-STATUS 'ZU' EXCLUDING cua_exclude OF PROGRAM 'z_new_status'.

     ENDIF.

ENDIF.

5)You will have to handle this function code at THE BEGIN of form FCODE_BEARBEITEN of MV45AF0F_FCODE_BEARBEITEN include. So here is where your user command will be.
In my case, i had ti put something like this:
IF fcode EQ 'PRINT' (I added a button to print some forms).

     CALL SCREEN '9001'.  (I had to call a new screen because the user must choose which form he wants to print)

ENDIF.

After doing all this, I succed showing the new button, and calling the new screen. But after returning back to VA02, an Error message is displaying:

Error is : 'Requested function PRINT is not available here'.


I wass looking for a solution to this, and I found that I will have to maintained my new button on T185V, but I don't know how yet.

I hope I had helped you a bit.

.