Application Development and Automation 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: 
Read only

Disable delete button in Table Maintainance Generator

Former Member
0 Likes
6,244

Hello all,

How to disable delete button in Table maintainance generator???

1 ACCEPTED SOLUTION
Read only

Peranandam
Contributor
0 Likes
3,412

if you got solution for this thread close it.

Edited by: peranandam chinnathambi on Apr 12, 2009 2:09 AM

7 REPLIES 7
Read only

Former Member
0 Likes
3,412

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...

Read only

Peranandam
Contributor
0 Likes
3,412

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

Read only

0 Likes
3,412

Thank you so much, it was exactly what I needed.

Regards

Read only

Peranandam
Contributor
0 Likes
3,413

if you got solution for this thread close it.

Edited by: peranandam chinnathambi on Apr 12, 2009 2:09 AM

Read only

0 Likes
3,412

Peranandam,

Sorry for the late reply...

and thank u very much for the solution...

Read only

Clemenss
Active Contributor
0 Likes
3,412

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

Read only

Former Member
0 Likes
3,412

Hi Clemens,

Thanks for your post! That helped me solve a similar issue in TMG.

Thanks,

Priya