2020 Feb 25 8:37 AM
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.
2020 Feb 25 8:48 AM
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.
2020 Feb 25 8:50 AM
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
2020 Feb 25 8:53 AM
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
2020 Feb 25 9:01 AM
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
2020 Feb 25 9:19 AM
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.
2020 Feb 25 9:25 AM
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.
2020 Feb 25 10:13 AM
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.
2020 Feb 25 10:15 AM
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 ...
2020 Feb 25 10:26 AM
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.
2020 Feb 25 11:13 AM
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
2020 Feb 25 12:15 PM
3a9e4ce873a94034b33dc62b0ce600ee It's worth converting your comment into an answer.
2020 Feb 25 12:17 PM