Use ABAP code to create a utility that provides you the details of having more than one table or view maintenance generator in a single screen. With it, you can view all the table and view maintenance generator details that you have created in your system or that are already available in the standard system.
Key Concept
Maintenance generators are normally used for maintaining the tables and views in your system. They enable users to create new entries, change and edit existing entries, and delete and remove existing entries from the tables.
As an ABAP programmer, you sometimes want to know whether a table or view has a maintenance generator and what the attributes of that maintenance generator are (e.g., one step, two step). Suppose you want to maintain the data of a table. Instead of making an application for the data maintenance, you can simply create a table maintenance generator for that particular table, and it fulfills all your needs, such as creating, updating, or deleting data.
Consider this example. Say you have created custom tables in your SAP system, and you want to check that the table maintenance generator exists for them. You also want to know the characteristics of every table. The usual process involves checking every table individually, resulting in a repetitive, time-consuming process.
I developed a utility with ABAP code that allows you to view the details of all custom or standard table and view maintenance generators in a single screen. There is no third-party tool involved; it is completely based on the SAP system. To run it, you need some basic knowledge of ABAP. I show you first the usual process of viewing the table maintenance generators, and then I show you the code involved in my process.
Note
Not every table has a generator. If it does not, you can’t maintain it using transaction SM30 and instead must enter the data in the table using transaction SE11 or SE16. In these cases, no separate transaction code exists for maintaining the table data.
The Usual Process
The typical way to check that the table and view maintenance generators exist is by using transaction SE11 or SM30. For transaction SE11, enter the name of the table in the Database table field (Figure 1).

Figure 1
The main screen of the ABAP Dictionary with the table name
Now you can see the details of a table maintenance generator in two ways from this screen. One way is to enter the table name in the main screen as shown and then follow menu path Utilities(M) > Table Maintenance Generator (Figure 2).

Figure 2
The main screen of the table maintenance generator
There is another way of getting the details of a table maintenance generator of a table from transaction SE11. From the main ABAP Dictionary screen (Figure 1), enter the name of the table and click the Display button (Figure 3).

Figure 3
Dictionary table details screen
From here, follow menu path Utilities(M) > Table Maintenance Generator, which brings up the screen in Figure 2.
To display the view, you have to follow the same steps as I just described. The only difference is you have to choose the View radio button in the main screen of the ABAP Dictionary (Figure 1).
There is no standard way of getting the details of a transaction code of a table or view maintenance generator. Now I show you the process of the utility I developed to view these details in a single screen.
Utility to View the Details of Maintenance Generators in a Single Screen
By using this utility, you can view the details of a maintenance generator of a table or view in a single screen. This utility shows you more than one table or view’s details at a time. All you need to do is to enter either a single table or view name at the selection screen of this utility, or you can enter a range of tables or views or some pattern such as Abc*, Cxd*, Yzad*, or Z12a*. Then click the execute icon and the output screen of the utility appears with the details of the table and view maintenance generators.
Now I show you the code for the utility. Figure 4 shows table: tvdir, which is used in the selection screen parameter name and in the utility as well.

Figure 4
The tables of the utility
Figure 5 contains the code to use for the selection screen. You should include it right after the code in Figure 4.

Figure 5
Code for the selection screen
Now let’s look at the code for the data definitions and declarations that you need for this utility. Figure 6 shows the code for variables, internal tables, types, and constants. You should include it right after the code in Figure 5.

Figure 6
Code for data declarations and definitions
Now you need to code the data selection of the utility. Figure 7 shows the code that retrieves all the table and view maintenance generators that you want to display in this utility.

