Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
ansonabraham
Active Participant

What is TMG?

TMG (Table Maintenance Generator) is a tool used for maintaining entries in a table such as entering and deleting multiple records, triggering events while updating entries etc. TMG can be created using the transaction codes SE11 and SE54.

Why to modify the TMG without regenerating it?

Whenever a table is modified by inserting a new field, we have to regenerate the TMG (Table Maintenance Generator) to get the new field in the maintenance screen. It will be difficult to regenerate an existing TMG with lot of customizations made in code and screen. All those customizations will be lost during regeneration. So to retain the customizations made in TMG, a manual updating technique can be adopted.

Using TMG for maintaining entries in the table.

Before handling modification let us view an existing TMG. A custom table ‘ZNSFLIGHT’ is created and TMG is generated for demo purpose. This table is copied from the standard table ‘SFLIGHT’.

  1. Go to transaction SM30. Give your table name and click on the ‘DISPLAY’ button.

    

2. Click on the ‘DISPLAY/CHANGE’ button.

    

3. Now click on the ‘NEW ENTRIES’ button.

    

4. Add new entries and save it.

    

Modification of TMG without regeneration

Add a new field to the custom table ‘ZNSFLIGHT’ and activate it.

We have to include this field to the TMG of ‘ZNSFLIGHT’ without regenerating it.

  1. Go to transaction SE54. Give table name, select ‘Generated Objects’ and click on the ‘DISPLAY’ button.

    

2. Get the function group name.

    

3. Go to SE80 and open the corresponding function group’s code.

    

4. Expand the ‘Screens’ node and select the screen no: 002. (In my case, screen no: 002 is displayed for adding new entries in TMG).

    

5. Select the layout of the screen and click on the Dictionary/Program Fields button.

    

6. Give the table name and click on ‘Get from dictionary’.

    

7. Select the new field which was added to the table. (In this case ‘LAND1’ will be selected) and click ‘OK’.

    

8. Drag this field and add it with other input fields. Save and activate.

    

9. After screen modifications, activate the function group.

    NB: There is one more addition we have to do in the code (flow logic of screen 002), that part will be discussed later in this document.

10. Now for testing the TMG, go to SM30, give the table name and click on the ‘Maintain’ button.

    

11. The new field added manually to the screen will be displayed now. Now click on the ‘New Entries’ button.

    

12. Add new entries and click the ‘Save’ button.

    

13. Now give another country and click the save button.

    

14. Here the new country is not modified. It will display the old value after saving.

    

15. In order to prevent this error, we have to modify the flow logic of the screen 002.

16. Go to SE80, give function group name and select the screen 002 and open the flow logic (Steps 3 and 4).

17. Give the new field name inside the CHAIN - ENDCHAIN, then save and activate the code.

    

18. To test the update functionality, go to transaction SM30, give the table name and click on the 'Display' button.

19. Next, click on the 'Display/Change' button.

    

20. Now Double click on the existing entry.

    

21. Provide another value in the 'Country' field and click 'Save' button.

    

22. Now the update function will work perfect.

    

24 Comments
Labels in this area