Table maintenance event

How to create event at table maintenance.

Scenario

My scenario was user wants to default a date to today’s date in the table maintenance.

Prerequisites 

1. Table created and activated
2. Table maintenance created and saved

Image

1. First enter se11 to your table in change mode.

Image

2. Secondly enter environment->modification->events

bitcoin4

3. Click on ‘New Entries’

Image

4. Select one of the event provided. For this example, i choose 05, creating a new entry. A common scenario is to default the date as today’s date when inserting a data into the table.

This will create an include and inside that include you may perform your logic inside a function call.
Take note that your function routine has to be the same name as specify in the screen below.

Image

An example would be like this.

*———————————————————————-*
***INCLUDE LZALEX_DUMMYF01 .
*———————————————————————-*

form create_entry.
ZALEX_DUMMY-DATE1 = sy-datum.
endform.

5. Save all objects. That’s it your done. So whenever you add a new entry, a default value which is today’s date will be auto inserted into the entry.