Vous êtes sur la page 1sur 9

ABAP Data Dictionary

ABAP Dictionary [T-CODE SE11]

1. ABAP Dictionary is a central repository where we define and maintain the objects
which are related to database [ABAP Dictionary is a central repository which is
a collection of the objects related to Database].
2. Define means creation of objects
3. The Objects are Tables, Views, Structures, Domains, and Data Elements.
4. Maintenance means changing and deleting the objects.

The objects are,

Database Table

1. It is an object which stores data in the form of rows and columns.


2. A Table is a collection of rows and columns.
3. Each [A]row is called as record, and each [A] column is called as field.
So, to define a table we have to define the fields first.
So, to define a field, we have to specify the below things:

ABAP team will defined the columns in the table


End-user will create the rows.
So, to define column (or) fields, we have to specify

Field = Domain + Data Element


What is Domain

Domain is an object which specified technical information of a field in a


table
Ex: Data type, length, value range etc.

What is Data Element

Data element is an object which specified semantic information such as a Field


description, field labels (short, medium, long and heading) for a field.

(We all know that table is a collection of fields, ex: STUDENT is a table
with fields STUDENT_ID, STUDENT_NAME ext, and Data element
specifies the field labels and headings for these fields).

Advantages of data element and domain:

Reusability: The same data element and domain can be reused by multiple table fields,
Instead of creating again and again.
These are also used in creating foreign key relationship, search help, ale-idocs.

Key field: A field which is used to identify the record uniquely is called a key field. In a
table there should be at least one key field. We can create ____ number of key fields.

Why we use Data elements and Domains in SAP?

When ever we are creating a new table or adding a field to existing


table, we need to specify field labels and data types for the field; in
SAP we maintain these values in the form of Data elements and
Domains.

Create a table SE11

Create Domain SE11

Create Data Element SE11

Why Domains & Data Elements

In Real-time, we use Domains & Data Elements for reusability that means, once we can
create the Domain and Data Element for CNO [OR] CNAME we can use same in N
Number of Tables.
NOTE:

1. Provide Delivery class A.


2. It is used for Controlling the Transport of the Data. The Delivery class can be
either A or C.
3. A is called as application table which can be used for storing master and
transaction Data. C is called customizing table used for storing custom specific
data.
4. Select Display Maintenance allowed with Restrictions.
a. It allows only display of data but we cannot perform DML operations. DML
b. Operation include INSERT, UPDATE, DELETE
If we choose
5. Select Display Maintenance allowed it supports all the operation.
If we choose
6. Select Display Maintenance not allowed it does not support any of operation.
a. Under fields tab data type column will be disabled. Click on the predefined
b. Types button to enable it.
7. Select Display Maintenance Allowed and select fields tab after Click on Field Tab.

Displaying the Table Rows (Table) Contents:

Click on utilities -> table contents -> display

Click on execute button

The records will be displayed

Note:

Sometimes we may get unpredictable errors in a table, due to adding or deleting the fields
in a table. To solve the error follow the below steps.

Go to SE14Provide the table name

Click on edit button

Click on activate and adjust database button


Using MANDT (Client Number) is Field in Tables:

If we use MANDT (Client Number) in the table, the data will be stored in a Single Client
i.e., logged in Client instead of the all the clients. There by providing security to the data.

CLIENT NUMBER

1. It is a unique number which is used to provide security to the data at the database
level.
2. In the real time, based on the client no only, usernames will be created and the
access will be given.
3. In the real time, normally we use the client number (100,120), (200,220),
(300,320).
4. The field name, data element, and domain for client number is MANDT.

Types of tables based on client number


What is View

A View is a Collection of fields from multiple tables.


A view doesnt store any data.
When view is executed, the data is selected and displayed.
To join the multiple tables we need to help common key fields.
For Ex: CNO, MATNR, EMPNO, MATERAL NO

There are two types of Joins:

Inner Join

1. The common data b/w the joined tables will be selected.


2. The uncommon data will not be selected.

Outer Join

1. The data from left / first table will be first


2. If there is any match record in the 2nd / 3rd table the data selected & displayed.
3. If there is no matching records in the 2nd / 3rd table the data displayed as Blank.

There are 4 types of views

1. Database view
2. Projection view
3. Help view
4. Maintenance view

Database view:

1. A view created on two or more tables using inner join concept is called database
view
2. In this view we can only read the data
3. We can provide selections to read the data
4. We cannot maintain the data

Projection view
1. A view created on single table is called projection view. Projection views are
mainly used to minimize the database interface (number of fields) and improve the
system performance.
2. In simple words, we can hide the unnecessary fields from a single table
3. We can maintain the data in the projection views.
4. We cannot provide any selections in the projection views.
Help view:

1. A view created on two or more tables using outer join concept is called help view.
2. Help view are specially designed for search helps.
3. We cannot execute help views directly; instead we have to include help views
inside the search helps.
4. We cannot maintain the data in help views.
Maintenance view:

1. A view created on two or more tables using inner join concept is called
maintenance views
2. We can maintain the data in maintenance views
3. Maintenance view are used by SAP for internal purpose
4. In the real time we dont create any maintenance views because the data should be
saved or modified in multiple tables which lead inconsistency
5. If we want save or modify the data, we have to use standard SAP transactions or
BAPIs

Data type

It helps in creating the user defined Data Elements, Structure and Table Types.

Structure

Structure is a Container (Collection) of reusable fields.


Structures are defined in data dictionary.
Once structures are created we can reuse them in Tables, Programs.
There are two options for including the structures in tables

o Include structures
o Append structures

Ex: address filed, tax field, sales Data fields etc.


Note: Structures does not store any Records [OR] Rows because it just a Collection of
Fields. But tables will store the Rows & Fields.

Difference between .include structure and .append structure

.include structure

.include structure is used include structure in our tables i.e. Z/Y tables.
.include structures are reusable.

.Append structure

.Append structure is used to add extra/new field to Standard SAP tables.


.append structures are not reusable.

Table Types & Normal Types

A Type with list of Fields is called Normal Types.


A Type with Occurs [ZERO] [OR] Type Table of is called Table Type.
Table Types are used in OOPS-ABAP, webdynpro, and workflow.

Note: Methods using table types

TABLES PARAMETER:

In the methods, we dont have any option for specifying internal tables directly.
Whereas in function modules, we have an option by name TABLE where we can
specify the internal tables directly.
Tables are absolute in OOPS-ABAP.
Thats why this option is not available.
If we want to use tables parameters, then we need to create a table type in data
dictionary.
TYPES
It is a collection of user defined fields or own fields instead of All the fields from SAP Table.

Syntax for Normal Type [TYPES]

TYPES: BEGIN OF TY_NAME1


F1
F2
.
.
F4
END OF TY_NAME1
Syntax for Table Type

Types: TY_NAME2 TYPE TABLE OF TY_NAME1

[OR]

Types: TY_NAME2 TYPE TY_KNA1 OCCURS ZERO [0].

Type Group [OR] Type-Pools:

It creates the data group types in dictionary

Search help:

It defines the search help (F4) for the fields of database table and helps in providing the
values for a user search queries.

Lock objects:

It is used to synchronize the same data by one user or multiple users. SAP provides
Three types of lock objects Read lock, write lock, enhanced lock.

SAP User Details

1. Login to another Client 810 with same user name & password.
2. Open the Same table and display the data.
3. The above Data is displayed, that means there is No Security to the Data.
4. We have created the data in 800 Client, but it is visible in 800 & 810 also.
Since there is 200 Security.

Vous aimerez peut-être aussi