Adjusting Table Maintenance Generator without re-generating it, when Table Structure changes
Suppose we have a table in the dictionary and it has a maintenance generator which contains many events and lot of features (display a field as drop down, check box or field header text) incorporated manually in the function group of the maintenance generator. At this moment if the table structures changes and it requires one extra field to be appended and maintenance generator needs to be there as it was previously with the amended of the new field then changing the table structure and re-generating the maintenance generator will not provide the solution. If we re-generate the maintenance generator after changing the table structure then it will incorporate the new field but all the events and other features will be deleted from the maintenance generator. So same features and events needs to be coded again.
This can be avoided by adjusting the maintenance generator manually and not re-generating it using the following steps:
Create a table ZTEST_EMP using tcode SE11 with a maintenance generator.
Now Utilities->Table Maintenance Generator and create the Maintenance Generator:
Now from SM30 tcode we can create new entries to the table:
Display table ZTEST_EMP:
Change the table structure with the addition of new field ‘EMP_AGE’ and activate it:
Now if we display the table it will also display the new field with initial value:
But the table maintenance generator will not contain the new field:
Now we will adjust the Table Maintenance Generator so that this additional field is added and other functionalities in the Table Maintenance Generator remains intact.
Get the Function Group from the Table Maintenance Generator Display:
Go to tcode SE80 and open the function group and select the screen number and click on Layout from toolbar.
This Design Screen will appear:
Add the extra column (input/output field) manually:
Name the new column as the same updated in the table structure.
Add the column header text as follows: Name the header text field as- *ZTEST_EMP-EMP_AGE
Save and Back. Go to Flow Logic tab and add the following line indicated:
Go to Element List->General Tab: Tick the red marked field as dictionary field.
Save it. Following pop up will be prompted. (Select your choice accordingly and click ok)
Then the following popup will come. (Click as per your requirement. Here we choose yes as we want new table field to be in Table Maintenance Generator)
Finally Activate the Table Maintenance Generator. If activated successfully then go to tcode SM30 to maintain data.
We will change Employee age as 30 and save the record. In the table display we can see that age is updated.