2009 Apr 10 8:25 AM
Hello all,
How to disable delete button in Table maintainance generator???
2009 Apr 12 1:09 AM
if you got solution for this thread close it.
Edited by: peranandam chinnathambi on Apr 12, 2009 2:09 AM
2009 Apr 10 9:25 AM
Hi Maya,
1. Go to System->Status from the screen where you can see the delete button in SM30.
2. Double click on the screen, and go to CHANGE mode.
3. Add in your module and code something like
SET PF-STATUS <the GUI status> EXCLUDING 'DELE'.
Just be aware that every time you regenerate your maintenance screen, it will over write this change.
Regards,
Lim...
2009 Apr 10 12:22 PM
Hi Maya,
It is very interesting question. If you debug your table maintenance screen, the program of table maintenance screen will not have statically defined pf status. So you cannot exclude delete functionalities using the below statement.
SET PF-STATUS <the GUI status> EXCLUDING 'DELE'.
For viewing pf status SAP has programmed in dynamic manner using this FM VIEW_SET_PF_STATUS.
Before calling above FM you need to exclude delete function. Follow the following step for achieving this
Go to sm30. Put your table name and press on maintain push button. It will display table entries in maintenance screen.
Go to system->status
Click on program name.
Go to your flow logic of you table maintenance screen number.
It will have following code in flow logic
PROCESS BEFORE OUTPUT.
MODULE LISTE_INITIALISIEREN.
LOOP AT EXTRACT WITH CONTROL
TCTRL_ZMAINTAIN CURSOR NEXTLINE.
MODULE LISTE_SHOW_LISTE.
ENDLOOP.
*
PROCESS AFTER INPUT.
MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
MODULE LISTE_BEFORE_LOOP.
LOOP AT EXTRACT.
MODULE LISTE_INIT_WORKAREA.
CHAIN.
FIELD ZMAINTAIN-MATNR .
FIELD ZMAINTAIN-KUNNR .
FIELD ZMAINTAIN-LIFNR .
MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
ENDCHAIN.
FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
CHAIN.
FIELD ZMAINTAIN-MATNR .
MODULE LISTE_UPDATE_LISTE.
ENDCHAIN.
ENDLOOP.
MODULE LISTE_AFTER_LOOP.
Add new module in PBO for excluding delete function. ex module set_pf.
PROCESS BEFORE OUTPUT.
****here I added my own code for excluding delete function
****begin of addion
module set_pf.
****end of addition
MODULE LISTE_INITIALISIEREN.
LOOP AT EXTRACT WITH CONTROL
TCTRL_ZMAINTAIN CURSOR NEXTLINE.
MODULE LISTE_SHOW_LISTE.
ENDLOOP.
*
PROCESS AFTER INPUT.
MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
MODULE LISTE_BEFORE_LOOP.
LOOP AT EXTRACT.
MODULE LISTE_INIT_WORKAREA.
CHAIN.
FIELD ZMAINTAIN-MATNR .
FIELD ZMAINTAIN-KUNNR .
FIELD ZMAINTAIN-LIFNR .
MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
ENDCHAIN.
FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
CHAIN.
FIELD ZMAINTAIN-MATNR .
MODULE LISTE_UPDATE_LISTE.
ENDCHAIN.
ENDLOOP.
MODULE LISTE_AFTER_LOOP.
*****inclule one line of code for excluding delete fucion
module set_pf output.
MOVE 'DELE' TO excl_cua_funct-function. COLLECT excl_cua_funct.
endmodule.
Basically sap fetching status dynamically from program SAPLSVIM using FM VIEW_SET_PF_STATUS. Status name is EULG.
Please donu2019t hardcode anything by using set pf status statment, you just add one line of code the PBO by creating new module.
Let me know if you need any help .
Cheers.
Regards,
Peranandam
2013 Sep 25 10:36 PM
2009 Apr 12 1:09 AM
if you got solution for this thread close it.
Edited by: peranandam chinnathambi on Apr 12, 2009 2:09 AM
2009 Apr 14 11:11 AM
Peranandam,
Sorry for the late reply...
and thank u very much for the solution...
2016 Feb 02 4:29 PM
Hi,
Although this thread is stone-old:
Ther is a much better and easier way. Use
Extended Table Maintenance Events
Events allow you to change the generated table maintenance dialog at predefined positions, which cannot be reached by user modules in the screen flow logic.
Use event Event 19 after initializing global variables, field symbols, etc.
Here you can append whatever you want to remove from the PF status to globalized table excl_cua_funct, i.e.
FORM z19_after_init.
* Es bleibt immer bei einer zu pflegenden Zeite
APPEND:
'NEWL' TO excl_cua_funct,
'DELE' TO excl_cua_funct.
ENDFORM. " z19_after_init.
Create the Form when changing the view maintenance, environment -> events.
Regards Clemens
2016 Jun 01 11:57 AM
Hi Clemens,
Thanks for your post! That helped me solve a similar issue in TMG.
Thanks,
Priya