Documentos de Académico
Documentos de Profesional
Documentos de Cultura
SAP AG
Chapter 03 Objectives
SAP AG
Integration into ABAP/4 W orkbench (Active)
Developm ent environm ent
ABAP/4
Dictionary
The ABAP/4 Dictionary is an active, integral component of the ABAP/4 Development Workbench.
Any change made in the Dictionary becomes effective at once in the relevant ABAP/4 programs and
screens.
The basis for this is the interpretive nature of the R/3 Systems. The interpreter does not operate
directly on the original code of an ABAP/4 program or screen, but interprets a generated, internal
representation.
When changes are made in the ABAP/4 Dictionary, automatic post-generation of this internal
representation guarantees that the interpreters is always working with the latest data.
Basic Dictionary Objects
Table
table field
dom ain
uses
SAP AG
The basic data definition objects in the ABAP/4 Dictionary are tables, domains and data elements.
Domains describe the technical attributes of table fields (e.g. field type, field length), while data
elements contain the semantic definition (e.g. short description).
Fields are not independent objects and can only be maintained within tables. They presuppose the
existence of a data element.
A data element presupposes the existence of a domain.
Domains can be defined without further reference to other Dictionary objects.
Dual Level Domain Concept
Domain
S_PRICE
SAP AG
In the ABAP/4 Dictionary, two types of objects are used for data definition purposes. These are
technical domains (known as domains in the R/3 System) and semantic domains (known as data
elements in the R/3 System).
The domain is the central object used to describe the attributes of a business object. It describes a
field’s value range which is defined by specifying formal attributes such as external format and length
and by specifying fixed values or a value table.
The data element is the semantic object. It describes precisely the purpose of a domain in a particular
business setting for the fields which depend on it.
For example, the table fields FORCURAM (table SBOOK) and PRICE (table SFLIGHT) belong to
the same domain S_PRICE. To distinguish their actual business application, the field FORCURAM
uses the data element S_F_CUR_PR and the field PRICE uses the data element S_PRICE. However,
both fields belong to the same domain because they are currency fields and thus have similar technical
atttributes.
Transparent Tables
ABAP/4 Dictionary
logical table definition
SAP AG
When it has been activated in the ABAP/4 Dictionary, a transparent table is automatically created in
the database. This process translates the database-independent description of the table in the ABAP/4
Dictionary into the language of the database system being used.
The database table has the same name as the table in the ABAP/4 Dictionary. The fields also have the
same names in both the database and in the ABAP/4 Dictionary. The data types in the ABAP/4
Dictionary are converted to the corresponding data types of the database system.
As of Release 3.0, the sequence of fields in the ABAP/4 Dictionary can vary from the sequence of
fields in the database. This allows you to insert new fields without having to convert the table by
performing a physical reorganization. When adding new fields, the adjustment is made by changing
the database catalog (ALTER TABLE). A new field is appended to the database table, regardless of
its position in the ABAP/4 Dictionary.
Creating Transparent Tables
N ew fields Technical settings Indexes ...
N ame BCA01
Short text Demo table for BC400
Status
X Tab.maint.allow ed
Field attributes
Field name Key Data element Type Length C hk tab Short text
C ARRID X S_CARR_ID CHAR 3 * Airline carrier
SEATSMAX S_SEATSMAX INT4 10 M ax. no. of seats
SAP AG
By activating a table of type TRANSP in the ABAP/4 Dictionary, you automatically create the table
via the database utility in the database.
Only complex database operations such as table conversions must be performed directly via the
database utility. Simple operations, such as creating objects, can be performed automatically by
activating the objects in the ABAP/4 Dictionary.
In the database utility, you can control the database objects with an analysis tool.
Structures
ABAP/4 Dictionary
logical table definition
SAP AG
Besides defining tables stored in the database, you can also define the structure of data which occurs
when performing calculations in programs, or when passing data between programs, globally in the
ABAP/4 Dictionary. This kind of definition is known as a structure.
Structures do not correspond to objects in the database.
Structures are defined and activated in the ABAP/4 Dictionary. They can then be addressed by
ABAP/4 programs like tables declared in the TABLES statement.
While data can be permanently stored in transparent tables in the database, data in structures exists
only during the runtime of a program.
Structures are used in particular for defining data at the interface of module pools and screens, as well
as for assigning the types to the parameters of reusable function modules or subroutines.
Defining structures centrally means that you can change them centrally. The active ABAP/4
Dictionary then ensures that any modifications are made in all the places concnerned.
Creating Structures
N ew fields Technical settings Indexes ...
N ame BCAXX
Short text Structure for level 2 course
Status
Field attributes
Field name Data element Type Length C hk tab Short text
C ARRID S_CARR_ID CHAR 3 * Airline carrier
SEATSMAX S_SEATSMAX INT4 10 M ax. no. of seats
SAP AG
To define a structure, you go into the Object Browser and proceed as follows:
view view
ABAP/4 Dictionary
tables
DB
SAP AG
‘Aggregated’ means consisting of several components. In the ABAP/4 Dictionary, aggregated objects
are objects which come from several different transparent tables.
Views are application-specific views of different ABAP/4 Dictionary tables.
Views allow you to gather information from the fields of different tables and present it to users in the
form they require when working with the R/3 System.
Views are mainly used for programming with ABAP/4 and for F4 online help.
Aggregated Objects in the ABAP/4 Dictionary:
Matchcodes
UserDept Nam e UserDept Course ProfNo Course description
... ... Test
4711 M athem atics 4711 444 4709 Analysis I
Tables ... ...
...
Analysis II MTest
athem atics 4711
M atchcode ...
online
...
help _Mathematics Analysis I 4711
xMathematics Analysis II 4711
UserDeptNo:? ... UserDeptNo. 4711
F4
SAP AG
Matchcodes are a form of online help (F4) which allows you to use additional criteria to access data
records without knowledge of the key.
Chapter 03 Summ ary
SAP AG
Exercises Chapter 3: ABAP/4 Dictionary
Task:
Define an ABAP/4 Dictionary structure (you will use this in a
later exercise).
The structure should consist of the following fields: