Professional Documents
Culture Documents
its Modifications
Applies to:
SAP ECC (6.0). For more information, visit the ABAP homepage.
Summary
This article contains the procedure of implementation of table maintenance generator for custom tables and
also explains some modifications available in the table maintenance generator
Author Bio
Nimisha Agarwal is working with Infosys Technolofies Limited from last 1.5 years. She has got
experience in various projects in SAP ABAP.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 1
Table Maintenance Generator and its Modifications
Table of Contents
Introduction ......................................................................................................................................................... 3
Reasons to use Table Maintenance Generator .............................................................................................. 3
Prerequisite to Create Table Maintenance Generator for a Custom Table .................................................... 3
Creation of Table Maintenance Generator for a Custom Table ......................................................................... 4
Maintaining the Table Through SM30 ................................................................................................................ 8
Modifications in Table Maintenance Generator .................................................................................................. 9
Maintenance Screens: .................................................................................................................................... 9
Events ........................................................................................................................................................... 13
Difference Between Event ‘05’ and ‘21’ ..................................................................................................................... 24
Disclaimer and Liability Notice .......................................................................................................................... 25
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 2
Table Maintenance Generator and its Modifications
Introduction
Table Maintenance Generator (TMG) is a tool which is used to create equipment by which customized
tables created by end users can be changed as required, such as making an entry to that table, deleting an
entry, modifying an existing entry etc.
Table Maintenance generator can be created using transaction SE54 or SE11.
A table maintenance generator is used to create table maintenance program to add, modify or delete
records in the database tables. It is generated to maintain customizing data with these maintenance dialogs.
We can check the table maintenance dialog in SM30 or SE16. In SM30, We have display and maintain
options. Display option is used to view the table contents and maintain option is used to maintain the entries
in the table.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 3
Table Maintenance Generator and its Modifications
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 4
Table Maintenance Generator and its Modifications
3. The following screen would appear to implement the table maintenance generator.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 5
Table Maintenance Generator and its Modifications
The following are the options available in the screen. These options are filled according to the given
description.
Table/View: the name of the table or view for which table maintenance generator has to be implemented.
Authorization Group: Authorization group is used to apply authorization checks to a particular group of
people i.e. to specify the users who are authorized to maintain table or view contents. If in case, a table has
to be maintained by a group of people, an authorization group is assigned else fill the option ‘&NC&’.
Authorization groups for a table/ view can be created using transaction SE54.
Authorization Object: Authorization objects can be created using transaction SU21. An authorization object
can have upto10 authorization fields which are used to verify user authorizations. A user has to pass the
check for every field to run the authorization check successfully. In this case it is auto generated which is
S_TABU_DIS have following fields:
DICBERCLS - Authorization group, maximum field length is four characters.
ACTVT - Activity (02: Add, change or delete table entries, 03: Only display table contents).
S_TABU_DIS is used for displaying and maintaining tables. It controls the access during following
transactions:
SM31: Standard maintenance tool
SM30: Enhanced table maintenance
SE16: Data browser, including access in customizing
Function group: The function group is the one in which all the maintenance modules of the given table or
view are generated. All the generated maintenance modules will belong to this function group. Function
group names can have maximum of 26 alphanumeric characters.
A function group can also be created in transaction SE80.
Here, the name of the function group can be same as that of table/ view.
Package: Package here refers to the function group package which is assigned to the table or view. A
package can be created in transaction SE21 or SPACKAGE.
Two step dialog: Two step dialogs have one additional maintenance screen (single screen)
along with overview screen. Here, the overview screen contains only the key fields and texts
longer than 20 characters and single screen contains all fields. Single screen can be called
from overview screen by function key, for every entry.
It works as follows:
Go to SM30; give the table name for which table maintenance generator is
implemented. Overview screen would be displayed. To create entries, click on ‘New
Entries’. Now, next screen (single screen) would be displayed, enter the values and save.
You can enter one record at a time.
Maintenance Screen No.: Maintenance screen numbers are the internal number for each maintenance
screen. It has two different cases:
One step dialog: In this case, only overview screen value is required. It can have any screen
number except 1000 because 1000 is assigned to the selection screen.
Two step dialog: In this case, both the screen numbers are required i.e. one has to give the
screen number for both overview screen and single screen.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 6
Table Maintenance Generator and its Modifications
Recording Routine: It gives the option which recording routine should be used to record the changes to
table contents. It can be done automatically and manually.
There are two types of recording routines:
Standard routines: More functionality can be added to the standard routines using individual
routines. We can create individual routines via menu function Environment Modification Events.
It concerns the events 10, 11 and 12.
No, or user, recording routine: In this case, it’s up to the users choice whether he wants the
recording or not.
Compare Flag: This flag indicates whether the maintenance transaction allows the (checked) activation of
Business Configuration Sets (BC Sets), and the adjustment. This is the case if the maintenance transaction
can run in the background.
The following settings are available for the flag:
No Information
Not adjustable
Adjustments in Dialog
Automatically Adjustable
All the fields are filled according to the above mentioned description. Then click on ‘Create’.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 7
Table Maintenance Generator and its Modifications
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 8
Table Maintenance Generator and its Modifications
User Interface: A dialog specific interface can be created using user Interface which can be changed
with Menu Painter. The maintenance dialogs access the standard table/view maintenance interface
in the function group SVIM. One can define a function group interface by choosing interface to copy
and change the original interface. The message ‘User Interface exists’ in the ‘Maintain Interface
assignment’ dialog indicates whether an interface already exists in the current function group.
Events: Much functionality can add to the table maintenance though the addition of events.
Maintenance events are used, when certain logic is to be added in the already generated table
maintenance. They are called when certain events are triggered, when user maintains the table
through SM30.
Source Code: It displays the function group main program and maintenance dialog top include and
also the user defined includes in the ABAP editor.
Maintenance Screens:
Maintenance screens can be modified so as to enable or disable any of the fields during table maintenance.
It means that any of the fields can be made editable or non-editable based on the requirement through
modification of maintenance screens.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 9
Table Maintenance Generator and its Modifications
2. Click on ‘Element List’ in the screen which appears. The following screen would appear thereafter.
3. A field can be made disabled by clicking the checkbox of the Input option of that particular field i.e.
uncheck the checkbox of the respective field. In this case, we would disable the username field as
below.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 10
Table Maintenance Generator and its Modifications
4. The maintenance screen would now appear as follows in transaction SM30. In this ‘User name’ is
now disabled.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 11
Table Maintenance Generator and its Modifications
5. The layout of the appearing screen can also be modified through the screen painter. Here, we can
also modify the screen name of a field by changing its parameters.
It can be achieved via Environment Modifications Maintenance Screens Layout.
The following screen appears:
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 12
Table Maintenance Generator and its Modifications
Events
Table maintenance generator is used for handling events. Once table maintenance is implemented for a
table, events can be handled. There is a list of predefined list of events in SAP. These events can be
implemented using the table maintenance.
Events are used to add custom checks for table maintenance screen generated using the table maintenance
generator in SE11. Many validations, checks and functionalities can be performed while maintaining the
table entries.
These events are triggered when a table/view is maintained through transaction SE16 or SM30. The action
to be performed by these events can be defined by writing the FORM routine in the ‘Includes’ generated by
function group.
2. The following screen appears. Click on ‘New Entries’ to add events to the table.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 13
Table Maintenance Generator and its Modifications
3. In the next screen, click on F4 help and the following screen of events would appear.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 14
Table Maintenance Generator and its Modifications
Let us add first event i.e. before deleting the data displayed. Give the name of the event in ‘FORM
routine’ and click on ‘Editor’.
4.1 The following screen would appear. We can use an already existing include or a new include
also.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 15
Table Maintenance Generator and its Modifications
4.2 After selecting the ‘Include’, write the code inside the ‘include’ of function group of the event and
activate the ‘include’. Write the following code in the FORM routine.
Please note that FORM and ENDFORM statements have to be added on our own because
these statements would appear automatically.
Note: Whenever a new ‘include’ is created for a function group, the function group becomes deactivated. In
this case; both ‘include’ and function group has to be activated. If the function group is not activated, a
runtime error is generated while maintaining the table through SM30. Function group can be activated
in transaction SE80.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 16
Table Maintenance Generator and its Modifications
4.3.1. Go to transaction SM30, give the table name and Click on ‘Maintain’. In the subsequent
screen, select a record and click on delete.
4.3.2. A popup would be displayed asking ‘Are you sure to delete the record’. Click on ‘Yes’.
4.3.3. The record would get deleted. Click on ‘Save’ to save the data.
4.3.4. If the user clicks on ‘No’ in step 4.3.2, the record would not get deleted.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 17
Table Maintenance Generator and its Modifications
5.2. Select the ‘include’ from the subsequent screen and write the following code in the FORM and
ENDFORM statements.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 18
Table Maintenance Generator and its Modifications
5.3.1. Go to transaction SM30, give the table name and Click on ‘Maintain’. In the subsequent
screen, click on ‘New Entries’. The following screen would appear.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 19
Table Maintenance Generator and its Modifications
5.3.2. Write only ‘Hobbies’ of the user and hit ‘Enter’ key. Since a validation check has been
applied to the User Id field, an error message appears as follows:
5.3.3. Now enter the user id of the user. This screen would appear.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 20
Table Maintenance Generator and its Modifications
5.3.4. Press the ‘Enter’ key now. The value of User Name would be automatically generated.
Similarly, we can add many more validation checks to enhance the functionality of the
table maintenance.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 21
Table Maintenance Generator and its Modifications
6.2. Select the ‘include’ from the subsequent screen and write the following code in the FORM and
ENDFORM statements.
6.3.1. Go to transaction SM30, give the table name and Click on ‘Maintain’. In the subsequent
screen, select an existing entry and click on ‘copy’.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 22
Table Maintenance Generator and its Modifications
6.3.2. The following screen would appear. Change the value of User Id and hit ‘Enter’ key.
Make sure that the new user id should not be an existing entry; else an error message
would be displayed saying ‘An entry already exists with the same key’.
6.3.3. The following screen appears with a message ‘number of entries copied: 1’.
Please note that User name has automatically changed to the system user name.
Click on ‘Save’ to save the data.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 23
Table Maintenance Generator and its Modifications
2) When the user creates a copy of an existing entry and hits the ‘Enter’ key, only ‘Creating a new
Entry’ event gets triggered. It checks the value of the function code which is ‘KOPF’ and executes
the code accordingly.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 24
Table Maintenance Generator and its Modifications
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 25