There are several path to accessing the dictionary. Below is a list some of the ways to access the Dictionary.
To access the ABAP Dictionary:
Use the menu path: Tools ABAP Workbench Development ABAP Dictionary; or
Use the menu path:
Tools ABAP Workbench Overview Object Navigator
Pull down the Workbench menu and select Other objects… Select the Dictionary tab from the pop up screen and enter the appropriate table name in the Database table field.
or
Use transaction code SE11
The ABAP Workbench was known as the ABAP/4 Development Workbench in past releases. The Object Navigator used to be called the Object Browser and the Repository Browser.
Tables are the objects that actually hold the information in a database. They consist of rows (records) and columns (fields).
For example, table KNA1 stores information about customers. Some of the columns in KNA1 are KUNNR (customer ID number), NAME1 (customer name), and ORT01 (customer city). Each row in KNA1 stores this information for a different customer.
Certain fields in a table are specified as the primary key of that table. The primary key is that field or combination of fields that uniquely identifies a row in the table. In table KNA1, the SAP R/3 client (MANDT) and the customer number (KUNNR) form the primary key.
Custom tables must start with a Y or a Z and can be 16 characters in length.
The Object Navigator is used to organize your programming in an integrated development environment. It can be used to create, change, and manage objects. It is the center point of entry into the ABAP Workbench.
You can get to the Object Navigator by way of transaction SE80 or the menu path:
Tools ABAP Workbench Overview Object Navigator
Now, let’s take a look at creating a table in the ABAP Dictionary. We will create a table called ZXXFIRSTTABLE (where XX stands for the last two digits of your logon id). This table will hold information about your ABAP class.
Follow the menu path:
1. Tools ABAP Workbench Overview Object Navigator
2. Pull down the Workbench menu and select Other objects. Select the Dictionary tab from
the pop up screen and enter the appropriate table name in the Database table field.
3. Click the Create button (F5).
4. You can also use Transaction Code SE11, and select radio button for Database table.
characters.
the table maintenance attribute (Tab.Maint.Allowed).
8. Click the Fields tab to begin adding Fields to the new table.
We will learn how to add Fields later in this chapter.
Table fields are defined in SAP R/3 by data elements and domains. This is a key difference between SAP R/3 and many other systems. In many other systems, a field is defined only by its type (i.e., character, numeric) and length. These characteristics are assigned directly to each field.
In SAP R/3, a field is defined by being assigned to a data element, which is in turn assigned to a domain. These assignments determine the field’s type and length in addition to other characteristics.
SAP R/3 refers to this method of field definition as the “Two-Level Domain Concept”.
In addition, you can assign the field type (data type) characteristics in different ways:
You can directly assign the field a data type, length, and short text when defining the table.
You can assign a data element to a field so that the field will inherit the data element’s characteristics.
The meaning of a field name is not always obvious. For example, KUNNR may not immediately bring the image of a customer to your mind. Data elements help resolve this problem.
A data element provides a meaningful description for a field. You will hear it called a semantic domain. The data element description appears beside a field in a table definition. These descriptions are language-dependent
(unlike field names).
Even more importantly, the data element provides field headings for use on screens. When you “paint” a dictionary field on a screen, you can automatically have the data element field headings appear. This permits the end user to see meaningful field descriptions.
The advantage of using a data element to describe fields and provide field headers is that the data element can be used more than once.
For example, SAP R/3 contains many tables that have the field KUNNR. In cases like this, it is not necessary to enter the description for KUNNR many times. Each instance of KUNNR can be assigned to the same data element, and the field description only needs to be specified once. Additionally, if the description needs to be changed, it must be changed only once, and all fields referring to that data element automatically use the new description.
SAP R/3 comes delivered with many pre-defined data elements. Whenever the semantic description of a field you are creating matches with an existing SAP R/3- supplied data element, use the one that SAP R/3 provides. Otherwise, you must create your own data element.
When using a SAP R/3-supplied data element, however, you must also use the corresponding SAP R/3-supplied domain. If you wish to use a different domain, you must create your own data element.
Now, let’s take a look at creating a data element in the ABAP Dictionary. We will create a data element called ZXXFIRSTNAME (where XX stands for the last two digits of your logon id). This data element will be used in the table ZXXFIRSTTABLE which we just created.
Tools ABAP Workbench Overview Object Navigator. You can also use Transaction
Code SE11, and select radio button for Database Type and then Data Element.
up screen and enter the appropriate Data Element name in the Data Element field.
Note : As of 4.0, a Data Element cannot have the same name as an existing table or Structure.
Next, click the Field label tab.
Provide a descriptive text for each of the following labels; Short, Medium, Long, and Heading. These labels are used as templates in the Screen Painter as a choice between the different label lengths.
The Heading field is used as the column heading for tabular record entries and its length should correspond with the length of the field.
Click the icon (Ctrl+S).
In addition to providing field descriptions and headers, data elements can provide detailed field documentation. This documentation is maintained at the data element level and is available to a user who hits F1 when the cursor is in a field assigned to the data element.
To maintain this documentation, navigate to the Change Data Element screen within the ABAP Dictionary and click the Documentation push-button.
A domain specifies the technical characteristics and the allowed values of a field.
Domains are linked to fields via data elements. In other words, fields are assigned to data elements, and data elements are assigned to domains. You cannot directly assign fields to domains.
The technical characteristics of a field are the field’s type and length. These are also referred to as the field’s format.
The allowed values of a field define what is acceptable input for that field. These may be listed explicitly or may be specified by reference to a value table. The concept of allowed values is explained more fully on later pages.
Domains can exist independently in the ABAP Dictionary.
Just as multiple fields may be assigned to the same data element, multiple data elements may be assigned to the same domain.
As with data elements, pre-defined domains exist in the system and are available for your use. If a SAP R/3-supplied domain matches the characteristics you require, use the pre-defined domain. If you wish to change the domain’s allowed values, however, you must create your own domain.
In addition to the characteristics listed previously, domains can also specify a field’s output characteristics, such as output length and whether or not lowercase letters are permitted for that domain.
Valid values for a domain can be explicitly listed. To create or maintain an explicit list of valid values, use the menu path Goto Fixed Values on the Change Domain screen in the ABAP Dictionary.
Explicit values are used when the list of valid values is not likely to change
over time.
For example, if a domain was meant to contain the names of the months of the year, it would be possible to explicitly list “JANUARY” through “DECEMBER” as the allowed values (note that this would not work well in a multi-language environment)
Valid values for a domain can also be specified by reference to a value table. When this is done, the records in the value table specify the valid values for the domain. In order to specify a value table for a domain, one of the key fields of that table must point to that domain. That field is the one that determines the valid values for the domain.
A value table is used when the list of valid values may change over time.
For example, a car maker may want to use a value table to list the valid colors for certain car
models. As new colors are developed, the value table can be updated without changing the
domain itself.
By defining valid values for a domain, automatic validation is provided for any fields that point to that domain. This includes validation at the ABAP Dictionary level (if a program tries to insert invalid data, an error will occur) as well as at the screen level (users will not be permitted to enter invalid data).
Additionally, users can obtain a list of possible entries (for fields pointing to domains with allowed values) by hitting function key F4.
Now, let’s take a look at creating a Domain in the ABAP Dictionary. We will create a Domain called ZXXNAME (where XX stands for the last two digits of your logon id). This Domain will be attached to the Data Element ZXXFIRSTNAME which we just created.
Tools ABAP Workbench Overview Object Navigator.
pop up screen and enter the appropriate Domain name in the Domain field. You can also use
Transaction Code SE11, and select radio button for Domain.
Domain.
Now you are able to add custom fields to the table ZXXFIRSTTABLE.
Maintain the table’s Technical Settings by entering a Data Class and a Size Category. Both of these fields will depend on what the table will be used for and how much data you expect the table to hold. For this example, ZXXFIRSTTABLE will hold a small amount of Master Data.
FIRSTNAME.