You are on page 1of 13

SAP ABAP Training

By: Hamad Ahmad


SAP ABAP Trainer
Table of Contents for 8th Week
Su ABAP DICTIONARY
01

Su TYPES OF TABLE
02

Su DOMAIN
03

Su DATA ELEMENT
04

Su Pooled Table and Cluster Table


05

Su Difference of Pooled Table and Cluster Table


06
ABAP DICTIONARY

What is Data Dictionary or ABAP


Dictionary:
This is the main tool so far in the SAP system.

ABAP Dictionary is used to create and manage data definitions


(metadata). ABAP Dictionary is used to create Tables, Data Elements,
Domains, Views, Lock Objects etc.

SQL can be divided into following 2 parts.


• DML – Data Manipulation Language
• DDL – Data Definition Language

DML part consists of query and update commands like SELECT,


UPDATE, DELETE, INSERT etc. ABAP programs handle DML part of
SQL.

DDL part consist of commands like CREATE TABLE, ALTER TABLE,


DROP TABLE, CREATE INDEX etc. ABAP Dictionary handles DDL part of
SQL.
ABAP DICTIONARY

Transaction Code use to access Data


Dictionary
Transaction code is SE11 for ABAP Dictionary.

Alternatively you can access it through under the


Sap menu->tools -> ABAP Workbench -> Development -> ABAP
dictionary.

When you double click on it ABAP Dictionary:


initial screen will appear.
ABAP Data Dictionary Objects
Option Description

Table is a logical structure for storing data. Table is the set of rows and columns that are logically related.
Table can be defined independent of the database in ABAP dictionary.
Tables
The table fields are defined with the database independent elementary data types and lengths.
The physical table definition created in the database when the actual table activated in the data dictionary.

View is a logical representation of summarized data from two or more tables.


Views The view structure can be defined by specifying table names and required field names from the joined tables.
View is not stored physically. ABAP supports different view types like database views, projection views, help views and maintenance views.

Specifies the user defined data types stored in ABAP dictionary. These types stored in ABAP dictionary and available for all the programs.
There are three predefined Types in ABAP dictionary and those are -
Types Data elements - Describes elementary types and reference types.
Structures - Specifies the record declaration and used only during the execution of a program.
Table types - Describes the structure and functional attributes of internal table.

Specifies the technical characteristics of a table field.


Domain assigned to a data element and defines a value range.
Domains
Any value of the table field that linked to a data element range also defines by a domain.
Fields or components that assigned to a same domain gets changed if domain changed.

Search help is a tool to search for the data records in the system.
The input help(F4) is a standard function for search help in R/3 system.
Search helps
The user can display the field possible values list with search help.
Search help can categories into two types and those are - elementary search help and collective search helps.

Lock mechanism allows simultaneous accessing of same data records by two or more users at the same time.
Lock Objects Functional Modules are responsible for set and release the locks. Function modules are automatically generated from the lock objects definition in the ABAP/4
Dictionary.
SAP - Type of DDIC Table

Type of Data Dictionary Table


There are three types of SAP DDIC table that you can define - 3. Pooled Table

1. Transparent Table A pool table is also a SAP Proprietary which has a many-to-one relationship with a table in the
database. For one table in the database, there are many tables in the Data Dictionary. The table in
the database has a different name than the tables in the DDIC, it has a different number of fields,
A transparent table in the dictionary has a one-to-one relationship with a table in the
and the fields have different names as well.
database. Its structure in R/3 Data Dictionary corresponds to a single database table.
For each transparent table definition in the dictionary, there is one associated table
in the database. The database table has the same name, the same number of fields, Restrictions on Pooled and Cluster Tables: -
and the fields have the same names as the R/3 table definition. They are used to
hold application data. Application data is the master data or transaction data used by  Pooled and cluster tables are generally used only by SAP and not used by developers, due to
an application. proprietary format of these tables within the database and technical constraints to use within
ABAP/4 programs.
2. Cluster Table  Secondary Indexes cannot be created on Pooled and Cluster Tables.
 Can't be use ABAP/4 SQL construct 'Select Distinct' or 'Group By'.
