Data Dictionary
Data Dictionary
ABAP Dictionary
ABAP dictionary is the central information base for the developers. This manages all definitions
(metadata) required for different applications in SAP. ABAP dictionary is completely integrated into
ABAP development workbench. All other component of ABAP development workbench can access
the data definitions (Meta data) stored in the data dictionary.
Simple ABAP dictionary creates and manages data definitions globally so that the different
components of SAP R/3 system can access them.
New or modified data definitions will be automatically available to all the programs of SAP R/3
system. It avoids redundancy.
Input help: The list of possible input values (F4 functionality) that appears for the input
help is created by a foreign key or a search help.
Tables are defined independently of the database in ABAP dictionary. The fields of the table are
defined with their (Database-independent) data types and lengths. Using the table definitions
stored in the ABAP dictionary, a table is automatically created in the physical database (when the
table is activated).
Top-Down Approach
In Top-Down Approach initially we specify the table properties, fields then data elements and then
data domains etc.
Enter the SE11 in the command field to go with ABAP Dictionary; Here We can create DB table,
view, data type, type group, domain, search help, lock object etc... These are called SAP R/3 DDIC
(data dictionary) objects.
Select the radio button Database table then enter the desired table name. Make sure that you
have to follow the naming convention. Name should either start with 'Z' or 'Y'.
Provide the details here as follows
Database table – ZEMP
Then click on Create button, it will navigate to the next screen as follows.
Maintain the following field values on the above screen fields.
Short Description – Employee Details
Delivery Class – A
Data Browser/Table View Maintenance – X Display/Maintenance Allowed
Delivery Class: We need to insert Delivery Class value while creating customized table in SAP
through the transaction code SE11.
Value in the delivery Class tells that the type of information maintain in database table.
Delivery class is that which regulates the transport of the table‟s data records (during SAP
installations, SAP software upgrade, client copies, and data transport to other SAP system). SAP and
its customers have different write types depending on the variety of delivery class. If Delivery class
is “A”, it depicts that the application table for master and transaction data changes only rarely.
X Display/Maintenance allowed: Here we can insert as well as view the data of the table in
the database system.
Display/Maintenance allowed with restrictions: It means only we can view the data of the
table in the database system
After entering the short description, Delivery class and Data Browser/Table View Maintenance
click on the Fields tab button as shown in figure.
Enter the Fields as ENO, ENAME and ESAL and give Data element as ZDEENO, ZDEENAME and
ZDEESAL for respective fields.
Double click on ZDEENO data element of ENO then it will ask to SAVE the screen.
Press “Yes” to save the table ZEMP.
Local Object: It is a built in package where all the programs developed with the help of ABAP
development work bench are stored but are not transported to other systems (Quality and
Production).
It will ask you to create Data Element ZDEENO, Click on “Yes”. Then it opens the following screen.
Enter the short description as Employee Number and click on the Field label tab button and enter
the lengths and descriptions accordingly.
Double click on Domain ZDENO to create Domain for Employee Number ENO field.
It will ask you to save the Data element first, before going to create Domain. Click on “YES”.
It will ask you to create Domain ZDENO for field Employee Number ENO. Click on “Yes” to create
Domain. Then it navigates to the following screen.
Enter the short description for Domain as NUMBER FOR EMPLOYEE.
Default Definition tab button is selected then Maintain the following field values on the above
screen fields.
Data Type – NUMC
No. Characters – 6
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Double click on ZDEENAME data element of ENAME then it will ask to SAVE the screen.
It will ask you to create Data Element ZDEENAME, Click on “Yes”. Then it opens the following
screen.
Enter the short description as Employee Name and click on the Field label tab button and enter the
lengths and descriptions accordingly.
Then click on Data Type tab button to enter the domain.
Double click on Domain ZDNAME to create Domain for Employee Name ENAME field.
It will ask you to save the Data element first, before going to create Domain. Click on “YES”.
It will ask you to create Domain ZDENAME for field Employee Name ENAME. Click on “Yes” to
create Domain. Then it navigates to the following screen.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Double click on ZDEESAL data element of ESAL then it will ask to SAVE the screen.
It will ask you to create Data Element ZDEESAL, Click on “Yes”. Then it opens the following
screen.
Enter the short description as Employee Salary and click on the Field label tab button and enter
the lengths and descriptions accordingly.
Then click on Data Type tab button to enter the domain.
Double click on Domain ZDESAL to create Domain for Employee Salary ESAL field.
It will ask you to save the Data element first, before going to create Domain. Click on “YES”.
Save it as local object. Then the following screen will appear.
It will ask you to create Domain ZDESAL for field Employee Salary ESAL. Click on “Yes” to create
Domain. Then it navigates to the following screen.
Enter the short description for Domain as SALARY OF EMPLOYEE.
Default Definition tab button is selected then enter the details as follows:
Data Type – INT2
No. Characters – 5
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Click on Technical settings push button from application tool bar as shown in the figure.
Technical settings: Data class and size category defines that what type of table to be created
and how much space required.
Maintain the following field values on the above screen fields.
Data Class : APPL0
Size category : 0
Then press on ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Data Class: Data class determines the table space (physical area) in which table is stored when
created. In other words Data class is that which allows the table to get automatically assigned
under specific table space/database space during table creation in the SAP database i.e. data class
determines that under which table space/database space the table will be stored.
Data classes are mainly of three types (for application tables):
Choose APPL0 (master data) for data that is frequently accessed but rarely
updated/changed.
Choose APPL1 (transaction data) for data that is frequently changed.
Choose APPL2 (organizational data) for customizing data that is defined/entered during
system installation and rarely changed.
The other two types of data classes are: DDIM, DFACT, DODS, USR and USR1 (for customer‟s own
development purpose).
Size Category: The Size category is used to define the space requirement for the table in the
database.
There are five size categories. Size category from 0 to 8 can be chosen for the tables. A certain
fixed memory size is assigned to each category in the SAP database.
During table creation, the SAP system reserves an initial space i.e. an initial extent in the
database. If in any case more space is needed, then additional memory is added according to the
mentioned size category for that table. Correct size category prevents the creation of a large
number of small extents for a table i.e. prevents memory wastage.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Now to enter the data into table go with the menu option Utilities Table Contents Create
Entries as shown in the following figure.
After clicking on Create Entries you will get the following screen.
Maintain the following field values on the above screen fields.
EMP NUM - 101
EMP NAME - AAA
EMP SAL - 25000
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will give
the success message on the standard tool bar as shown in the following figure.
Click on button from application tool bar, then the following screen will appear.
Again enter the one more entry as shown in the following figure.
Maintain the following field values on the above screen fields.
EMP NUM - 102
EMP NAME - BBB
EMP SAL - 23000
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Click on (optional) button from application tool bar then click on back button from
standard tool bar then the following screen will come. In that screen go with menu option Utilities
Table Contents Display as shown in below screen.
Then click on execute button to see the all available entries in the table.
Domain Creation
Domain describes the technical properties of a table field such as data type and length. It defines
value range which helps the user to enter the data between these ranges. A single domain can be
used for number of fields. F4 functionality (List of values) is available with the help of domain. A
Domain is assigned to data element. All fields or structure components that use this data element
then have the value range defined by the domain. Different fields having the same technical type
can be combined in domains.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Select the radio button Domain then enter the desired domain name. Make sure that you have
to follow the naming convention. Name should either start with 'Z' or 'Y'.
Provide the following screen field values on the above screen fields as follows
Domain – ZDNAME
Then click on Create button, it will navigate to the next screen as follows.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Select the button Data element then click on mark or press ENTER to navigate to the
next screen.
Enter the short description as Department Number for an employee and click on the Field label
tab button and enter the lengths and descriptions accordingly.
Then click on Data Type tab button to enter the domain.
Enter the Domain as ZDNO which was already created earlier. Then the details of that particular
domain will be automatically captured by the SAP R/3 system.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Select the radio button Data type then enter the desired data element name. Make sure that
you have to follow the naming convention. Name should either start with 'Z' or 'Y'.
Provide the following screen field values on the above screen fields as follows
Data type – ZDEDNAME1
Then click on Create button, it will navigate to the next screen as follows.
Select the button Data element then click on mark or press enter to navigate to the next
screen.
Enter the short description as Department Name for an employee and click on the Field label tab
button and enter the lengths and descriptions accordingly.
Then click on Data Type tab button to enter the domain.
Enter the Domain as ZDNAME which was already created earlier. Then the details of that particular
domain will be automatically captured by the SAP R/3 system.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Select the radio button Database table then enter the desired table name. Make sure that you
have to follow the naming convention. Name should either start with 'Z' or 'Y'.
Provide the following screen field values on the above screen fields as follows
Enter the Field as DNO, ENO, DNAME and give ZDEDNO, ZDEDNO, ZDEDNAME for respective fields,
which ever created by you earlier.
Then the details regarding the respective data element and domain was automatically fetched by
the SAP R/3 system.
Click on Technical settings push button from application tool bar as shown in the figure.
Then click on back button from standard tool bar then the following screen will come.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on Check (CTRL+F2) button from application tool bar then the following warning
screen will come.
Now click on back button from standard tool bar to arrange the Enhancement Category.
Go with the menu option Extras Enhancement Category then the following screen will appear.
Here click on button or press on ENTER to maintain Enhancement Category then the following
screen will appear.
Then click on the radio button Can Be Enhanced (Deep) then click on or press
Enter.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Now to enter the data into table go with the menu option Utilities Table Contents Create
Entries as shown in the following figure.
After clicking on Create Entries you will get the following screen.
Then click on SAVE (CTRL+S) button from standard tool bar. It will navigate to the following
screen.
Click on button from application tool bar, then the following screen will appear.
Maintain the following field values on the above screen fields.
DEPT NUM - 22
EMP NUM - 104
DEPARTMENT NAME – ELECTRONICS
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Click on (optional) button from application tool bar then click on back button from
standard tool bar then the following screen will come. In that screen go with menu option Utilities
Table Contents Display as shown in below screen.
After clicking on Display, you will get the following screen.
Then click on execute button to see the all available entries in the table.
Structures
Structures are complex data types consisting of multiple fields. In other words it is the description
of group of fields. Structure does not contain any data.
A structure is a sequence of any other data types from the ABAP Dictionary, that is, data elements,
structures, table types, or database tables. When you create a structure in the ABAP Dictionary,
each component must have a name and a data type.
In an ABAP program, you can use the TYPE addition to refer directly to a structure.
Select the radio button Data type then enter the desired Structure name. Make sure that you
have to follow the naming convention. Name should either start with 'Z' or 'Y'.
Provide the following screen field values on the above screen fields as follows
Data type – ZSTRUCT
Then click on Create button, it will navigate to the next screen as follows.
Select the radio button Structure then click on button or press on ENTER then the
following screen will come.
Enter the Field as EHNO, ECITY and give ZDEEHNO, ZDEECITY for respective fields.
Double click on ZDEEHNO data element of EHNO then it will ask you to create data element.
Press “Yes” to create the type as shown in the above figure.
Now it will ask you to save the screen. Then click on “Yes” to save the screen.
Save it as LOCAL OBJECT ($TMP). Then the following screen will appear.
Select the button Data element then click on mark or press ENTER to navigate to the
next screen.
Enter the short description as HOUSE NUMBER FOR EMPLOYEE for an employee and click on the
Field label tab button and enter the lengths and descriptions accordingly.
Then click on Data Type tab button to enter the domain.
Enter the Domain as ZDHNO1 and double click on Domain ZDHNO1 to create Domain for Employee
House Number EHNO field.
It will ask you to save the Data element first, before going to create Domain. Click on “YES”.
Default Definition tab button is selected then Provide the following screen field values on the
above screen fields as follows
Data Type – NUMC
No. Characters – 5
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Double click on ZDEECITY data element of ECITY then it will show a message box that the data
element is not available. Then click on Yes to create it.
Press “Yes” to create the component type.
Select the button Data element then click on mark or press ENTER to navigate to the
next screen.
Enter the short description as City of an Employee and click on the Field label tab button and
enter the lengths and descriptions accordingly.
Then click on Data Type tab button to enter the domain.
Enter the domain as ZDCITY and Double click on Domain to create Domain for Employee City ECITY
field.
It will ask you to save the Data element first, before going to create Domain. Click on “YES”.
Save it as local object. Then the following message will appear on the status bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Give the new field name as .INCLUDE and data element for that field as ZSTRUCT1 (We already
created one) then press on Enter. Then the details regarding that structure was automatically
captured by the SAP R/3 System.
Include Structure is used to add some extra fields to only custom tables. The extra fields can be
added anywhere in the table definition.
To activate and adjust the extra added fields you need to go with database utility. The same
structure can be included in any number of custom tables.
In addition to listing the individual fields in a table or structure, fields from another structure can
be included as includes.
If an include structure is added to define a database table or database structure, a name can be
assigned to that included (included substructure). The group of fields of that include can be
addressed as a whole in ABAP application programs with a group name which is called as named
include.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following information screen.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Now to adjust the database then go with the menu option Utilities Database Object Database
Utility as shown in the following figure.
Click on Activate and Adjust Database push button to adjust the database.
Then click on “Yes” to adjust the send the request. Then the following message will appear in the
status bar.
Now to enter the data into table go with the menu option Utilities Table Contents Create
Entries as shown in the following figure.
After clicking on Create Entries you will get the following screen.
HOUSE NUMBER – 22
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Click on button from application tool bar, then the following screen will appear.
Again enter the one more entry as shown in the following figure.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Click on (optional) button from application tool bar then click on back button from
standard tool bar then the following screen will come. In that screen go with menu option Utilities
Table Contents Display as shown in below screen.
Then click on execute button to see the all available entries in the table.
Append Structure Creation
Here click on button or press on ENTER then the following screen will come to create Append
Structure.
Enter the short description as State of an Employee for an employee and click on the Field label
tab button and enter the lengths and descriptions accordingly.
Then click on Data Type tab button to enter the domain.
Double click on Domain ZDSTATE1 to create Domain for Employee Name ZZSTATE field.
It will ask you to save the Data element first, before going to create Domain. Click on “YES”.
Save it as Local Object then the following screen will appear.
It will ask you to create Domain ZDSTATE for field Employee state ZZSTATE. Click on “Yes” to
create Domain. Then it navigates to the following screen.
No. Characters – 15
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Save it as Local Object ($TMP) then the following success message will come on Status Bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Then click on back button from standard tool bar then the following screen will come.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Now to enter the data into table go with the menu option Utilities Table Contents Create
Entries as shown in the following figure.
After clicking on Create Entries you will get the following screen.
Click on button from application tool bar, Again enter the one more entry if you want.
Click on back button from standard tool bar then the following screen will come. In that
screen go with menu option Utilities Table Contents Display as shown in below screen.
Then click on execute button to see the all available entries in the table.
To add data for the extra added fields for an employee follow the below process.
Select the Entry then click on change button from application tool bar.
After clicking on Change button the following screen will appear to update the details of an
employee.
Maintain the following field values on the above screen fields.
HOUSE NUM - 55
CITY NAME - KOLKATA
EMP STATE - WEST BENGAL
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Then click on back button from standard tool bar then the following screen will come.
In the above screen you can observe the updated details of an employee.
Value Table
Value table is maintained at domain level in SAP. During domain creation, value range of the
domain is defined by specifying value table. Suppose for a particular domain, its value table holds
the values „A‟, „B‟, „Z‟. So whenever the domain will be used, system will allow using these values
only.
In other words Table specified in the definition of a domain and is checked against all the fields
that points this domain. If you define a foreign key for a field that points this domain, then the
value table is proposed as a check table for the foreign key table.
Relationships between tables are defined in the ABAP dictionary by creating foreign keys. Using
foreign keys (as main table-field is linked with check table), input value check for any input field
can be done.
Foreign keys can also be used to link several tables.
One field of the foreign key table corresponds to each key field of the check table. Then that field
is called as foreign key field.
Uses: A foreign key permits assigning data records in the foreign key table and check table. One
record of the foreign key table uniquely identifies a record of the check table (using the value
entries in the foreign key fields of the foreign key table).
Enter the SE11 in the command field to go with ABAP Dictionary.
Select the radio button Database table then maintain the following field values on the above
screen fields.
Database table – ZEMP
Then click on Change button to attach value table at the domain level of an employee number of a
database table ZEMP.
Double click on Data element ZDDENO of field ENO then the following screen will appear.
Double click on Domain ZDENO of ENO field.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Check Table
The check table is used to check whether the input values are valid and for the input help (F4
help).
Check table, in other words, values occurring in the primary key of the check table. A foreign key
provides a link between two tables, for e.g. T1 and T2 by including a reference in table T1 to the
primary key of table T2. For this purpose, foreign key fields assigned to the primary key fields of T2
are included in T1. Table T1, which is the one being checked, is called a foreign key table, and
table T2 is called a check table. The terms dependent (foreign key) table and referenced (check)
table are also used.
Enter the SE11 in the command field to go with ABAP Dictionary.
Select the radio button Database table then maintain the following field values on the above
screen fields.
Database table – ZDEPT_EMP
Then click on Change button to assign foreign key then it will navigate to the next screen as
follows.
Here we are going to connect the ZEMP table with ZDEPT_EMP by using foreign key. So here to
connect two tables by using foreign key we have some rules.
The domain names of the field in foreign key table and for the field in check table should be same.
Here we have ENO field with data element ZDEENO which is same in value table also.
The field in check table should be primary key. In value table (ZEMP), ENO is the primary key. So in
ZDEPT_EMP table check the Key and Initial as true as shown in the following figure.
Select the ENO field then click on foreign key icon as shown in the above figure.
It will show you the message that no foreign key exist for this table then click on Yes to create the
foreign key. Then the following screen will appear.
Maintain the following field values on the above screen fields.
Check Table - ZEMP then press Enter
Foreign Key Field type - Key Fields/Candidates
Cardinality - 1 : CN
Then click on Copy button then the following screen will appear on the status bar.
Cardinality:
The cardinality (n : m) describes the foreign key relationship with regard to the number of possible
dependent records (records of the foreign key table) or referenced records (records of the check
table).
The left side (n) of the cardinality is defined as follows:
n=1
There is exactly one record assigned to the check table for each record of the foreign key table.
n=C
The foreign key table can contain records that do not correspond to any record of the check table
because the foreign key field is empty. This can occur, for example, if the field of the foreign key
table is optional, in which case it does not have to be filled.
The right side (m) of the cardinality is defined as follows:
m=1
There is exactly one dependent record (record of the foreign key table) for each record of the
check table.
m=C
There is at most one dependent record for each record of the check table.
m=N
There is at least one dependent record for each record of the check table.
m=CN
There can be any number of dependent records for each record of the check table.
Then click on SAVE (CTRL+S) button from standard tool bar. It will navigate to the following
screen.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then one screen will
appear.
In that screen click on button or press ENTER then the following message will come on the
status bar.
Now to enter the data into table go with the menu option Utilities Table Contents Create
Entries as shown in the following figure.
After clicking on Create Entries you will get the following screen.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
The error message describes that the particular employee number is not available in check table
(ZEMP), so here we can‟t assign a department for invisible person. So take an Employee number
which is available in ZEMP table. For example take EMP NUM as 110.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Click on back button from standard tool bar then the following screen will come. In that
screen go with menu option Utilities Table Contents Display as shown in below screen.
After clicking on Display, you will get the following screen.
Then click on execute button to see the all available entries in the table.
Views
Data about an application object is often distributed on several tables. By defining a view, you can
define an application-dependent view that combines this data. The structure of such a view is
defined by specifying the tables and fields used in the view. Fields that is not required can be
hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.
The data of a view is derived from one or more tables, but not stored physically.
Database View
A database view provides an application-specific view on such distributed data.
Database views are defined in the ABAP Dictionary. A database view is automatically created in the
underlying database when it is activated.
Application programs can access the data of a database view using the database interface. You can
access the data in ABAP programs with both OPEN SQL and NATIVE SQL. However, the data is
actually selected in the database.
Database view adopts Inner Join technique.
Inner Join: It joins two tables based on foreign key and fetches all the matched records of both
the tables.
Select the radio button View then enter the desired view name. Make sure that you have to
follow the naming convention. Name should either start with 'Z' or 'Y'.
Select the radio button Database view then click on button then it navigates to the
following screen.
Go with Dependent Tables, Select MARC and MARD then press enter.
Click on Table Fields push button from the above screen to select the fields.
Select MARC and click on Choose button to select the fields from MARC table.
Now select the WERKS, EKGRP, MINBE and BSTMI from the field selection screen of MARC then
click on Copy button press Enter.
Click on Table Fields push button from the above screen to select the fields from MARD database
table.
Select MARD and click on choose button to select fields to select the fields.
Now select LGORT, LABST from the field selection screen of MARD then click on Copy button.
Click on SAVE (CTRL+S) button from standard tool bar. It will navigate to the following screen.
Save it as local object. Then following message will come in status bar.
Then click on Maintenance Status tab button as shown in the below figure.
Notify that we can only read database views with more than one table from the above table.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
To view the data of these three tables go with the menu option Utilities Contents.
The above screen displays the details regarding the three database tables MARA, MARC and MARD
based on Inner Join technique.
In database view selection condition is available.
To do those go back two times from the above data browser screen.
Click on Selection Conditions tab button as shown in the above figure.
Maintain the following field values on the above screen fields.
Table - MARA
Field Name - MATNR
Operator - EQ
Comparison Value - „BM-1330‟
That means the material number value equal to „BM-1330‟ have to be fetch by the data browser.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
To view the data of these three tables go with the menu option Utilities Contents…
After clicking on the Contents the following screen will appear.
Then click on execute button to see the all available entries in the table.
Projection View
Projection views are used to hide fields of a table. This can minimize interfaces; for example when
you access the database, you only read and write the field contents actually needed.
A projection view contains exactly one table. Projection view is a logical one and adopts Left Outer
Join technique.
You cannot define selection conditions for projection views.
Projection view used to View and change the data of a single database table.
There is no corresponding object in the database for a projection view. Access to a projection view
is mapped by the SAP System onto the corresponding access to its base table. It is also possible to
access pooled tables or cluster tables with a projection view.
Select the radio button View then enter the desired view name. Make sure that you have to
follow the naming convention. Name should either start with 'Z' or 'Y'.
Maintain the following field values on the above screen fields.
View – ZPVIEW
Then click on Create button, it will navigate to the next screen as follows.
Select the radio button Database view then click on button then it navigates to the
following screen.
Click on Maintenance Status tab button from above screen to change the access criteria.
Select the radio button Read and change then click on Activate (CTRL+F3) button from
application tool bar then the following screen will appear.
Save it as Local Object then the following activation screen will come.
Here click on button or press on ENTER then the following message will come on the status
bar.
To view the data of these three tables go with the menu option Utilities Contents.
The above screen displays the details regarding the database table MARA.
Lock Objects
Lock Objects prevents several users to change a data record at the same time.
The SAP System synchronizes simultaneous access of several users to the same data records with a
lock mechanism. When interactive transactions are programmed, locks are set and released by
calling function modules. These function modules are automatically generated from the definition
of lock objects in the ABAP Dictionary.
When you create a lock object System automatically create two function modules.
ENQUEUE_<Lock object Name>: This Function module is used to create the lock object in a
queue.
DEQUEUE_<Lock object Name>: This Function module is used to remove the lock object being
locked by above function module.
Exclusive lock (E) / Write Lock: The Locked data can only be edited and displayed to a
single user. Other lock requests are rejected.
Technically an exclusive lock protects the locked object against all types of locks from
other transactions. Only the same lock owner can reset the lock.
Shared lock (S) / Read Lock: Several users can access locked data at the same time in
display mode. A request for another shared lock is accepted, even if it comes from another
user. A write lock set on an object that already has a shared lock will be rejected.
Exclusive but not cumulative lock (X): Exclusive locks can be requested several times from
the same transaction and are processed successively. In contrast, exclusive but not
cumulative locks can be called only once from the same transaction. Each further lock
request will be rejected.
Select the radio button Lock Object then enter the desired Lock Object name. Make sure that
you have to follow the naming convention. Name should either start with 'EZ' or 'EY'.
Provide the details here as follows
Lock Object – EZLOCK1
Then click on Create button, it will navigate to the next screen as follows.
Maintain the following field values on the above screen fields.
Short Description as - LOCK OBJECT
Name - MARA
Lock Module - E Write Lock
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
To see the system created Lock modules go with the menu option Goto Lock Modules as shown
in the following figure.
After clicking on the Lock Modules the following screen will display to show the function modules.
Select the radio button Database table then enter the desired table name. Make sure that you
have to follow the naming convention. Name should either start with 'Z' or 'Y'.
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. Then the
following message will come on the status bar.
Then click on Check (CTRL+F2) button from application tool bar then the following message
will come on the status bar.
Then click on Activate (CTRL+F3) button from application tool bar then the following screen
will appear.
Here click on button or press on ENTER then the following message will come on the status
bar.
Now to enter the data into table go with the menu option Utilities Table Contents Create
Entries as shown in the following figure.
After clicking on Create Entries you will get the following screen.
Maintain the following field values on the above screen fields.
EMP NUM - 141
EMP NAME - HHH
EMP SAL - 25000
Net Value - 24500
Doc. Currency - INR
Then press ENTER after that click on SAVE (CTRL+S) button from standard tool bar. It will
navigate to the following screen.
Click on (optional) button from application tool bar then click on back button from
standard tool bar then the following screen will come. In that screen go with menu option Utilities
Table Contents Display as shown in below screen.