Figure 7
Code to retrieve data of the utility and display it in the output screen
Initially, the utility fetches the details of all tables and maintenance views from table TVDIR into an internal table. Afterward, it retrieves the details of the table or view description. Then it retrieves the details of the table or view maintenance generator that is a single step or two step. These terms refer to whether the maintenance generator has a single screen for maintenance or has two. If the type field of table TVDIR has a value of 1, then it is a single-step table. If it has a 2, it is a two-step table.
Next, the utility informs you about the details of the screens of the table maintenance generator. If it is a single-step table or view maintenance generator, then the liste field (within TVDIR) contains the value of the screen number. If the table or view maintenance generator is a two-step table, the detail field contains the value of the screen number of the detail screen of the table or view maintenance generator.
The utility then makes the serial number of the table or view maintenance generator that you see at the output screen of this utility. The utility then informs you about the details of the transaction code of the table or view maintenance generator. This transaction code is used for the display of the table or view maintenance generator and also used for the maintenance (e.g., creating new entries, changing existing entries, and deleting existing entries) of the table or view maintenance generator.
The next step for the utility is retrieving the details of the transaction code description and of all transaction codes created using transaction SE93. These transaction codes have parameter types. In the parameters, you enter the table maintenance generator name and other parameters (e.g., show, update).
After retrieving all the details of these types of transactions, the utility gets the details of all the transaction code descriptions. It checks in the main table of the utility to see if the transaction code exists. If it exists, the utility updates the existing entry, and if it is a new entry, the utility adds it into the output table of the utility. Next, for every entry that is new for the output table, the utility checks that it is a table or view maintenance generator. Depending on the type of entry, the utility gets the description and checks whether it is a single-step or two-step table or view maintenance generator. Then the utility assigns the screen numbers to the output table of the utility.
The next section of the utility is for output. FORM build_field_catalog contains the fields of ALV that you can see in the output of the utility. After this there is a section of code within FORM build_alv_events USING p_gt_events TYPE slis_t_event. This section is used for the events management of SAP List Viewer (ALV). This utility has an event that displays the header at the top of the page in which you can add text or a logo.
Next there is a section of code within FORM build_alv_comment USING p_gt_list_top_of_page TYPE slis_t_listheader. You use this code to display the logo and other text in the header of the output of the utility that you have defined with the top of the page. Next there is a section of code within FORM display_alv. You use this section to display the data of the utility at the output screen of the utility. There is also a section for calling the transaction code of the generator when the user double-clicks the transaction code of the utility in the output screen. Similarly, you can display the table or maintenance view screen in transaction code SM30 by double-clicking the table or view maintenance name. Next, you can use a section of code FORM top_of_page to display the logo in the output screen of the utility.
After creating your program and entering the code in Figures 4 through 7, save your program, activate it, and make a transaction code of it. Alternatively, you can run the utility via transactions SE38 or SA38. You can download the entire code here.
Run the Utility
Now look at the utility you’ve created. In this utility, there is only one parameter that you use: the View/table name, which you wanted to view in the output screen. If you wanted to view all your custom table or view maintenance generators, then enter Z* and Y* (because all custom table or view maintenance generators start with a Z or Y). Figures 8 and 9 show the selection screen of this utility. Figure 8 is the main selection screen, and Figure 9 shows how you can enter multiple table or view maintenance generator names in the selection screen. After you fill in these selections, click the execute icon or press F8. The utility brings you to the main selection screen (Figure 10) with the criteria you have selected in Figure 8.

Figure 8
The selection screen of the utility

Figure 9
The dialog to enter multiple maintenance generators

Figure 10
The main selection screen for maintenance generators
Click the execute icon or press F8. All table or view maintenance generators details are displayed in the output screen of the utility (Figure 11). Similarly, you can display the details of various other view or table maintenance generators (e.g., sds*, ef1*).

Figure 11
The output screen for maintenance generator details
Suppose you wanted to get the details of the view. You can view these details in two ways. One is to double-click the transaction code as shown in the Transaction field in the output screen, which produces the screen in Figure 12.

Figure 12
View or table maintenance generator details
The other way is to double-click the Table/View name field in the screen in Figure 11, which produces the main screen of the table maintenance generator (Figure 13). You can click the Display or Maintain button depending on your need. After you click the Display button (Figure 13) you reach the screen shown in Figure 14. Clicking the Maintain button in the screen in Figure 13 brings up the screen in Figure 15.

Figure 13
Maintenance generator details

Figure 14
View or table maintenance generator details

Figure 15
Maintenance generator details when you click the Maintain button
Note
There is an exception to this utility. You can’t display the details of the transaction code of a view or table maintenance generator that is based on function module VIEW_MAINTENANCE_CALL. Sometimes you use this function module to display the maintenance generator in your programs. The issue with such types of transaction codes is that you can’t find out the exact location for the name of the table or view.
Qazi Wasif Ali
Qazi Wasif Ali is an SAP ABAP certified consultant at Descon Engineering Limited in Pakistan. He has more than six years of SAP ABAP experience. He has a degree in computer science and has worked in industries such as packaging, beverages, and chemicals. Previously, he worked at Siemens Pakistan and Abacus Consulting. Qazi has also participated in support projects.
You may contact the author at qaziwasifali786@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.