Data Dictionary
Data Dictionary
Select Create.
Give client field and data element.
Save it.
Data Element
Select Yes.
Select Local Object.
Click on Yes.
Save – Check and Activate.
Select
Local
Object.
Activate (Ctl+3).
Select Domain and Data element.
Follow same steps and create remaining data element and domains.
Sr.N Fields Data Element Data Type Length Decimal Short Description
o
1 MANDT MANDT CLNT 3 Client
2 Order_N Zonum NUMC 12 Order Number
3 ODate ZDate DATS 8 Order Date
4 Vendor Zvname CHAR 30 Vendor Name
5 POrg EKORG CHAR 4 Purchasing Org
6 Total_A Ztotal CURR 7 2 Total Amount
7 Currency ZCrn CUKY 5 Currency
Save it.
Back.
Change Entry
Save it.
Give table name and select Edit.
Continue.
Now select two steps.
Click on find scr. Number(s).
Continue
You will get screen number.
Structure
There are two types of structure.
1. Include
2. Append
1. Include Structure.
Suppose I want to add delivery date and address in below table.
Sr.N Fields Data Element Data Type Length Decimal Short Description
o
1 MANDT MANDT CLNT 3 Client
2 Date ZDate DATS 8 Order Date
3 Order_N Zonum NUMC 12 Order Number
4 Vendor Zvname CHAR 30 Vendor Name
5 POrg Zporg CHAR 4 Purchasing Org
6 Total_A Ztotal CURR 7 2 Total Amount
7 Currency ZCrn CUKY 5 Currency
8 Ddate ZDdate DATS 8 Delivery Date
9 Dadd ZDadd CHAR 40 Delivery Address
First we need to create Data element and Domain for Delivery date and Address.
Use Tcode: SE11
Give Domain name and click on create.
Continue.
Give description and Domain name.
Select field label.
Continue.
Save and activate.
Save – activate.
We will insert
include structure
here
Enhancement category
More-Extras-Enhancement category.
Copy –Save – activate.
Append Structure
Continue.
Double click on Zonote.
Yes.
Save in your customizing request or local object.
Save – activate.
Order Item table.
Sr.No Fields Data Element Data Type Length Decimal Short Description
2.Click on
primary key
1.Select
common field
3. Give check
table
Click on copy.
Yes.
Cardinality means number of record available in primary table corresponding to foreign key table.
Tcode: SM30
New entries.
Save it.
Index
Indexes are used to avoid the duplicate data and improve the performance while accessing the table.
1. Primary Index: Primary indexes in SAP are created automatically by the SAP system using key fields of
database tables.
2. Secondary Index: Secondary Indexes are created manually and managed by the SAP ABAP consultant. We can
create up to 9 secondary indexes.
1. Transparent table.
2. Pooled tables
3. Cluster table
Views
Views are the data dictionary repository objects in ABAP, which are used to view the data of several tables in
one place.
A view is similar to the database table, but it does not contain any physical data, instead it derives data from
different tables and acts like a virtual table (table without any existence). Since it does not physically store any
data, and the database only contains the view definition, hence it takes very little space in the database.
1. Database view
2. Projection view
3. Maintenance view
4. Help view
➢ If a view is created on one or more tables by combining the fields using inner join, such a view is called
Database view. Since this view uses the inner join, it only combines the matching records from the table.
➢ Go to SE11. Click the radio button in front of View option, and give a name to the view then click the
create button given on the screen.
Click on create.
➢ When we click on the Relationships button, all the tables with the foreign key relationship with the base
table (EKKO) will be displayed.
Onc
e we will select the EKPO table, all the join conditions field names will be filled automatically.
Move to the next tab, which is View fields, to select the fields of both tables that we want to display
After selecting the fields, click on the Copy button. Similarly, we will choose the Fields of another table
(EKPO).
Click on Table field.
We display the records that we have selected using the database view. Click on the Content option given at the
screen.
Can view all the records using the execute button given at the above image. It will display all the records.
2) Creation of Projection view
➢ ABAP Projection views are special views used to hide some fields of a database table and display only the
required or selected fields. Hence, using this type of view, we can minimize the fields by projecting only required
fields and rest fields will be filtered out.
➢ This view allows us to read and also maintain the needed data.
Steps:
A pop-up window will appear with all the views, from where select the “PROJECTION VIEW”.
➢ Provide basis table for the table which view to be created.
Display content.
Execute.
➢ Maintenance view is created on two or more tables, which is used to maintain the data of several tables
altogether. It helps us to maintain the complex application objects easily.
➢ It can combine several tables in a single unit, but the tables must have a foreign key relationship.
STEPS:
➢ Go to SE11 Click the radio button in front of View option, and give a name to the view then click the create
button given on the screen.
Click on create.
Click on the Table/Join Conditions tab; provide the name of the primary table for view under the Table column.
Click on relationships
Go to the View fields tab, click on the Table Fields button to select the fields from each Table (primary and
secondary).
Go to the Maint. Status tab and select the appropriate radio button. Select the other fields.
Save and Activate.
Go to the Utilities> Table Maintenance Generator. Fill the details as shown. Save it and activate the view.
➢ The Help views are created on two or more tables, specifically for the "Search helps" object in DDIC. It means
they are used to provide the input helps (F4) option for different fields in ABAP.
➢ When going to search help, views with outer join act as the selection methods and these methods can be
either a table or a view, which specifies that data can be selected from a view or table. For such purpose, we
need to create the help views in ABAP.
Copy.
To Avoid Parallel access, we use lock objects. is used to synchronize access to the same data by more than one
program.
Whenever we create a lock object two function module will be created.
1. Write/Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another
exclusive lock or for a shared lock is rejected.
2. Read/Shared lock: More than one user can access the locked data at the same time in display mode. A
request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.
3. Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and
are processed successively. All other lock requests are rejected.
➢ Enter the name of lock object starting with E and click the Create button.
Enter the table name in Name field and select the lock mode as Shared Lock.
Click on Lock parameter tab, the following screen will appear.
Save and activate. Automatically 2 function modules will generate. To check function modules, we can use Go to
→ Lock Modules.
Providing a help for the list of the values to be selected on input field is called search help.
Collective search help: Group of elementary search help for a single input field is called collective
search help.
Go to SE11
Select search help radio button and provide name.
Click on ‘Create’.
TYPES OF TABLES
There are 3 Types of tables:
1. Transparent tables
2. Cluster tables
3. Pool tables
Transparent tables: - Transparent tables are one to one relationship. That is if you
create one transparent table in the data dictionary, then it’ll store like only one data
base table in the data base.
Cluster table: - This tables are many – one relationship. That is if you create the
many clustered tables in DDIC then they will form like a table cluster & store in
the data base. Buffering isn’t possible for clustered table. From this reason only
fetching the data from clustered table take more time. Clustered table is suitable
when you fetch the fewer amounts of data from more fields.
Pooled table: - Pooled tables are many – one relationship. That means if you create
many pooled tables in DDIC, then they will form like a table pool & stored in
the data base. Pooled tables are suitable when we fetch the large amount of data
from fewer fields.