Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Milan Victor – SAP

MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

TMG – Table Maintenance Generator


Purpose of this document:
This document will detail the process of creating a Table Maintenance Generator (TMG), editing
screen properties within TMG, and incorporating validations into TMG.
What is TMG?
In SAP ABAP (Advanced Business Application Programming), TMG stands for "Table
Maintenance Generator." It is a tool that helps developers create a user interface for
maintaining data in database tables. TMG simplifies the process of designing and implementing
a maintenance screen for tables, making it easier for end-users to add, modify, or delete records
in a table.
The Table Maintenance Generator generates a set of ABAP programs and screens based on the
table's structure and maintenance attributes. Developers can then enhance or customize these
generated programs to meet specific requirements. The TMG is commonly used for managing
custom tables in SAP systems, providing a standardized way to maintain data without the need
for extensive coding.
In summary, TMG in SAP ABAP is a tool that automates the generation of maintenance screens
for database tables, streamlining the development process and ensuring consistency in data
maintenance across SAP applications.
Why we need TMG:
• User-Friendly Data Maintenance
• Efficient Development
• Consistency in Maintenance Screens
• Reduced Development Effort
• Built-In Validation Support
• Adherence to SAP Guidelines
• Flexibility in Customization

How to Create TMG: T-code: SE11


Step1: Table Creation in SE11
Go to T-code SE11 and give the Table name and click create button

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Step2: Give the description and delivery class

Delivery class:
The delivery class is a classification assigned to database tables, data elements, and
domains. It is a property that provides information about the transport and
management of objects across different systems in the SAP landscape. The delivery class
is primarily used to define how changes to these objects are handled during the
transport process.

There are several delivery classes in SAP, and each class signifies a different behavior
regarding transport and client-specific customizing. The commonly used delivery classes
include:
Types:
• A - Application table (master and transaction data)
• C - Customizing, and maintenance only by the customer, no SAP imports
• L - Table for storing temporary data, delivered empty
• G - Customizing, protected against SAP updates, only INS allowed
• E - Control table, SAP and customer have separate key areas
• S - System table, edited only by SAP, change = modification
• W - System table, contents transportable by separate TR objects

Step3: Mention the required fields:


Give the required fields' names and mention the key fields also.

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Step4: Save and assign the package and TR for transport


Assign the package:

Assign the TR:

Then save and activate.

Step5: Assign the Data Class and size category


After clicking the activate button system will navigate to the new page to assign the data class
and size category,
Data Class:
The data class is a classification assigned to tables and views that defines the physical storage
and access characteristics of the data. It provides information about how the data is stored,
where it is stored, and how it can be accessed. The data class is one of the properties associated
with a table or view in the SAP Data Dictionary.
• APPL0 Master Data, Transparent Tables
• APPL1 Transaction Data, Transparent Tables
• APPL2 Organization and customizing
• DDIM Dimension Tables in BW
• DFACT Facts Table in BW
• DODS ODS Tables in BW

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

• USER Customer Data Class


• USER1 Customer Data Class
Size Category:
The size category is a classification assigned to database tables that indicates the expected size
of the table. It provides information about the potential number of entries a table may contain
and influences the storage and maintenance strategies applied to the table.

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Step6: Give the Enhancement Category


Enhancement Category:
When a table is created you need to set the enhancement category. The reason for the
enhancement category is to say what type of fields you can have in your table. For the SAP
tables when you want to make enhancements (adding your fields- append structure)what type
of field you can add depends on how they set the enhancement category

After giving the enhancement category please save and activate the table

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Step7: TMG (Table Maintenance Generator) Creation

Give the Authorization group and Function group name:


Authorization group used to restrict the table maintenance based on the authorization,
&NC& - No Authorization Group
You can give the suitable name for the Function group

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Click the find screen number button.

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

After this the Maintenance screen properties will be changed like this.

Then click the Create button, then it will ask the Package and TR.

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Then Click the save button and activate the table,

After that, you can see the TMG in SM30 t-code like below.

Step8: Edit the TMG Screen


Open the TMG Utilities-> Table Maintenance Generator

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

After clicking the Environment→ Modification→Maintenance Screens the following screen will be
opened. In the below screen click over the screen and press ‘OK’ Button.

Then New screen opened, that will be like a module pool program screen.

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Click LAYOUT Button to edit the screen of the table.

The screen painter will be opened, there we can edit the screen of the table.

Step8: Validation in TMG


The main part is here only. This is used to add the validation in TMG with the help of events. We have a
lot of events in TMG. But frequently we will some of the major events like Before saving, after saving,
and after clicking delete. etc.…

In TMG Screen→ Environment→Modification→Events

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Next Screen will be like this,

List of the events below,

Here, I’m going to use event ‘01’ – Before saving the Data in the database table.

Give the form name and click the button in the editor column.

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

Then select the New Include and click the ok button.

Next, the ABAP editor will be opened. There you can write the logic based on your requirements.

Here, just I added some messages only. Then save and activate.

Go to SM30 give the table name, and maintain the data and click the save button.

https://www.linkedin.com/in/milan-victor-xavier-1713b3192
Milan Victor – SAP
MILLU138@GMAIL.COM
ABAP/Webdynpro/CDS/ODATA/SAP UI5/FIORI

After clicking the save button we can able to see the message popup.

https://www.linkedin.com/in/milan-victor-xavier-1713b3192

You might also like