A cluster table is a SAP Proprietary which has a many-to-one relationship with a table  Native SQL cannot be used on Pooled and Cluster Tables.
in the database. Many cluster tables are stored in a single table in the database  Field names cannot be specify after the 'Order By' clause. 'Order By' with primary key is only
called a table cluster. It holds many cluster tables. In cluster table, tables have a part allowed.
of their primary keys in common.
Note: You can't use a pooled table with a join. In case of Table Pool and Table Cluster, within a
A cluster is advantages in the case where data is accessed from multiple tables technical setting you can only change SIZE.
simultaneously and those tables have at least one of their primary key fields in
common. Cluster tables reduce the number of database reads and thereby improve
performance.
Pooled Table and Cluster Table

Pooled Table and Cluster Table SAP - DDIC - Table Pool and Table Cluster
Important Note on Pooled Table and Cluster Table Table pool and table cluster both contains the number of pool table and cluster table respectively.
They are created through SE11. Go to Menu Bar Utilities->Other Dictionary Objects. They
have a fixed no of fields (parameters), but you can change this. They have also got fixed key which
 For creating pooled table or cluster table you will have to assign the Table pool or
you can change. Precaution is required while doing so. The important thing to note is that the sum of
Table cluster in the 'Delivery and Maintenance' tab.
key field's total length should not get exceeded to 120 char, else it will give error.
 You can set technical setting as well like in transparent table.
 In pooled table, you cannot use indexes and append structure features.
Following are the points to be noted further -
 In cluster table, you cannot use indexes features but can use append structure.
 For cluster table you will have to define a key which will match to table cluster to
• Table Pool and Table Cluster contains predefine fields and keys which you can change.
which it has been assigned.
• You can define a technical setting for both but in this you have only option to change the SIZE and
 For both pooled table and cluster table it is recommended to use MANDT client
nothing else (like data class, or buffer settings, or log option) you can set.
field, but this is not mandatory.
 Both pooled table or cluster table exist physically in database.
    Example of Cluster Table
 To access pooled table or cluster table you can write a direct OPEN SQL query
     BSEG - Accounting Document Segment
(Not NATIVE) same as you write for transparent table.
     EDID4 - IDoc Data Records from 4.0 onwards
     BSET - Tax Data Document Segment
The Differences Between Pooled Table and Cluster Table      BSEC - One-Time Account Data Document Segment
     BSED - Bill of Exchange Fields Document Segment
 In pooled table both INDEX and APPEND STRUCTURE is disabled while in cluster
only INDEX is disabled.     Example of Table Cluster
 Cluster table must have one key common but this is not the case for pooled table.      RFBLG - Cluster for accounting document

    Example of Pool Table


     A004 - Material
     A005 - Customer/Material
     T001S - Accounting Clerks

    Example of Table Pool


     KAPOL - Condition pool: Prices and surcharges and discounts
SAP DDIC - DOMAIN

Data Dictionary Domain SAP DDIC - Domain


What is Domain ?
Q. What is value range in domain? What type of value range you can
A domain describes the technical attributes of a field, such as the data type define?
or the number of positions in a field. The domain defines primarily a value
range describing the valid data values for the fields referring to this domain. A. In value range you can define a fix value for F4 help. There are two type of value
range you can define.
You can define following thing in domain-
      1. Single Values and
In Definition Tab
      2. Intervals.
1. Data Type
2. No. Of Characters The value range of a domain can be limited by defining fixed values. In this case,
3. Decimals only the values entered in the fixed values are possible for all the table fields
4. Output length referring to this domain. The fixed values can be single values or intervals.
5. Conversion Routine
6. Sign (a check box) Note: You can only define fixed values for domains of data types CHAR, NUMC,
7. Lowercase (a check box) DEC, INT1, INT2 and INT4.

In Value Range Tab

1. F4 Help fixed Ranges


2. Value Table
SAP DDIC - Data Element

Data Dictionary Data Element SAP DDIC – Data Element


What is Data Element ? Important Notes:

