SAP ABAP - Dictionary


Advertisements

As you are aware, SQL can be divided into two parts −

  • DML (Data Manipulation Language)
  • DDL (Data Definition Language)

DML part consists of query and update commands such as SELECT, INSERT, UPDATE, DELETE, etc. and ABAP programs handle the DML part of SQL. DDL part consists of commands such as CREATE TABLE, CREATE INDEX, DROP TABLE, ALTER TABLE, etc. and ABAP Dictionary handles the DDL part of SQL.

ABAP Dictionary

ABAP Dictionary can be viewed as metadata (i.e. data about data) that resides in the SAP database along with the metadata maintained by the database. The Dictionary is used to create and manage data definitions and to create Tables, Data Elements, Domains, Views and Types.

Basic Types in ABAP Dictionary

The basic types in ABAP Dictionary are as follows −

  • Data elements describe an elementary type by defining the data type, length and possibly decimal places.

  • Structures with components that can have any type.

  • Table types describe the structure of an internal table.

Various objects in the Dictionary environment can be referenced in ABAP programs. The Dictionary is known as the global area. The objects in the Dictionary are global to all ABAP programs and the data in ABAP programs can be declared by reference to these Dictionary global objects.

DBO ABAP Dictionary

The Dictionary supports the definition of user-defined types and these types are used in ABAP programs. They also define the structure of database objects such as tables, views and indexes. These objects are created automatically in the underlying database in their Dictionary definitions when the objects are activated. The Dictionary also provides editing tools like Search Help and locking tool like Lock Objects.

Dictionary Tasks

ABAP Dictionary achieves the following −

  • Enforces data integrity.
  • Manages data definitions without redundancy.
  • Integrates tightly with rest of the ABAP development workbench.

Example

Any complex user-defined type can be built from the 3 basic types in the Dictionary. Customer data is stored in a structure ‘Customer’ with the components Name, Address and Telephone as depicted in the following image. Name is also a structure with components, First name and Last name. Both of these components are elementary because their type is defined by a data element.

Customer Data

The type of component Address is defined by a structure whose components are also structures, and the Telephone component is defined by a table type because a customer can have more than one telephone number. Types are used in ABAP programs and also to define the types of interface parameters of function modules.

Advertisements