Exp 0002
Exp 0002
Exp 0002
Introduction
Function of the ABAP Dictionary in the R/3 System Definition of database objects User-defined types Services in the ABAP Dictionary Linking to the development and runtime
environments
SAP AG 1999
SAP AG
TAW12
2-1
0.2
Course Objectives
System
Describe the ways to define data objects and types Describe the services provided by the ABAP
Dictionary
Explain how the ABAP Dictionary is linked to the
SAP AG 2002
SAP AG
TAW12
2-2
0.3
Function of the ABAP Dictionary
Type definitions
Structure
DB objects
Table
Services
Poss. values Screen F4
SAP AG 2002
The ABAP Dictionary permits central management of all the data definitions used in the R/3 System. In the ABAP Dictionary, you can create user-defined types (data elements, structures, and table types) for use in ABAP programs or in interfaces of function modules. Database objects such as tables and database views can also be defined in the ABAP Dictionary and created with this definition in the database. The ABAP Dictionary also provides a number of services that support program development. For example, setting and releasing locks, defining an input help (F4 help), and attaching a field help (F1 help) to a screen field are supported.
SAP AG
TAW12
2-3
0.4
Database Objects in the ABAP Dictionary
View
Table 1
Table 2
ABAP Dictionary
Database
SAP AG 1999
Tables and database views can be defined in the ABAP Dictionary. These objects are created in the underlying database with this definition. Changes in the definition of a table or database view are also automatically made in the database. Indexes can be defined in the ABAP Dictionary to speed up access to data in a table. These indexes are also created in the database.
SAP AG
TAW12
2-4
0.5
Type Definitions in the ABAP Dictionary
Employee
Name Address Telephone
Town
Address
Numbers
ZIP
Town name
SAP AG 2002
Three different type categories exist in the ABAP Dictionary: Data elements: Describe an elementary type by defining the data type, length, and possibly decimal places. Structures: Consist of components that can have any type. Table types: Describe the structure of an internal table. Any complex user-defined type can be built from these basic types. Example: The data of an employee is stored in a structure EMPLOYEE with the components NAME, ADDRESS and TELEPHONE. Component NAME is also a structure with components FIRST NAME and LAST NAME. Both of these components are elementary, for example, their type is defined by a data element. The type of component ADDRESS is also defined by a structure whose components are also structures. A table type is used to define component TELEPHONE (because an employee can have more than one telephone number). Types are used for example in ABAP programs or to define the types of interface parameters of function modules.
SAP AG
TAW12
2-5
0.6
Services of the ABAP Dictionary
Carrier
No . 0400 Frankfurt Frankfurt Frankfurt
LH
Depart. city Arrival city New York New York Berlin
Maintenance of flights
Carrier Flight number
0402 2402
LH
F4 F1
...
...
...
...
SAP AG 2002
The ABAP Dictionary supports program development with a number of services: Input helps (F4 helps) for screen fields can be defined with search helps. Field help (F1 help) can be easily assigned to screen fields by creating documentation for the data element. An input check that ensures that the values entered are consistent can easily be defined for screen fields using foreign keys. The ABAP Dictionary provides support when you set and release locks. To do so, you must create lock objects in the ABAP Dictionary. Function modules for setting and releasing locks are automatically generated from these lock objects; these can then be linked into the application program. The performance when accessing this data can be improved for database objects (tables, views) with buffering settings. By logging, you can switch on the automatic recording of changes to the table entries.
SAP AG
TAW12
2-6
0.7
Linking to the Development and Runtime Environment
Development environment Screen Painter ABAP tools Read type definitions Runtime environment Screen Interpreter ABAP Interpreter
SAP AG 1999
Database interface
ABAP Dictionary
The ABAP Dictionary is actively integrated in the development and runtime environments. Each change takes immediate effect in the relevant ABAP programs and screens. Examples: When a program or screen is generated, the ABAP interpreter and the screen interpreter access the type definitions stored in the ABAP Dictionary. The ABAP tools and the Screen Painter use the information stored in the ABAP Dictionary to support you during program development. An example of this is the Get from Dictionary function in the Screen Painter, with which you can place fields of a table or structure defined in the ABAP Dictionary in a screen. The database interface uses the information about tables or database views stored in the ABAP Dictionary to access the data of these objects.
SAP AG
TAW12
2-7
0.8
Unit Summary
The ABAP Dictionary manages data definitions. User-defined types can be created in the ABAP Dictionary.
Dictionary and automatically created with this definition in the underlying database.
The ABAP Dictionary provides a number of services that
SAP AG 2002
SAP AG
TAW12
2-8