ABAP Data Dictionary
ABAP Data Dictionary
com
1
SAP ABAP Consultant [email protected]
2
SAP ABAP Consultant [email protected]
ABAP data dictionary is a tool provided by sap for centrally create, view and
maintain data definitions, related to database. We can use data dictionary to create objects
like table and view and it is also use to create and maintain global user define types like data
elements, domain, structure, table type etc. which can be used by abap program.
3
SAP ABAP Consultant [email protected]
4
SAP ABAP Consultant [email protected]
1. Database Tables : – Database tables are the collection of fields which contain physical data
It is an object that stores data in the form 0f rows and columns.
5
SAP ABAP Consultant [email protected]
Transparent Table : When we create and activate the transparent table with abap dictionary
i.e with SE11, in the underlying database a table is created with same name and data
definition, it has one to one relation with table in database.
Pool Table : Pool tables are used to hold the large number of small tables ( customizing or
system data tables).
Cluster Table : They are used to hold the few number of large table.
6
SAP ABAP Consultant [email protected]
Transparent Table :
Pool Table :
Cluster Table :
7
SAP ABAP Consultant [email protected]
Understanding sap standard table MARA, MAKT – Table design done considering
normalization to avoid data redundancy i.e replication of same piece of data in multiple
places
8
SAP ABAP Consultant [email protected]
9
SAP ABAP Consultant [email protected]
Table Components
Field -> Data element -> Domain (data type is assign at domain level)
Field -> Data element (data type is assign at data element level)
10
Field -> data type is assign at field level with pre define data type
SAP ABAP Consultant [email protected]
Key field define the unique combination of a record , which get stored in a data base
table. A maximum of 16 key field we can define in an table, Key fields must be maintain
together at the beginning of a table.
11
SAP ABAP Consultant [email protected]
14
SAP ABAP Consultant [email protected]
A data type defines the technical characteristics (properties) of a variable or we can say
of a field of a table. Any programing language will not be able differentiate the data until the
type is define at operating system level .
Every language has its own predefine data type to categories and process the data.
Examples
• Name ‘ MS Dhoni’ here a name contain the characters between a to z , so for name we
use the data type as ‘C’ i.e. character.
• Monthly earning of employee is 100000 ( 1 lakh ) – here for amount field in abap we use
type CURR which is equivalent to DEC
• For defining a date we use data type ‘D’ or ‘DATS’
15
SAP ABAP Consultant [email protected]
16
SAP ABAP Consultant [email protected]
➢ Fixed length
➢ Variable Length
Keyword Type
STRING Character Sequence
XSTRING Byte Sequence
• Complex types : – Complex types includes structures types and table types.
• Reference Types : – Reference types are use in abap oops concept to refer to the instances
of classes, interfaces and runt time data items.
18
SAP ABAP Consultant [email protected]
19
SAP ABAP Consultant [email protected]
Data Elements : It specify the semantic information of a table field. Data elements gives the
detail information of the field.
• It is use to define the data type of the field like, char, curr, dats, etc.
• We can also maintain field label at data element level.
• Data element information is available to all the screen fields that refer to the specific data
elements
• Data elements can be define either elementary type or reference type.
• The elementary type is define either by a domain or by built in data type.
• Reference type can be use in case we want to assign the reference of an existing field.
• In further characteristics , we can also mark as change document, if we want to capture
the changes, which are made at field level.
20
SAP ABAP Consultant [email protected]
21
SAP ABAP Consultant [email protected]
One data element can be used and assigned to multiple table fields.
22
SAP ABAP Consultant [email protected]
Structure : A structure is a group of components under a name. A structure can hold the data
a single record only at time in program run time it acts as a work area, but it cannot stored
the data like a table.
24
SAP ABAP Consultant [email protected]
Nested structure :
Deep structure :
25
SAP ABAP Consultant [email protected]
Table type : A table type , we can use to describe the structure and functional attributes of
an internal table. If we have define any table type in SE11 i.e abap dictionary that we can
refer in abap programs for creating a internal table.
A table type is define by its line type , that define the structure and data type attributes
of a line of internal table.
26
SAP ABAP Consultant [email protected]
27
SAP ABAP Consultant [email protected]
28
SAP ABAP Consultant [email protected]
• A type group we can say as it is abap program, managed by data dictionary , which is use
for global visible data type, constant, structures which can be use by abap program in run
time.
29
SAP ABAP Consultant [email protected]
A view is a logical table, that actually does not stored any physical data, it extracts data
from one or multiple tables at run time.
1. Data base view : A database view is created on two or more tables using inner join
concept , we can only read the data from database view.
2. Maintenance view : A maintenance view are use for sap internal purpose, in real time,
we do not create maintenance views, in this data is maintain and distributed into several
tables.
3. Help view : Help view are created on two or more tables using outer join concept, we
cannot directly execute help views ,we have to include the help view inside the search
help, and it is display when user press F4 i.e search help on a field.
4. Projection view : A projection view is created on single table, it is used in case if we have
large number of field and we want to provide only some of the fields as interface, in that
case we can use Projection view.
31
SAP ABAP Consultant [email protected]
1. Data base view : A database view is created on two or more tables using inner join
concept , we can only read the data from database view.
2. Maintenance view : A maintenance view are use for sap internal purpose, in real time,
we do not create maintenance views, in this data is maintain and distributed into several
tables.
3. Help view : Help view are created on two or more tables using outer join concept, we
cannot directly execute help views ,we have to include the help view inside the search
help, and it is display when user press F4 i.e search help on a field.
4. Projection view : A projection view is created on single table, it is used in case if we have
large number of field and we want to provide only some of the fields as interface, in that
case we can use Projection view.
32
SAP ABAP Consultant [email protected]
Search helps are objects that you can use to assign input help (F4 Help) to screen
fields. If we press F4 on any field , it will populate and give us a list of available values through
the assigned database table.
33
SAP ABAP Consultant [email protected]
34
SAP ABAP Consultant [email protected]
Lock objects gives the synchronize access to the same data by multiple user. Lock objects
are used in SAP to avoid the inconsistency when data is inserted into or changed in the
database. Tables whose data records are to be locked must be defined in a Lock Object, along
with their key fields.
35
SAP ABAP Consultant [email protected]
When we create Lock objects system generates 2 Function Modules, which are called by
the program at run time. A lock request is generated by the program , then the request goes
to enqueue server and the lock is created in the lock table and then program access the data
from database.
36
SAP ABAP Consultant [email protected]
37