How to Disable Delete Icon in SAP Table Maintenance Generator?

To disable icons in SAP table maintenance generator, first go to Table Maintenance Dialog Generator (SE56).

TMG-disable-delete-icon-1

Enter the Table/View name for which you want to regenerate the TMG and click on Display button.

TMG-disable-delete-icon-2

Double click on the screen number (i.e. 1 in this case) on which you want to disable the delete icon to navigate to screen painter.

TMG-disable-delete-icon-3

Click on change icon and add a module (MODULE disable_icons). Double click on the MODULE disable_icons to add code.

TMG-disable-delete-icon-4

Click on Yes button to create the disable_icons module.

TMG-disable-delete-icon-5

Select LZEMPL001 and press continue to create a new include. The disable_icons module will be created inside this new (LZEMPL001) include.

TMG-disable-delete-icon-6

Press continue button. This is just a warning,

TMG-disable-delete-icon-7

Press Yes button to save the current program since we have added the disable_icons module in the screen painter flow logic and not yet saved.

TMG-disable-delete-icon-8

In disable_icons module inside LZEMPL001 include add the above code. Just fill the exclude function table with function codes of icons that you want to disable. Activate the include  program.

TMG-disable-delete-icon-9

Select all the related objects and press continue to activate all the objects.

Now to test it, go to Maintain Table Views (SM30).

TMG-disable-delete-icon-10

Enter Table/View name and press Maintain button. Observe the DELETE icon is disabled after making the above changes.

TMG-disable-delete-icon-11

Note: If you regenerate the table maintenance generator, then all the above changes will be lost. To avoid this we have another method to disable delete icon in table maintenance generator.

To disable the icons in the application toolbar of SAP table maintenance generator, use the following steps.

  • Just create a report program and use the function module “VIEW_MAINTENANCE_CALL” to maintain the view.
  • Fill the excluding table with function codes of icons that you want to disable.

*---------------------------------------------------------------------* * Data Declaration *---------------------------------------------------------------------* DATA: gt_excl TYPE TABLE OF vimexclfun, gwa_excl TYPE vimexclfun. *---------------------------------------------------------------------* * START-OF-SELECTION *---------------------------------------------------------------------* START-OF-SELECTION.

 " Fill the function codes in exclude table that you want to disable gwa_excl-function = 'DELE'. " Function code for delete icon APPEND gwa_excl TO gt_excl. CALL FUNCTION 'VIEW_MAINTENANCE_CALL' EXPORTING action = 'U' view_name = 'ZEMPL' TABLES excl_cua_funct = gt_excl EXCEPTIONS client_reference = 1 foreign_lock = 2 invalid_action = 3 no_clientindependent_auth = 4 no_database_function = 5 no_editor_function = 6 no_show_auth = 7 no_tvdir_entry = 8 no_upd_auth = 9 only_show_allowed = 10 system_failure = 11 unknown_field_in_dba_sellist = 12 view_not_found = 13 maintenance_prohibited = 14 OTHERS = 15. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF.


2 Comments

  1. client_reference = 1
    foreign_lock = 2
    invalid_action = 3
    no_clientindependent_auth = 4
    no_database_function = 5
    no_editor_function = 6
    no_show_auth = 7
    no_tvdir_entry = 8
    no_upd_auth = 9
    only_show_allowed = 10
    system_failure = 11
    unknown_field_in_dba_sellist = 12
    view_not_found = 13
    maintenance_prohibited = 14
    OTHERS = 15.
    IF sy-subrc 0.

Leave a Reply

Your email address will not be published.


*