Skip to Content
Author's profile photo Sk Manirujjaman

Adjusting Table Maintenance Generator without re-generating it, when Table Structure changes

Purpose:

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:

Step1:

Create a table ZTEST_EMP using tcode SE11 with a maintenance generator.

P1.png

Now Utilities->Table Maintenance Generator and create the Maintenance Generator:

P2.png

Now from SM30 tcode we can create new entries to the table:

P3.png

Display table ZTEST_EMP:

P4.png

Step2:

Change the table structure with the addition of new field ‘EMP_AGE’ and activate it:

P5.png

Now if we display the table it will also display the new field with initial value:

P6.png

But the table maintenance generator will not contain the new field:

P7.png

Step3:

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:

P8.png

P9.png

Go to tcode SE80 and open the function group and select the screen number and click on Layout from toolbar.

P10.png

This Design Screen will appear:

P11.png

Add the extra column (input/output field) manually:

P12.png

Name the new column as the same updated in the table structure.

P13.png

Add the column header text as follows: Name the header text field as- *ZTEST_EMP-EMP_AGE

P14.png

P15.png

Save and Back. Go to Flow Logic tab and add the following line indicated:

P16.png

Go to Element List->General Tab: Tick the red marked field as dictionary field.

P17.png

Save it. Following pop up will be prompted. (Select your choice accordingly and click ok)

P18.png

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)

P19.png

Finally Activate the Table Maintenance Generator. If activated successfully then go to tcode SM30 to maintain data.

P20.png

We will change Employee age as 30 and save the record. In the table display we can see that age is updated.

P21.png

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Kali Charan
      Kali Charan

      Good .........!   Keep Gaining And Keep Sharing.

      Author's profile photo Naimesh Patel
      Naimesh Patel

      Wouldn't it be easier to use the Table maintenance generator? Press the change button, and a small popup comes where you can say, I have added additional field. Only those options which you select on this popup would be generated.

      Regards,
      Naimesh Patel

      Author's profile photo Thiago Alves
      Thiago Alves

      Interesting, but not too useful. Table maintenance generator is faster than that

      Author's profile photo Naresh Mochi
      Naresh Mochi

      Instead of taking Function GroupĀ  and display it on SE80 then go to Screen, just Double click on Screen number in Table Maintenance Generator. Thanks for the Blog it is useful.

      Author's profile photo Gopal Nair
      Gopal Nair

      Thank you - very useful.

      For previous comments about Table Maintenance Generator being easier :

      Yes - its true that its easier. However, if you have used the Maintenance Events and put code into the events to fintune/control the user entries, the table maintenance re-generation wipes this off. We can certainly use INCLUDE and OO-Techniques to minimize the impact - but still the starting point of all these event code will be wiped clean when re-generating.

      Hence, the technique discussed here in this Blog can be used to prevent this event code wipes.

       

      Best Regards,

      Gopal Nair.

      Author's profile photo TechEdge TechEdge
      TechEdge TechEdge

      Thanks, awesome guide.

      Best regards