Download presentation
Presentation is loading. Please wait.
1
Data Dictionary Overview
SAP R/3 Application Demo SD MM PP QM PM HR CO AM PS WF IS FI ABAP/4 DW 勤業管理顧問公司 ARTHUR ANDERSEN BUSINESS CONSULTING 11/23/1998
2
What is a Data Dictionary?
Which data? How is the data linked? What are the characteristics? Data Dictionary Description of data and their meaning Database The ABAP/4 Dictionary stores and manages data definitions. It ensures the central, non-redundant description of all data used in the system. All data entered into the ABAP/4 Dictionary is available anywhere in the system. Because of the activation mechanism, any change affects all related system components immediately. The Repository Infosystem allows you to analyze the Dictionary in many ways.
3
Integration of the Data Dictionary
Development environment Application run time environment ABAP/4 Interpreter Dialog Control Interface Programs Screen Tools Data Modeler Painter Dictionary The SAP Data Dictionary is an integrated and active data dictionary, which means it is completely integrated in the SAP development environment. Each piece of dictionary information is entered only once and is then available any place in the system at any time. The active Data Dictionary automatically supplies all new or changed information, thus providing current runtime objects, data consistency, and data security. The integration of the ABAP/4 Dictionary in program processing stems from the interpretive manner in which the R/3 runtime environment works. The ABAP/4 processor does not use the original of an ABAP/4 program, rather it uses a runtime object that is generated based on the program text before it is executed for the first time. Runtime objects are automatically regenerated when a time stamp comparison between the object and the ABAP/4 Dictionary detects a difference. This combination of early binding and late binding ensures that the active integration of the Dictionary information does not affect efficiency. All performance-critical information is stored in the runtime objects (programs, screens, etc.). System functions provide the guarantee that this information is always up to date at runtime.
4
Tools: ABAP/4 Dictionary
The ABAP/4 Dictionary is actively integrated in program execution The ABAP/4 Dictionary is integrated into all tools of the ABAP/4 Development Workbench Object Browser Dictionary ABAP/4 Editor Function Library Screen Painter Menu ABAP/4 Development Workbench Data base Data model The ABAP/4 Dictionary actively supports the development of new software and the maintenance of existing software components. Each piece of information is entered only once and is then available anywhere in the system. The R/3 runtime environment makes sure that only the current definitions of the ABAP/4 Dictionary are used. For example, if you add a value to the existing values of a domain, then the F4 help on all screens containing a field with this domain will show the additional value immediately. During the work on development projects, objects of the ABAP/4 Dictionary may be changed many times before they are activated and mad available to the system. This ensures data integrity, consistency and security.
5
Table Field Key 1 . Key 2 Key n F 1 F 2 F n Row Primary key
Function fields Table A table is a two-dimensional matrix. It has a name and characteristics, such as the table type. A field has a name and characteristics, it may be a primary key field, for example. In addition, a field possesses semantic and technical characteristics. A table has at least one primary key field uniquely identifying on row in this table. The ABAP/4 Dictionary describes the logical structure of the objects in application development and their representation in structures of the underlying relational database. It provides a logical view of the application data and the data organization with the help of the underlying database system.
6
ABAP/4 Example: Accessing a Table
REPORT BC430REP. TABLES: UFACH. ... SELECT * FROM UFACH. WRITE: / UFACH-FABNR, UFACH-FBNAM. ENDSELECT. A direct relationship exists between ABAP/4 Dictionary and ABAP/4 Development Workbench. You merely have to make the required tables (TABLES: <tabname>) known to an ABAP/4 program and all work areas are automatically initialized correctly. Any information important to the runtime environment, such as field length, field type, etc., are taken from the ABAP/4 Dictionary. 1
7
Basic Objects of the Dictionary
Table Domain uses Data element Table field Tables, domains, and data elements are the basic objects to define data in the ABAP/4 Dictionary. The domain serves for the technical (such as field type and length), the data element for the semantic (such as short text) definition of a table field. A field is not a stand-alone object, rather it is table-dependent and can only be maintained within a table. The data element requires the existence of a domain. The domain can be defined without any reference to other Dictionary objects. A domain also contains the specifications of the value set, such as a value table, the external format, and fixed values. Data element and domain are objects of the two-level domain concept in the SAP system.
8
Two-Level Domain Concept
Table SBOOK FORCURAM SFLIGHT PRICE Data element S_F_CUR_PR S_PRICE Domain For example, the table fields FORCURAM (table SBOOK) and PRICE (table SFLIGHT) have the same domain S_PRICE. Differences in context are defined by using data element S_F_CUR_PR for field FORCURAM and data element S_PRICE for field PRICE. Both fields use the same domain because both FORCURAM and PRICE are currency fields and have the same technical characteristics. The two-level domain concept allows the definition and maintenance of technical field characteristics at domain level. A domain can pass its field characteristics to any number of fields, which means that to change the field characteristics only requires a change to the domain, not to the individual fields. The data element in turn describes the semantic characteristics of a field in context of the table, characteristics then, that have meaning only there and not in general (as the technical characteristics).
9
What is a Foreign Key? Primary key Foreign key table T1 Field 1
Check table T2 Field 5 Field 6 Field 7 Foreign key field You can define relationships between tables in the ABAP/4 Dictionary. These relationships are called foreign keys and must be defined explicitly at field level. Foreign keys are used mainly to ensure consistency of data. Input data is to be validated against existing data to avoid incorrect data (for example, assigning a printer that does not exist). A combination of table fields is called foreign key it this field combination is primary key of another table. A foreign key establishes the connection between two tables T1 and T2, by referring to the primary key of T2 in T1. To do this, the foreign key fields in T1 are assigned to the primary key fields of T2. The table to be checked is called foreign key table, T2 is called check table. Sometimes these are also called dependent table (foreign key table) and referenced table (check table). If a foreign key is defined between two tables, a record of the foreign key table refers to a record of the check table. Because a record is identified by its key, it is sufficient to refer to the primary key of the check table in the foreign key field when defining foreign keys.
10
Example: Inserting a Data Record
0001 0002 0003 000001 000002 number description Major area Course Professor Check table UPROF Salary level ...... C1 C3 C4 C2 ..... Foreign key field Foreign key relationship Insert OK ??? 000003 Foreign key table UKURS Field Professor number in table UKURS was defined as foreign key field. The related check table is table UPROF with the primary key field Professor number. When entering a data record in table UKURS, the input for field Professor number ist checked against all existing professor numbers in table UPROF. Question: Can you insert the above data record in table UKURS?
11
Transparent Tables Database - physical table definition
Field 1 Field 2 Field 3 Field 4 ABAP/4 Dictionary logical table definition A transparent table is automatically created in the database during the activation in the ABAP/4 Dictionary. At the same time, the database- independent description of the table in the ABAP/4 Dictionary is translated into the language of the database system used. The database table has the same name as the table in the ABAP/4 Dictionary. The fields also have the same names in the database as in the ABAP/4 Dictionary. The data types in the ABAP/4 Dictionary are converted to the corresponding data types of the database system. Beginning with release 3.0, the field sequence in the ABAP/4 Dictionary can differ from that in the database. This allows you to insert new fields without having to convert the table in a physical reorganization. When adding new fields, the adjustment is done through changing the database catalog (ALTER TABLE). A new field is appended to the database table, independent of the field position in the ABAP/4 Dictionary.
12
Structures ABAP/4 Dictionary logical table definition Field 1 Field 2
Besides defining the tables residing in the database, you can also globally define the structure of data used for processing in programs or for transferring data between programs in the ABAP/4 Dictionary. Such a definition is called a structure. A structure does not have a corresponding object in the database. You define and activate a structure in the ABAP/4 Dictionary. It can then be accessed by ABAP/4 programs in a TABLES instruction, just like a table. While transparent tables store data permanently in the database, structures contain data only temporarily during a program runtime. Structures are mainly used to define data for interfaces of module pools or screens, as well as for the typing of parameters of reusable function modules or subprograms. The central definition of structures that may be used in different places in the system also makes it possible to change them centrally.
13
Views View Join Projection Selection SAP tables
The method to provide task-oriented data views that is normal in a relational model can also be used in the R/3 system. You can define views in the Data Dictionary as virtual tables, which means, they do not contain data but rather provide needed data in table format from other tables contained in the Data Dictionary. The SAP view supports the relational operators JOIN, PROJEKTION, SELEKTION. Join defines the relationship of the base tables involved in the view. Projektion determines the fields of the base tables to be included in the view. The Selektion conditions supply the rows that are to appear in the view table.
14
THE END !
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.