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: 

is it possible to hide button in program copy vf04 ?

former_member635273
Participant
0 Kudos

I made a copy program from vf04, it's name zfv04. I want to hide the button (individual billing doc, collective billing doc, collective billing doc/online) for my program. but I did not find where the button is located in the program and how to hide them.

12 REPLIES 12

VeselinaPeykova
Active Contributor

Where did you look for the buttons?

You can find them in the GUI status VKDFS_ALV (just like the other buttons on the screen).

And just hiding these 3 buttons won't be enough, you have also menu functions from where you can trigger these, and some clever users are aware of fcodes 🙂

If you are supposed to provide a display-only list of documents due for billing it may be better to make use of authorizations.

DominikTylczyn
Active Contributor

The buttons are defined with

SET PF-STATUS

statement.

In case of VF04 transaction the status is set in VKDFS_PF_STATUS_SET routine in LV60PU06 include:

FORM vkdfs_pf_status_set
       USING
         rt_extab TYPE slis_t_extab.

  DATA : lt_extab TYPE slis_t_extab.
  DATA : BEGIN OF exctab OCCURS 1,
           okcod(4) TYPE c,
         END   OF exctab.

  REFRESH exctab.
  APPEND '&XPA' TO exctab.
  APPEND '&OMP' TO exctab.

  APPEND LINES OF exctab   TO lt_extab.
  APPEND LINES OF rt_extab TO lt_extab.

  SET PF-STATUS 'VKDFS_ALV' EXCLUDING lt_extab.

ENDFORM.                    "VKDFS_PF_STATUS_SET

Just add SAMQ, SAMD, SAMH function to lt_extab and the buttons will be gone.

Dominik Tylczynski

FredericGirod
Active Contributor

Just to add to the two good answers behind.

Next time, start debugging in the ALV display, go in the call stack (Standard TAB), find the ALV caller

you will have the CallBack_Program & THe PF_Status_set this will contains the program & the form used to manage the button of the toolbar

DominikTylczyn
Active Contributor

Another good method to find the right spot is to go to debugger mode right at the selection screen and put break-points on all SET PF-STATUS statements (debugger menu path: Breakpoints-> Breakpoint at -> Breakpoint at Statement - then enter SET PF-STATUS in the pop up window). After that just run the report. The execution will stop where the status is set.

Dominik Tylczynski

matt
Active Contributor

Cloning a standard SAP program is always a bad idea. In many companies it is totally banned. It is worse than modifying SAP standard. Find another solution to whatever business problem you think you are solving.

FredericGirod
Active Contributor
0 Kudos

The dogma behind this, change so much time.

Sometime it is better to copy and use CloneFinder during upgrade, sometime it is better to modify standard and use SPAU during upgrade.

I am little bit lost today about that.

Sandra_Rossi
Active Contributor

I agree with Matthew. It's completely wrong to copy standard programs. It has been discussed a lot already.

The only cases I copy SAP code is because the code is very short, is very simple to understand and if it's a time saving (copy instead of coding from scratch). Otherwise I do a modification of the standard (with a registration key).

Thank you SPAU.

FredericGirod
Active Contributor
0 Kudos

we create a coffee corner inside a thread, but ...

I have a counterexample, print program. It is a best practice to copy it, keep all the standard include, add your specific include ...

matt
Active Contributor
0 Kudos

But print programs are specifically designed to be copied. As is the sample generic extractor function module. I invoke the officious bystander legal principle. Of course we're excluding those.

0 Kudos

you r right. actually this program(copy program) was made by Abaper before me. but because there was an error, so I was asked to solve it.

btw i m beginner, so i often ask. thnks

Sandra_Rossi
Active Contributor
0 Kudos

3a9e4ce873a94034b33dc62b0ce600ee It's worth converting your comment into an answer.

DominikTylczyn
Active Contributor
0 Kudos

sandra.rossi done, thank you