Use ABAP code to find all the ABAP Dictionary tables and structures that have been enhanced in your SAP system in bulk. This function is not currently available in the SAP standard system. With this ABAP code, you’ll be able to see multiple enhanced ABAP Dictionary tables or structures at a time instead of entering every ABAP Dictionary table or structure name one-by-one and then checking to see if it has been enhanced. This does not require any third-party tool.
Key Concept
Dictionary tables contain transactional data and master data from different areas of the SAP system. Every dictionary structure contains components that are also called fields. Every component has a type associated with it. This type can refer to some data element or directly use some data type and length or some other structure or table type. Dictionary structures are used in programs and on screen fields for creating field characteristics identical to the dictionary structure. Structures can be used to define data at the interface of module pools and screens and to define parameter types of function modules. ABAP programs and screens use structures. A flat structure only references elementary types. A nested structure references at least one further structure, but not a table type. A deep structure references at least one table type.
ABAP programmers often need to know which ABAP Dictionary tables and structures have been enhanced in the SAP system using an append structure or a customizing include (CI include). In transaction code SE11 or anywhere else in the standard SAP system, there is no option available for simultaneously checking multiple ABAP Dictionary tables or structures to see if they have been enhanced. Now, I take you through two examples of situations in which you need to know which tables are enhanced.
- Suppose there is one transaction code for purchase order creation with the name ME21N and the requirement is to add four fields in this transaction code at the header level. You first need to find an enhancement and see if that enhancement has provided a CI include. As I explain later in this article there is one CI include for the purchase order main table EKKO with the name CI_EKKODB. You now need to do two things. Initially you check in your system to see if this CI include has already been created. If yes, then add these four fields in it, and if not, then you need to create it from scratch and add these fields. You follow the same process for finding any other CI include. The only difference is the name of the transaction code.
- Suppose you want to enhance the material master transaction code MM01. The requirement is to add some additional fields in the basic data 1 tab of this transaction. In this case you have no CI include, so all you need to do is to create an append structure for the material master main table MARA. After adding the fields you can use them on your screen and the screen fields values are saved into the material master main table. Here you need to check any custom append structure that exists for material master table MARA. If it exists, add fields in that. Otherwise you can create a new append structure. There are no restrictions that there should be only one custom append structure for any table.
Let’s take the ABAP Dictionary tables as an example. Say you have 20 ABAP Dictionary tables that you have enhanced, and you want to see their details. The usual process involves entering every ABAP Dictionary table and structure name individually in transaction code SE11, a repetitive, time-consuming process. I’ve developed a utility using ABAP code that allows you to see the details of all ABAP Dictionary structures and tables that have been enhanced in one effort that is completely based on the SAP system. To run it, you should have some basic knowledge of ABAP. I’ll start by showing you the process to view enhanced ABAP Dictionary structures and tables, and then I’ll show you the code involved in my process.
The Standard Process
The typical way to view the details of ABAP Dictionary structures and tables directly is by using transaction code SE11. Execute transaction code SE11 and press Enter to see the initial ABAP Dictionary screen (Figure 1).
Figure 1
The initial screen of the ABAP Dictionary
Enter the name of the ABAP Dictionary table you want to check for enhancement in the Database table (e.g., MARA) field (Figure 2). Click the Display button to bring up the screen shown in Figure 3, which contains the details of the fields of the ABAP Dictionary table.
Figure 2
Enter the SAP ABAP Dictionary table name
Figure 3
The ABAP Dictionary table Fields details
Press F5, or choose the menu option Goto > Append Structure to bring up the screen in
Figure 4.
Figure 4
The append structures list
Figure 4 contains the list of append structures created for the ABAP Dictionary table. In this case, the table name is MARA. Append structures can be used to add additional fields to any standard ABAP Dictionary table or structure. Every custom append structure should start with Z or Y.
Figure 4 contains one custom append structure with the name the ZCI_MARA. Append structures are only available in the table or structure for which they were created. In this case, ZCI_MARA is available only in the dictionary table MARA and its fields are part of the table MARA only. The same applies for the append structure of the ABAP Dictionary structure that I explain later in this article. To view the details of any custom append structure, you need to double-click its name, ZCI_MARA in this case, to bring up the screen in
Figure 5. The same process is applicable for viewing the fields of an ABAP Dictionary structure.
Figure 5
The append structures fields detail
This is the usual way of finding an append structure and its details, but there is also another way available in the SAP system. If you know the name of the append structure, enter that name in transaction SE11 and click the Display button. The system shows you the same screen as in Figure 5.
CI Includes and Screen Exits
CI includes are used for adding more fields in the standard tables and structures in an SAP system. The main difference between the CI include and append structure is that fields created using append structures are available only in the table for which the append structure was created. If you create a CI include for a table, then its fields become part of multiple tables and structures where that CI include is being used. CI includes are provided by SAP to users and they contain no fields by default. Every CI include starts with CI_, which is the naming convention provided by SAP. Normally, CI includes are created with fields when you are going to implement a screen exit.
Screen exits are used for adding additional fields into the standard screen of SAP transactions. If you want to add additional fields in a purchase order header, then you need to implement a screen exit. In some cases, SAP provides a CI include with the screen exit. This means that when you go to implement a screen exit for a transaction, you can see that system has provided you with a CI include for adding your custom fields into the standard SAP table and structure. In the case of a purchase order, SAP has provided a CI include with the name CI_EKKODB. You can add your own custom fields as well. If SAP has not provided a CI include then you can implement the enhancement using an append structure. If there is no CI include then fields that are used for enhancement become part of only that dictionary table for which the append structure is created.
Next, I explain how to view CI includes in transaction code SE11. Suppose you created one CI include for the EKKO dictionary table and now you want to view its details. First, run transaction code SE11, select the Database table radio button, and enter the table name EKKO in the Database table field (
Figure 6).
Figure 6
Enter the SAP ABAP Dictionary table name
Now, click the Display button to get the details of the SAP ABAP Dictionary table (Figure 7).
Figure 7
The SAP ABAP Dictionary table Fields details
To find out if this table contains a CI include, press CTRL+F to go to the screen shown in Figure 8.
Figure 8
Find the CI include
Enter the name CI_EKKODB in the Find field (Figure 9) and press Enter or click the green checkmark icon to bring up the screen shown in Figure 10.
Figure 9
The CI include name
Figure 10
The CI include fields
Double-click the CI include and the system brings up another screen that contains the details of the CI include (Figure 11).
Figure 11
The CI include fields details
This is the standard method of finding a CI include and its details. There is another way available in an SAP system. If you know the name of the CI include, enter that name in transaction code SE11 and press the Display button. The system shows you the same screen as shown in Figure 5.
Repeat all these steps for every resulting ABAP Dictionary structure or table enhanced using append structure or CI include whose details you wanted to view. The utility I’ve developed simplifies this process.
The Utility for Finding Enhanced Dictionary Tables and Structures
Using my utility, you can view all your enhanced ABAP Dictionary tables and structures in a single effort.
Figure 12 shows the ABAP code for the new utility.
Figure 12
The code for finding enhanced ABAP Dictionary tables and structures
Add the code from
Figure 12 into your program and activate it. Run the report and the screen should look like
Figure 13.
Figure 13
The utility for finding enhanced ABAP Dictionary tables and structures
As you can see in
Figure 13, there are three radio buttons on the main screen. The default setting is Both Table / Structure &CI. When you run the utility in its default setting, it gives you the details of all the tables and structures enhanced using an append structure and CI includes. If you run the utility with the CI Include Only radio button selected, then the output of this utility shows you all the tables and structures enhanced using a CI include. Similarly, if you select the Table / Structure Only radio button, then the output of this utility shows you only those tables and structures that use a custom append structure.
You can also arrange to see the details of a particular CI include being used in tables and structures and also the details of some tables and some structures that have been enhanced with the append structure implemented. Enter the table or structure name in the Table / Structure Name field of this utility (under the Selection Criteria section of
Figure 13)and the CI include name in the CI include field. Click the execute icon or press the F8 key (
Figure 14).
Figure 14
The utility for finding the details of only one table or structure and a CI include
The next step is the same for whether you are finding more than one table or structure (
Figure 15) or more than one CI Include (
Figure 16). Enter the names of all the tables and structures and the CI includes into the utility. To get to
Figure 15 (for multiple tables and structures) or
Figure 16 (for multiple CI includes) click the yellow arrow on the right side of the CI Include name field (next to the text field) to enter more than one CI include or more than one table or structure click the yellow arrow on the right side of the Table / Structure Name field (next to the text field).
Figure 15
Details for more than one table or structure
Figure 16
Details for more multiple CI includes
Press the F8 key or click the clock icon in
Figure 15 (for multiple tables and structures) or
Figure 16 (for multiple CI includes) to get back to the screen shown in
Figure 14.
Note
When you enter the name of more than one table or structure in the fields open in Figure 15, the icon on the right side of the altered field turns green. This happens because you entered more than one table or structure name.
Press the F8 key or click the clock icon (
Figure 16) to bring up the screen shown in
Figure 14, which is the main screen of the utility. Now, after doing all this, both fields should have green and yellow arrows with them (not shown). This indicates that both fields have multiple values entered into them. After entering the details, press the F8 key or click the clock icon in
Figure 14 to obtain the first output screen of this utility (
Figure 17) .
Figure 17
The details of the append structure and CI includes
As you can see in
Figure 17, there are four columns in the utility output. The first column, Pool/cluster name, shows the name of the dictionary table or structures using a particular append structure and CI include. Column two (Short Description) is the description of the table or structure. Column three (Table) is the name of the append structure. For example, in
Figure 17, you see MARA table. MARA is a material master main table using an append structure with the name ZCI_MARA. The last column of the output shows the name of the CI include that a table is using. In
Figure 17, the second column displays the CI include.
Double-click the Table column of the utility. Row one contains the text ZCI_MARA. The system then gives you the details of the append structure. This particular append structure contains these fields on the second output screen of the utility shown in
Figure 18.
Figure 18
The details of the fields of the append structure
You use the same process for getting the details of a CI include. If you click the CI include name, the system shows you the details of the CI include on the second screen of the output
(Figure 19).
Figure 19
The details of the fields of the CI include
Follow the same procedure if you want to view just the details of tables and structures using an append structure. Select the third radio button on the first screen of the utility (
Figure 14) and enter the name of the table or structure to view one or more tables or/ structures. The rest of the steps are the same as previously described.
Similarly, follow the same procedure to view only the details of a CI include used in a table or structure. Select the CI Include Only radio button (on the first screen of the utility,
Figure 14) and enter the name of the CI include to view one or more CI include names. The rest of the steps are the same as the ones I showed earlier.
Tip!
When you run this utility by selecting the Both Table/Structure &CI radio button (Figure 14), do not enter any text in Table/Structure Name and CI include fields in Figure 13. Adding text to these fields causes the time output of the utility will be slow.
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.