Sometimes, it is desirable to display data from more than one table in a table maintenance dialog. This could for example be explanatory texts or descriptions from another database table. With maintenance views, we can make that happen. Read on to learn how.
Maintenance views can be used to display additional data during table maintenance, which is what I’m going to demonstrate today. They are comparable to database views, but they are not created on the database; they only exist on the application server.
To create a maintenance view for several database tables, the first thing we need are foreign key relationships. I’m going to re-use the example from the last three posts to display the company code text during table maintenance as a read-only field. Let’s go ahead and create a foreign key relationship. This is done in transaction SE11.
The next step is the actual creation of the maintenance view. Again, go to transaction SE11, enter a view name, and click Create. In the popup that appears, select “Maintenance view”.
Continue by entering the table name in the “Tables” part of the interface. Be sure to put the main data table there; this will be the so-called primary table that all other tables are based on.
It can be a bit tricky to add the other tables if you’ve never used that interface. You will need to mark the row with your table entry, then click the Relationships button to add other tables to the view. You will only be offered tables that have a foreign key relationship with the table you’re starting with, which is why we added this first.
I’ll add the table T001 here so I can access the field T001-BUTXT, where the company code text is stored. The next thing to do is to select the actual view fields. Change to the tab View Flds and enter all the fields you want in your maintenance view. With the field P (Maintenance attribute), you can decide if the field should be ready-only, ready for entry, hidden (you can write in hidden fields using events) or used for subsets. I’ve chosen to make the company code text display-only here.
You’re almost done! All that remains to do now is to create a table maintenance dialog for the view, using the table maintenance generator. The result will look like this. The user can now see the company code text, making his maintenance job easier. Great!