Step by Step Example on Events in Table Maintenance

Table maintenance is the standard recommended method which allows contents of SAP tables to be accessed or modified. Standard table maintenance views provide basic read/write functionalists to end user. Users could perform table entry modification functions such as INSERT, UPDATE, and DELETE to underline database table data using the table maintenance dialog.

Table maintenance views are generated using table maintenance generator tool provided by SAP which could be accessed using either SE11 or SE54 transactions.

If you required to have custom logic/custom validations in your already created table maintenance, you can use events to implement custom requirements. Events in table maintenance allow developers to access and modify predefined positions in the maintenance dialog which couldn’t be access using user flow logic modules. These event modules are dynamically executed at table maintenance runtime. There are different types of events which executes at different sections of the maintenence PAI and PBO runtime. For example, before saving the data, after saving the data, before deleting, after deleting are few of the event types available.

For the features of table maintenance to work make sure to set “Maintenance allowed” in ‘Table View Maint.’ under “Delivery and Maintenance” tab.

Example requirement: User should only be able to read/write data under company code ‘1000’. You can have your own logic with authorization according to customer requirement.

This requirement can be achieved by implementing a custom read event. Type ‘AA’ event which creates a custom data read routine should be implemented.

First step of the development is to create the standard table maintenance.

Go to transaction SE11 and select Utilities > Table Maintenance Generator from the main menu.

Set parameters function group, authorization group, screen number and transport detail.

Then implement the table maintenance read event.

Then in the change mode of the table maintenance select Events under Environment > Modification menu.

Set the event type as AA and form routine name. AA is the event type to bypass the standard selection routine.

Click on the editor button to implement the form routine under a Z include. Implement the logic to remove the restricted data rows from table ‘Total’.

FORM display_screen_and_read_data.

LOOP AT total.

DATA : ls_TAB TYPE ZFI_TAB.

PERFORM table_get_data.

MOVE <vim_total_struc> TO ls_TAB.

IF ls_TAB-bukrs NE ‘1000’.
DELETE total.
CONTINUE.
ENDIF.

ENDLOOP.

ENDFORM.

SAP, SAP ABAP, Table Maintenance, Events, Table Maintenance Events, SE11, Modifications, Enhancement, Table Maintenance modification, Events in Table Maintenance, Isuru Fernando.

Add a Comment

Your email address will not be published. Required fields are marked *