Vous êtes sur la page 1sur 56

ABAP - The Data Dictionary

Contents
Objectives Exploring the Types of Tables in ECC Exploring Table Components Creating a Transparent Table and Its Components Special Table Fields Modifying Tables Working with Data Structures in the Data Dictionary Revised and Active Versions

Summary
Exercise / Q&A

Contents
Objectives

Objectives
Describe the transparent tables

Create domains, data elements, and transparent tables in the Data Dictionary
Use the data browsers to view and modify data within tables

Describe the difference between a structure and a table, and create structures in the ECC Data Dictionary.
Create tables and structures containing currency and quantity fields.

Display and compare active and revised versions of DDIC objects

Contents
Exploring the Types of Tables in ECC

3 table types
transparent tables pooled tables cluster tables

Transparent Tables
transparent table vs. database table:
one-to-one relationship same name same number of fields same field names

used to hold application data:


master data: vendor master data, customer master data transaction data: purchasing order, sales order

Contents
Exploring Table Components

Table Components
Field: A table is composed of fields. Data element: contains the field labels and online documentation (also called F1 help) for the field business context. Domain: A data element's definition requires a domain. The domain contains the technical characteristics of a field, such as the field length and data type. Domains and data elements are reusable. A domain can be used in more than one data element, and a data element can be used in more than one field and in more than one table.

Table Components

Example

Naming Conventions
Naming Conventions for Tables, Fields, Data Elements, and Domains created by the Customer Object Type Table Max Name Length 16 Allowed First Character y, z

Data element
Domain Field

30
30 30

y, z
y, z Any character

Contents
Creating a Transparent Table and Its Components

Ex: Create Vendor table


Fields and Their Characteristics for Table ZLFA1 Field Name mandt lifnr PK x x DE Name mandt zlifnr zlifnr CHAR 10 DM Name Data Type Length

name1
regio land1

zname1
zregio zland1

zname1
zregio zland1

CHAR
CHAR CHAR

35
3 3

Approaches for Creating Tables


bottom-up: create domains data elements table
Create domains: zlifnr, zname1 Create data elements: zlifnr, zname1 Create table: zlfa1 Create fields: lifnr, name1 Tcode used: SE11

top-down: create table data elements domains


Change table: zlfa1 Create field regio data element zregio domain zregio Create field land1 data element zland1 domain zland1 Tcode used: SE11

Bottom-up: create domains

Bottom-up: create domains

Bottom-up: create data elements

Bottom-up: create data elements

Bottom-up: create data elements

Bottom-up: create data elements

Bottom-up: create table

Bottom-up: create table

Top-down

Top-down

Top-down

Top-down

Top-down

Technical Settings
The data class determines the tablespace in which a table is created.
tablespaces is used to organize and maintain the database. makes database administration easier increases system performance

The size category:


the size of the initial extent next extents number of possible next extents

Technical Settings
Buffering:
increases system performance by caching data locally on the application server
fewer database accesses used for tables that are seldom updated and often read.

Automatic logging feature:


causes a change document to be created each time the table is changed slows table updates only used for tables containing critical data non-critical tables, change document objects should be used.

Contents
Special Table Fields

Special Table Fields


currency fields: ex: 1000 U.S. dollars.
currency field: data type in the domain must be CURR (number 1000) currency key field: type CUKY ( USD)

quantity fields: numeric measurement (ex: 20 pieces)


The data type in the domain must be QUAN. ( 20) It must be linked to a field of type UNIT. ( PCs)

Special Table Fields

Contents
Modifying Tables

Modifying Tables
copy

delete
add more fields delete fields

change fields

Copying a Table
Copy table ZLFA1 to ZLFA1_COPY Only copy the table structure

Deleting a Table

Adding Fields
Inserting:
position a field before an existing field.

Appending:
add new fields at the end of the table, after all of the existing fields.

Inserting a Field

Appending a Field

Deleting Fields

Contents
Working with Data

Data browsers
search for and display rows that meet specified criteria add new rows

modify existing rows


delete rows

Using tcode SE11

Using tcode SE16 - Data Browser

Contents
Structures in the Data Dictionary

Structures
The differences between a structure and a table:
A structure doesn't have an associated database table
doesn't have a primary key. doesn't have technical attributes.

Structures follow the same naming conventions as transparent tables, and you cannot have a table and structure of the same name. The procedure for creating a structure is almost the same as for creating a transparent table.

Structures

Understanding Includes
A structure/table can contain another structure (nested)

Contents
Revised and Active Versions

Revised and Active Versions


Two versions of a DDIC object:
Revised version
when change save without activate

Active version
when activate Revised version becomes active and replaces the Active version

Revised and Active Versions

Compare Versions

Additional Versions
temporary versions:
menu path Utilities->Versions->Generate version is kept until the table is transported into production to view: menu path Utilities->Versions->Version Management

Retrieve Previous Version

The Data Dictionary is a tool used by ABAP/4 programs to create and maintain tables. There are three types of tables: transparent, pooled, and cluster. Transparent tables are the most common and are used to contain application data. To create a table, you first need domains and data elements. Domains provide the technical characteristics of a field; data elements provide the field labels and F1 help. Both are reusable. Within a table, each currency field must be linked to a currency key field, and each quantity field must be linked to a field containing the units of measurement. Data browsers enable you to display and modify the data within tables. SE16 is the most general data browser. Tables and structures are very similar. The main difference is that a table has an underlying database table and a structure doesn't. Dictionary objects must be active before they can be used. If you make a change to a dictionary object, you must reactivate the object before the changes take effect.

Summary

Vous aimerez peut-être aussi