ABAP Data Dictionary
ABAP Data Dictionary
Or
DATA DICTIONARY
(DDIC)
ABAP dictionary deals with the creation of Tables, Search help, Views, Lock Objects, Structure
etc.
TABLES:
A table is a collection of fields, where the fields are made up of rows and columns. It can be
Transaction Code is SE11. When a table is activated in the ABAP DICTIONARY i.e. in the
application server, the system will immediately create a copy in the database. (Physical
Definition).
These are used to store application data. Types of data that can be stored in a
Transparent Table:
TYPE DESCRIPTION
MASTER DATA Basic information that does not change frequently. e.g.) Vendor
Master, Materials Master, Customer Master etc.
TRANSACTION DATA Data that keeps on changing with respect to the business events.
e.g.) Purchase Order, Sales Order etc.
ORGANIZATION & Organization data that rarely changes. e.g.) Currency, Unit, Region,
CUSTOMIZING DATA Company Code, Plant etc.
TABLE CREATION:
OBJECTS DESCRIPTION
c) DELIVERY CLASS This controls the transport of table data in installations, upgrades,
or client copies and in transports between customer systems.
Press F4 and select A Application Table ( Master & Transaction
Data )
iv) DOMAIN:
A domain gives us the technical information about a field. It is also called as the technical
domain. Name – 1st letter Y or Z. Maximum of 30 and a minimum of 3. A domain consists of:
2) Data Types: This specifies the data type of a field. Following are the available data types:
ABAP DICTIONARY DATA TYPES:
DATS 8 Date d
TIMS 6 Time t
3) No. Characters: This specifies the length of a field. For CHAR, CUKY, CURR, DEC,
NUMC, QUAN, UNIT fields length should be specified. For
other fields
length is fixed.
5) Output Length: This specifies the maximum field length that includes length of a field
7) Sign: This is used to suppress the negative sign of a field in the output. This
can be used only for data types DEC, FLTP, QUAN and CURR .
8) Lower Case This is used to retain lower case letters as lower case in the output.
9) Fixed values: This is used to further restrict the value range of a domain. These are
used in the input check in screens. We can only define fixed values for
domains of data types CHAR, NUMC, DEC, INT1, INT2 and INT4.
v) DATA ELEMENT:
A data element gives us the field labels and the documentation for the field. It is also called as a
Semantic domain. Name – 1st letter Y or Z. Maximum of 30 and a minimum of 3. The name of
the domain and the data element can be the same or different. A data element consists of:
1) Data Type: It describes the type attributes (data type, field length and possibly the
number of decimal places) of a field. For this, we can either enter the
domain name and press enter or select Predefined Type, select data
2) Field Label This is used as the label for the field in report or dialog program. It
consists of:
3) Documentation: This specifies the online documentation about a field. TCode is SE61.
f) TECHNICAL SETTINGS: SE13
This specifies the behavior of the table in the database. It consists of:
1) Data Class: This specifies the physical area of the database where the table should be
2) Size Category: This specifies the physical amount of data that can be stored in a table. It
ranges from 0 to 4.
g) ENHANCEMENT CATEGORY:
Structures and tables that were defined by SAP in the ABAP Dictionary can be enhanced
Extras > Enhancement Category -> Select Can be enhanced (Character type or Numeric).
Create Table -> Field1 -> Create Data Element -> Create Domain.
Create Table -> Field1 -> Enter the Data Element Name. Press Enter.
17. Select the tab Data Type. Now, select Elementary Type.
18. Select Domain. Enter the name of the domain. Press F4. The system will automatically
display the data Type, Length & Decimal Places if the domain is active.
19. Now, select the tab, Field Label. Following screen will appear:
1. Select Database Table. Enter Table Name. Click Create. This is shown in the screen
below:
2. Now, the following screen will appear:
6. In the field, enter the name of the field, Select Key if the field is a primary key field.
7. Enter the data element. Press enter. The system will automatically display Data type,
Length, Decimal and short description.
8. Repeat the same steps for all the fields.
9. Click Save.
10. Now, click the button Technical Settings, (TCode SE13) as shown below:
11. Following screen will be displayed:
12. Place the cursor in data Class. Press F4 & select Appl0 – Master data & Appl1 –
Transaction Data.
13. Place the cursor in Size category. Press F4 & select the range between 0 and4.
14. Click the button Save. The screen will appear as shown below:
24. We can also open screen to make new entries as shown below:
25. To display the contents of the table, we can open the screen as shown below:
28. The system will display the output of the table in the screen as shown below:
29. We can also open the screen to display the contents of the table as shown below:
30. Click Display. Following screen will appear:
FOREIGN KEY:
A foreign key creates a link between two tables T1 and T2. Every primary key field from T1
(check table) is assigned a field from table T2 (foreign key field). The fields from T2 assigned to
primary key fields are marked as foreign key fields. The foreign key fields can only accept values
CHECK TABLE:
Table whose key fields are used to check the foreign key fields. Only entries that are contained in
the key fields of the check table can be contained in the foreign key fields. The check table is used
to check whether the input values are valid and for the input help (F4 help).
VALUE TABLE:
Table where values are entered for which a check is made in the check table.
1. The field must be a Primary Key field in the check table only.
1. Enter the TCode SE11. Enter the Table name. Click Change as shown in the following screen:
2. The following screen will appear:
3. Select a field shown above and click the button foreign key. Following screen will appear:
4. Place the cursor on the field Check table. Press F4. Select the Check table from the list.
Press Enter.
6. Now, the system will display the list of fields that are used to create foreign keys.
7. Click Copy.
9. Click Activate.
SPECIAL FIELDS IN ABAP
PROCEDURE:
7. Establish the relationship between CURR / CUKY fields & QUAN / UNIT fields.
8. We can also establish the relationship between CURR of one Table to CUKY of another
SEARCH HELP:
A search help is an object of the ABAP Dictionary with which input helps (F4 helps) can be
defined.
• Elementary search helps implement a search path for determining the possible entries.
• Collective search helps contain several elementary search helps. A collective search
help therefore provides several alternative search paths for possible entries.
The name of the search help: 1st letter should begin with ‘Y’ or ‘Z’. Maximum of 30
These are the basic search help that are used to display values when the user presses F4.
Selection Method: The selection method describes the database object from which the
data is read. A database table or view can be defined as selection method.
Dialog Type: The dialog type defines the dialog steps executed for an input help.
• Dialog depends on value set - A: If the hit list contains less than 100 entries, it is
displayed immediately. If the hit list contains more than 100 entries, the dialog box for
restricting values is displayed.
• Dialog with value restriction - C: The dialog box for restricting values is displayed
immediately. Select this option if the list of possible entries is normally very large.
Restricting the set of data to be processed increases the clarity of the hit list and reduces
the system load during value selection.
• Immediate value display - D: The hit list is displayed immediately after the input help has
been called. This option is advisable if the hit list usually contains only a few entries.
Parameter: A search help parameter is a field for controlling the behavior of a search help.
There are the following roles for search help parameters, where a parameter can have more
than one role:
1. Import parameters: These are parameters with which context information can
be copied to the input help process from the input template or from the module pool
of the processed screen.
2. Export parameters: These are parameters with which values can be returned to
the input template from the input help process.
3. LPos: Position of the parameter in the hit list. If this field is left empty, the
parameter will not appear in the hit list.
4. SPos: Position of the field in the screen for restriction. This can be used in the
dialog box for limiting the list.
5. SDis: If this flag is set, the search help parameter appears in the selection popup
6. Data element: The type of a search help parameter must be defined by assigning a
data element. This data element defines the output attributes and help functions of
the parameter on the popup window for restricting values and in the hit list.
7. Modified: This flag shows if the data element of the parameter is linked to the data
element of the field of the selection method having the same name. Normally the
parameter gets the data element from the field of the selection method having the
same name. If the data element of this field changes, the search help is automatically
8. Default Value: A default value of the right type can be assigned to a parameter of a
search help.
Parameter: A search help parameter is a field for controlling the behavior of a search help.
There are the following roles for search help parameters, where a parameter can have
more than one role:
1. Import parameters: These are parameters with which context information can
be copied to the input help process from the input template or from the module pool
of the processed screen.
2. Export parameters: These are parameters with which values can be returned to
the input template from the input help process.
3. Data element: The type of a search help parameter must be defined by assigning a
data element. This data element defines the output attributes and help functions of
the parameter on the popup window for restricting values and in the hit list.
4. Default Value: A default value of the right type can be assigned to a parameter of
a search help.
5. Implemented Search helps: Enter the name of the elementary search helps
for which collective search help is required.
6. Parameter Assignment: Here we are the fields of the elementary search helps
to the fields of the collective search help. For this, we can select the elementary
search help, click the button Parameter Assignment. The system will give us the
following prompt:
The Parameter assignment for search help & is not defined. Do you
want the system to propose a parameter assignment?
Click the button Yes. In the next screen, click the button Copy. Repeat this step
for other search helps also.
i) Field of a Table.
iii) Domain.
i) Field of a Table:
iii) Domain:
Whenever there is a change of the following in the application server level or field level:
The system cannot update this automatically in the database level. To do this, we can use
the tool called Database Utility. TCode SE14. Here, the system will delete the table with the
old structure and will recreate the table with the new structure.
PROCEDURE
2) Click Edit.
3) Processing Type:
a) Direct:
This executes the database changes immediately. We can use this for smaller
Database changes.
b) Background:
executes the required database changes. The start time for the job can also be
specified. For larger database changes SAP strongly recommends that the
The processing type Enter for mass processing enters the object in the
4) Select Save Data. Click the button Activate and Adjust Database.
AGGREGATE OBJECTS:
1. Search Help.
2. View.
3. Lock Objects.
2. VIEW:
A view is a logical view on one or more tables. A view is not actually physically stored,
instead being derived from one or more tables.
TYPES OF VIEWS:
---------------------------------
a) PROJECTION VIEW:
A projection view is a view for a single table. An SQL view is not created in
the database. No selection conditions can be specified.
1) Enter View name. Click the button Create. Select Projection View. Click Copy.
3) Enter the Basis Table. i.e. the name of the table for which the view is created.
5) Select the tab Maintenance Status. Select read only or read and change.
6) Click activate.
b) DATABASE VIEW: ( 1 Table Only ).
A database view is a view for one or more tables. Selection conditions can
be specified.
1) Enter View name. Click the button Create. Select Database View. Click Copy.
3) In the tab Table/Join Conditions, enter the name of the table for which the view is
created. Select the Table.
4) Click the button Table Fields. Select the table. Select the necessary fields.
6) Select the tab Maintenance Status. Select read only or read and change.
7) Click activate.
A database view is a view for one or more tables. Selection conditions can
be specified.
1) Enter View name. Click the button Create. Select Database View. Click Copy.
3) In the tab Table/Join Conditions, enter the name of the table for which the view is
created. Select the Table.
4) Click the button Relationships. Select the table that is related to this table. Click
Copy.
5) Click the tab View Fields. Click the button Table Fields. Select the table. Select
the necessary fields.
6) Click the tab Selection Conditions. Specify the conditions.
8) Click activate.
Table Maintenance Generator (TMG) is a tool which is used to create table maintenance program
to add, modify or delete records in the database tables. It is generated to maintain customizing
data with these maintenance dialogs. Transaction code is SE54. We can check the table
maintenance dialog in SM30 or SE16. In SM30, We have display and maintain options. Display
option is used to view the table contents in read only mode and maintain option is used to maintain
the entries in the table.
Creation:
1. Enter TCode SE54 as shown in the screen below and press Enter:
2. Following screen will appear. Here enter the table name. Select Generated Objects. Click
Create.
3. The system will display a dialog box as shown below: Click the button Yes.
Screen Modifications:
Using this, we can either add fields or remove fields or change the properties of fields either in
the overview screen or single screen.
Overview Screen:
1. Enter the TCode SE54. Enter the table name. Select generated objects. Click Change
button as shown below:
2. Following screen will appear:
3. Click Overview Screen. The system will display a dialog box as shown below:
4. Click Ok. Following screen will appear:
5. Click the button Layout (Ctrl+F7). Following screen will appear:
6. To add more fields in the screen, click Go to -> Secondary Window -> Dictionary /
Program fields or Press F6. Following screen will appear:
7. In the above screen, enter the table name. Click the button Get from Dictionary. Select
the fields, Click Ok to continue. Following screen will appear:
8. Click to place the fields as shown in the above picture. Following screen will appear:
9. Now, we can see the fields that are added. Click the buttons Activate & Test.
Single Screen:
1. In the TMG screen, click the Single Screen. This is shown below:
5. To make changes in the property of a field, click Go to -> Secondary Window ->
Attributes or Press F2.Now, the system will open the property window. We can set the
property as shown above, i.e. open the tab Program and select Output only.
Table maintenance generator is used for handling events. Once table maintenance is
implemented for a table, events can be handled. There is a list of predefined list of events
in SAP. These events can be implemented using the table maintenance.
Events are used to add custom checks for table maintenance screen generated using the
table maintenance generator. Many validations, checks and functionalities can be
performed while maintaining the table entries.
These events are triggered when a table/view is maintained through transaction SE16 or
SM30. The action to be performed by these events can be defined by writing the FORM
routine in the ‘Includes’ generated by function group.
5. Place the cursor in T. The system will display a list of events as shown above.
6. From the list, select the event 05 - Creating a new entry. This event will be fired
whenever a user makes a new entry.
7. In the Form routine, enter the name of a subroutine. e.g.) CALC. Press enter.
8. The system will display an editor icon. Click the same. Following screen will
appear:
9. The system will automatically select the include program LZCUNLF01. Press
enter. The system will display the following message:
An include statement will be included in the main program SAPLZCUBL.
10. Press Enter to continue. The system will open the include program as shown
below:
11. Enter the code between Form & EndForm statement. Activate the program.
Click the back button. We will come back to the event screen as shown below:
12. Click the button Save to save the event. Click the back button. It will take us to
the Table Maintenance Generator screen as shown below:
13. Click the button Save. The system will show a message as shown above. This
means that the man program SAPLZCUBL is inactive.
14. Go to SE38. Enter the name of the main program. Click Activate. The screen will
be displayed as shown below:
1. To test the screens, go to SE54. Click the button Test. The screen is as shown
below:
5. To display an existing entry, select an entry in the overview screen, click the button
details . This will open the single screen with the entry .
Creating Transaction Code:
We can create a transaction code that can enable a user to open the screen maintained
in table maintenance generator. Transaction Code to create a transaction code is SE93.
3. Enter a TCode. 1st letter should begin with Y or Z. maximum of 20 and a minimum
of 3. E.g.ZCUB01.
4. Click the button Create. Following screen will appear:
5. Enter short text. Select Parameter Transaction. Press Enter. Following screen will
appear:
6. In the field Transaction enter,SM30 and press enter. Select Skip initial screen.
8. In the following screen, place the cursor in the 1 st row of the name of screen field
Press F4 and select VIEWNAME and enter the table name value of the 1 st row.
E.g. ZCUBL.
9. In the 2nd row of the name of screen field Press F4 and select UPDATE for change
mode or SHOW for display mode. This is shown in the screen below:
10. Click the button Save. Now, the TCode is ready to use.
LOCK OBJECTS:
A lock object is a virtual link of several SAP tables which is used to synchronize
simultaneous access by 2 or more users to the same set of data. Naming convention - 1st
letter should begin with E; second letter should be Y or Z. Max. 16 & min 3. By creating a
single lock, we can lock both Check Table & the Value Table.
LOCK MODE:
Lock Mode defines how synchronization must be done. Following are the modes.
1. Write Lock:
Locked data can be read or processed by one user only for a given transaction.
A request for another Exclusive Lock or for a Share Lock is rejected.
2. Read Lock:
Several users can read the same set of data at the same time but when a user starts
editing a record, the other user can no longer have access to edit this record. Requests
for further shared locks are accepted, even if they are issued by different users, but
exclusive locks are rejected.
3. Exclusive, Not Cumulative Lock:
An exclusive but not cumulative lock can only be requested once by a given
transaction. All other lock requests are rejected.
LOCK PARAMETERS:
The field(s) by which system locks the data. Normally the Primary Key Field(s).
STRUCTURE:
Like a table, a structure has rows and columns. But data cannot be stored since it is
not created in the data base. By creating a structure, we can attach the fields of the
structure as the fields of tables or to customize screens or to implement foreign key,
search help & curr/cuky or quan/unit fields. Name – 1st letter should be Y or Z.
Maximum of 30 and a minimum of 3 characters. Maximum number of structures that
can be included in a table is restricted to 8. The structure can be created in the same
way as the table.