Introduction
In SAP ABAP development, the Table Maintenance Generator (TMG) provides a standard way to maintain table entries through transaction SM30. It allows users to create, modify, and delete records without developing a separate maintenance program.
A common challenge occurs when a new field is added to a custom table that already has a TMG. The updated field may not appear in the existing maintenance screen.
One approach is to delete and recreate the TMG. However, if the existing maintenance dialog contains custom event logic or screen modifications, recreating it can introduce additional rework.
In this blog, we will explore how to update an existing TMG using the generation settings in SAP, without unnecessarily deleting the existing maintenance object.
Prerequisites
Before starting, ensure that:
You have an existing custom table with an active TMG.
The table is maintained through transaction SM30.
You have the required development authorizations.
Any existing TMG events or screen modifications have been documented.
Step 1: Check the Existing Table Maintenance Screen
Open transaction SM30 and enter the custom table or maintenance view name.
Choose Maintain to display the current maintenance screen. Note the existing fields and any custom functionality.
Step 2: Add the New Field to the Table
Open transaction SE11 and enter the custom table name.
Choose Change, add the required field to the table definition, maintain its data element and other relevant properties, and activate the table.
If the change requires a database adjustment, assess the impact and perform the necessary adjustment using the appropriate SAP tools and procedures.
Step 3: Open the Existing Table Maintenance Generator
While working with the table in SE11, navigate to:
Utilities → Table Maintenance Generator
Open the existing maintenance generator configuration and choose Change.
The objective is to adjust the existing generated maintenance dialog rather than delete the maintenance object and recreate it from scratch.
Step 4: Select the Appropriate Structure Change Option
In the generation settings, select the option corresponding to the structural change you have made.
For adding a field, select:
New field/sec. table in structure
If a field has been removed, choose the corresponding option for a field or secondary table removed from the structure.
Proceed to the next screen.
Step 5: Review the Field and Screen Settings
Continue through the generation wizard and verify the relevant settings.
Depending on your existing maintenance dialog, confirm:
Whether the new field is a key field or a non-key field.
Whether the maintenance dialog uses a one-step or two-step layout.
Whether the existing screen arrangement remains appropriate.
Whether any custom screen changes need to be preserved or reviewed.
Select the options that match your table design and proceed.
Step 6: Complete the Generation Adjustment
Continue through the remaining confirmation screens. Allow SAP to process the changes, then save the updated maintenance configuration.
Check the system messages and resolve any errors before moving to validation.
The exact screens and available options may vary depending on the SAP release and maintenance object configuration.
Step 7: Validate the Changes in SM30
Return to transaction SM30 and open the same table or maintenance view in change mode.
Verify that:
The newly added field is available on the maintenance screen.
Existing fields are displayed correctly.
New and existing records can be maintained as expected.
Relevant custom TMG events continue to behave correctly.
Saving the entries updates the data as intended.
Important Considerations
Preserve custom logic: Review existing TMG events and screen modifications before changing generation settings.
Validate key changes carefully: Adding or removing key fields can affect maintenance behavior and existing records.
Test before transporting: Perform the required functional and regression testing in the development and quality systems.
Do not assume every modification is preserved automatically: Custom screen layouts, generated objects, and event implementations should be checked after the adjustment.
Conclusion
When a table structure changes, deleting and recreating the entire Table Maintenance Generator should not be the first option.
By reviewing the existing TMG configuration and selecting the appropriate structure-change settings, you can update the maintenance dialog while reducing unnecessary rework.
Always validate the resulting SM30 screen and existing custom functionality before transporting the changes to another system.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.