Sie sind auf Seite 1von 40

ABAP Dictionary

Module Objectives
Describe the basic functionality of the Data Dictionary, its
objects and related transactions
Define domain and data element and how they are related
Define a table and table concepts including:

Foreign key and primary key


SAP table types
Creating and maintaining tables - SE11
Indexes
Buffering

Define structures and views


Define search help
Describe the data browser

Copyright 2005 Accenture

What is a Data Dictionary?

A data dictionary is a systemindependent interface to a


database.
A data dictionary is a virtual
database containing metadata
(data about data).
A data dictionary provides tools
for data manipulation and data
processing.

Copyright 2005 Accenture

Why a Data Dictionary?

A data dictionary facilitates the development of platform-independent


applications.
A data dictionary eliminates the need for programmers to be concerned
about specific storage locations, drive and directory names, etc.
ABAP
Program X

ABAP
Program X

ABAP Dictionary

ABAP Dictionary

Unix

SAP Database
(Oracle)

Windows
NT

SAP Database
(MS SQL Server)

Copyright 2005 Accenture

ABAP Dictionary Functionality


ADMINISTRATION

ABAP Dict
Objects
Where-used
lists
Relationships
Modification
analysis

ABAP Dict
Objects
Time Stamp
Validation
Entries in
DB Catalog

ACTIVATION

ANALYSIS

Records
Storage

ABAP Dictionary
Repository Info System
Documentation

INTEGRATION

Copyright 2005 Accenture

ABAP Dictionary Transactions

SE80 - Repository Browser


SE15 - Repository Information System
SE16 - Data Browser
SE17 - General Table Display
SM30 - Maintain Table Views
SM31 - Table Maintenance

Copyright 2005 Accenture

Basic Data Dictionary Objects

Table

Domain
uses

Data Element
uses

Field
Copyright 2005 Accenture

Levels of Abstraction

Domain

Data Element

Data type
Number of characters
Output length
Value table

Attributes inherited from domain


Field labels

Table

Field

Field name
Primary key indicator
Attributes inherited from data element

Copyright 2005 Accenture

Two-Level Domain Concept

City

Domain

S_CITY

S_FROM_CIT
Departure
City

S_TO_CITY

Data
element

Destination
City

Copyright 2005 Accenture

Domain

Copyright 2005 Accenture

10

Specifying Value Ranges for a


Domain
Fixed Values Example:
Domain:

S_CLASS (Classes for a Flight Booking)

Values:

C
F
Y

(business class)
(first class)
(economy class)

Value Table Example:


Domain:
Value Table:

S_CARR_ID (Carrier ID)


SCARR

Table: SCARR
Carrier ID
AA
DL
LH
SA
UA

Copyright 2005 Accenture

Name
American
Delta
Lufthansa
Singapore
United

11

Data Element

Attributes
inherited from
the domain

Copyright 2005 Accenture

12

Interdependency of ABAP
Dictionary Objects
Tab.

From City
Tab.

S_FROM_CIT

City

S_CITY
S_TO_CITY
To City

Tab.

Tables

Data elements
"semantic
field description"

Domains
"technical
field description"

Copyright 2005 Accenture

13

Table
TABLE
Airline Carriers
Table SCARR

Rows (tuples)

Carrier ID

Carrier Name

AA
DL
LH
UA
...

American Airlines
Delta
Lufthansa
United Airlines
...

Primary key

values
Copyright(Field)
2005
Accenture

14

Relationships Between Tables:


Foreign Keys
Primary Key
PLANETYPE SEATSMAX

Check
Table

747-200
A310-200
757-300

CARGOMAX

200
211
301

20000
24000
17000

Table 1: Airplane Details Table SAPLANE

Foreign Key

Primary Key

Foreign
Key
Table

CARRID CONNID FLDATE


AA
UA

1234
5678

PRICE PLANETYPE SEATSOCC

03/22/1999 500
01/06/1999 600

747-200
A310-200

Table 2: Flight Table SFLIGHT

Copyright 2005 Accenture

125
90

15

Check Table - System Default

- DOMAIN S_PLANE
Value table
SAPLANE
- Table SFLIGHT
- Field PLANETYPE

Check table

SAPLANE

System default

Copyright 2005 Accenture

16

Cardinality

Cardinality defines the type of


relationship between two tables.
The cardinality of a foreign key
indicates how many dependent
records a record in a check
table may have.

Cardinality Types
1:1
1:C
1:N
1:CN

Copyright 2005 Accenture

17

SAP Data

Master
Data

Transaction
Data

G/L Accounts
Vendors
Materials
Stock Locations

System
Data

Metadata
Programs
Documentation
System Settings

Configuration
Data

Currency Codes
Order Types
Payment Terms
Field Status Codes

Sales Orders
Purchase Orders
Journal Entries
Goods Receipts

Copyright 2005 Accenture

18

SAP Table Types

Transparent
ABAP
Dictionary

Cluster
Pool

ABAP
Program

Internal

Copyright 2005 Accenture

19

Table Definition

TRANSP table

Structure table

Create
transp. table

Create
int. table

Activate

Activate

Note: DB table
will be created
automatically!