Data Element defines the data type, structure component, field labels, search You cannot use domain to define parameter or select-options or variable or even you can't define the
type from the domain. For example, MENG13 is a domain, and you can't define this -
help, search help etc.
TYPES: P9 TYPE MENG13. [It will throw error]
There are two types in which data element is describe
1. Elementary Type You can define variable either using data element or you can use table or structure component. Like
2. Reference Type EDIDD is an structure, from this you can define both variable and define the TYPES as well.

Elementary type is define by the built-in data type, field length and decimal TYPES: P10 TYPE edidd-docnum. [This will work perfectly]
places. Whereas Reference type defines the type of reference variable in
ABAP program.

Data Element is used for defining:

1. Data Type
2. Field Label
3. Search Help
4. Parameter ID
5. Change document flag
6. Further Characteristics
Roll Numbers Roll No.
ABAP-E-3-2-110
Student Name
Muhammad Nawaz
ABAP-E-3-2-259 Asma Shahzad
ABAP-E-3-2-459 Hamza Qayoom
ABAP-E-3-2-144 Muhammad Ismail Zia
ABAP-E-3-2-37 Adeel Saeed
ABAP-E-3-2-343 Saad Mehmood
ABAP-E-3-2-159 Muhammad Awais Aleem
ABAP-E-3-2-168 Muhammad Ayub
ABAP-E-3-2-452 Muhammad Farooq
ABAP-E-3-2-191 Arslan Mazhar
ABAP-E-3-2-451 Waqar Hussain Shahid
ABAP-E-3-2-197 Danish Gul
ABAP-E-3-2-340 Qayyum Ahsan
ABAP-E-3-2-254 Hafiz Muhammad Abubkar
ABAP-E-3-2-397 Umar Farooq
ABAP-E-3-2-398 Mateen Munir
ABAP-E-3-2-400 Fahad Khalid
ABAP-E-3-2-401 Zain ulabdeen
ABAP-E-3-2-357 Muhammad Abubakar Saeed
ABAP-E-3-2-377 Aniya Raees
ABAP-E-3-2-413 Abdul Ahad
ABAP-E-3-2-204 Muhammad Ubaidullah
ABAP-E-3-2-418 Hassan Zulfiqar
ABAP-E-3-2-349 Syed Zia Ud Din Ahmed
ABAP-E-3-2-407 Wajid Yousaf
Roll Numbers Roll No.
ABAP-M-2-1-12
Student Name
Muhammad Jhanzaib
ABAP-M-2-1-208 Taimur Ul Hassan Ghouri
ABAP-M-2-1-294 Maryam Arshad
ABAP-M-2-1-310 Faisal Yasin
ABAP-M-2-1-461 Malik Omer
ABAP-M-2-1-1 Syed Ali Mubashar Kazmi
ABAP-M-2-1-85 Mughees Ahmed Mirza
ABAP-M-2-1-9 Sher Ali
ABAP-M-2-1-31 Muhammad Hamid
ABAP-M-2-1-35 Umer Munir
ABAP-M-2-1-447 Kamil Humayun Mirza
ABAP-M-2-1-148 Nadeem Saleem
ABAP-M-2-1-332 Usman Anwar
ABAP-M-2-1-43 Hafiz Muhammad Ishtiaq
ABAP-M-2-1-47 Zain Khawar
ABAP-M-2-1-50 Hamza Amjad
ABAP-M-2-1-52 Muhammad Raza Liaqat
ABAP-M-2-1-62 Hassan Arif
ABAP-M-2-1-82 Rizwan Saeed Khawaja
ABAP-M-2-1-226 Usama Azeem
ABAP-M-2-1-211 Muhammad Faizan Razzaq
ABAP-M-2-1-104 Safi Ur Rehman
ABAP-M-2-1-84 Hafiz Muhammad Naveed
ABAP-M-2-1-330 Muhammad Sumair
ABAP-M-2-1-395 Muhammad Hussain
For feedback, please write at

academy@exdnow.com

Thank you!

*To download application forms, kindly click the below link;


https://cloud.exdnow.com/s/k4Fb52tZfiMf4x5

You might also like