Copyright 2005 Accenture

20

Creating / Changing Tables

Copyright 2005 Accenture

21

Technical Settings

Data class

Master data
Transaction data
Organization & Customizing (System) data

Table category

Number of data records in DB storage area

Buffering

single
generic (must specify number of key fields)
full
not buffered

Log data changes

Copyright 2005 Accenture

22

Indexes
Index
ABAP Dictionary

T1 S1 S2 ...

Identific.
Unique
Desc

F1 F2 ...

T1_K

DB
T1

T1_K

S1 S2 ... F1 F2 ...

F2 S1 S2

Copyright 2005 Accenture

23

Data Class
TS1 ... TSn

TB1 ... TBn

APPL0
(Master)

APPL1
(Transaction)

TS1

....
TS2

TSn

TS1

....
TS2

TSn

TSYS1 ... TSYSn


APPL2
(Organization &
Customizing)

TS1

....
TS2

TSn

DB

Copyright 2005 Accenture

24

Size Categories
Dict Table

Selection

T1
T2
T3
T4
T5

0
1
2
3
4

Number of data records


in a storage area
00 = 0 to 640K
11 = 610K to 2400K
22 = 2400K to 9800K
33 = 9800K to 39000K
44 = 39000K plus

DB
TS1

TS1

TS1

TS1

Copyright 2005 Accenture

25

Exercises

Exercise 1 - Create Basic ABAP Dictionary Objects, 60 minutes


Exercise 2 - Create Table Indexes, 20 minutes

Copyright 2005 Accenture

26

Buffering
TABL

ABAP Dictionary

TABLP

Buffer: 100% and generic

T1

S1 S2 F1 ...

T2

G1 G2 S3 F1 ...

T3

S1 S2 F1 ...

T1

T3

T2

S1 S2 F1 ...

G1 G2 S3 ...

G1 G2 S3 F1 ...

No

1st access

100% generic
partial

Change number
of key fields

Buffer: partial

Yes

1st access
Yes

No
Yes

Generic
key
complete

Yes
SELECT
SINGLE
record exists

No

Import record

No

DB
T1
S1 S2 F1 ...

T2
G1 G2 S3 F1 ...

Copyright 2005 Accenture

T3
G1 G2 S3 ...

27

Logging

DD
Table T1

Change

S1 S2 F1 F2 F3 ...

Logging
Manual

DB
T1

System profile

Log

S1 S2 F2 F3 ...

Field-related
log records

Copyright 2005 Accenture

28

INCLUDE Substructure
US

USF1

USF2

Table

Field

Data element

T1
TRANSP

S1
S2
.INCLUDE
F1
...

...
...
US
...
...

T2
TRANSP

F1
.INCLUDE
F2
...

...
US
...
...

USF3 .....

Copyright 2005 Accenture

29

APPEND Substructure
Database Field Sequence
FLD1 FLDX

ABAP Dictionary Sequence

FLD2

Table

FLD1

Field

ZTBL1
FLD1
TRANSP FLD2

FLD2

FLDX

Data Element
...
...

.APPEND ZAZTBL1
OR

Append contains
definition of field
FLDX

.APPEND CI_ZTBL1
Customizing Include

Copyright 2005 Accenture

30

Views
FIELD A

FIELD C

FIELD D

FIELD F

VIEW 1

FIELD A FIELD B

TABLE 1

FIELD C

FIELD A FIELD D

FIELD E

FIELD F

TABLE 2

Copyright 2005 Accenture

31

Search Help
The search path used the
last time is displayed

User chooses a
different search
path

User chooses F4
on field
The chosen search
path is displayed

Values are
returned
User selects row

Hit list is displayed

Copyright 2005 Accenture

32

Search Help Fields

Copyright 2005 Accenture

33

Exercise
Exercise 3 Create an Elementary Search Help, 30 minutes

Copyright 2005 Accenture

34

Data Browser
Tools
ABAP Workbench

Overview
Data Browser
(SE16)

Copyright 2005 Accenture

35

User Parameters

Copyright 2005 Accenture

36

Using the Browser

Copyright 2005 Accenture

37

Settings
....

....

Personal Settings
- Width of output list
- Maximum number of
entries to be selected
- Take into account
conversion exit
- Column headings can
be either:
. Field name, or
. Field text
(from data element)

....

Data Browser: Table SPFLI


Settings .... .... System Help
List format
Sort
User parameters
Choose Fields
Fields For Selection

Fields to be
used for data
selection ...
- List table fields
- Flag the fields to
be used for data
selection
- Maximum 40
Affects the
selection screen

Fields to be
selected ...

Sort Sequence for


output list ...

- List table fields

- List table fields

- Flag the fields to


be included in the
the output list

- Maximum 9 sort fields


- Flag fields with 1 to 9

Affects the
output list

Copyright 2005 Accenture

38

Exercises
Exercise 4 - ABAP Dictionary Search, 30 minutes
Exercise 5 - View a Table with the Data Browser, 20 minutes

Copyright 2005 Accenture

39

Questions & Answers

Any questions?

Copyright 2005 Accenture

40

Das könnte Ihnen auch gefallen