Top Banner
ABAP Dictionary
40

169318090 0104abapdictionary-100831073625-phpapp02

Nov 07, 2014

Download

Education

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 169318090 0104abapdictionary-100831073625-phpapp02

ABAP Dictionary

Page 2: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 2

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

Page 3: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 3

What is a Data Dictionary?

• A data dictionary is a system-

independent 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.

Page 4: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 4

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 Dictionary ABAP Dictionary

ABAP

Program X

ABAP

Program X

Unix Windows

NT SAP Database

(Oracle) SAP Database

(MS SQL Server)

Page 5: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 5

ABAP Dictionary Functionality

• Records

• Storage

• ABAP Dict

Objects

• Where-used

lists

• Relationships

Modification

analysis

• ABAP Dict

Objects

• Time Stamp

Validation

• Entries in

DB Catalog

• ABAP Dictionary

• Repository Info System

• Documentation

AN

ALY

SIS

AC

TIV

AT

ION

INTEGRATION

ADMINISTRATION

Page 6: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 6

ABAP Dictionary Transactions

• SE80 - Repository Browser

• SE15 - Repository Information System

• SE16 - Data Browser

• SE17 - General Table Display

• SM30 - Maintain Table Views

• SM31 - Table Maintenance

Page 7: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 7

Basic Data Dictionary Objects

Field

Data Element

Domain Table

uses

uses

Page 8: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 8

Levels of Abstraction

Domain

Data Element

• Data type

• Number of characters

• Output length

• Value table

• Attributes inherited from domain

• Field labels

Field

Table

• Field name

• Primary key indicator

• Attributes inherited from data element

Page 9: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 9

Two-Level Domain Concept

S_CITY

S_TO_CITY S_FROM_CIT

Departure

City

Destination

City

Domain

Data

element

City

Page 10: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 10

Domain

Page 11: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 11

Specifying Value Ranges for a

Domain

Fixed Values Example:

Value Table Example:

Domain: S_CLASS (Classes for a Flight Booking)

Values: C (business class)

F (first class)

Y (economy class)

Domain: S_CARR_ID (Carrier ID)

Value Table: SCARR

Table: SCARR

Carrier ID Name

AA American

DL Delta

LH Lufthansa

SA Singapore

UA United

Page 12: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 12

Data Element

Attributes inherited from the domain

Page 13: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 13

Interdependency of ABAP

Dictionary Objects

Tab.

Tab.

Tables Domains

"technical

field description"

From City

To City

S_FROM_CIT

S_TO_CITY

City

S_CITY

Tab.

Data elements

"semantic

field description"

Page 14: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 14

Table

Primary key (Field) values

Table SCARR

Carrier ID

AA

DL

LH

UA

...

Carrier Name

American Airlines

Delta

Lufthansa

United Airlines

...

TABLE

Airline Carriers

Rows (tuples)

Page 15: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 15

Relationships Between Tables:

Foreign Keys

PLANETYPE SEATSMAX

747-200 200 20000

A310-200 211 24000

757-300 301 17000

Check

Table

FLDATE CARRID PRICE CONNID

AA 1234 03/22/1999 500 747-200 125

UA 5678 01/06/1999 600 A310-200 90

Foreign

Key

Table

Table 1: Airplane Details Table SAPLANE

Table 2: Flight Table SFLIGHT

PLANETYPE SEATSOCC

CARGOMAX

Primary Key Foreign Key

Primary Key

Page 16: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 16

Check Table - System Default

- DOMAIN S_PLANE

Value table

SAPLANE

System default

- Table SFLIGHT

- Field PLANETYPE

Check table SAPLANE

Page 17: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 17

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. 1:1

1:C

1:N

1:CN

Cardinality Types

Page 18: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 18

Configuration

Data

Master

Data

Transaction

Data

System

Data

• Sales Orders

• Purchase Orders

• Journal Entries

• Goods Receipts

• G/L Accounts

• Vendors

• Materials

• Stock Locations

• Metadata

• Programs

• Documentation

• System Settings

• Currency Codes

• Order Types

• Payment Terms

• Field Status Codes

SAP Data

Page 19: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 19

SAP Table Types

Transparent

Cluster

Pool

Internal

ABAP

Dictionary

ABAP

Program

Page 20: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 20

Table Definition

TRANSP table

Structure table

Create

transp. table

Activate

Note: DB table

will be created

automatically!

Create

int. table

Activate

Page 21: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 21

Creating / Changing Tables

Page 22: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 22

Technical Settings

Data class

Table category

Buffering

Log data changes

Master data

Transaction data

Organization & Customizing (System) data

Number of data records in DB storage area

single

generic (must specify number of key fields)

full

not buffered

Page 23: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 23

Indexes

DB

S1 S2 ... F1 F2 ...

F2 S1 S2

T1_K T1

S1 S2 ... F1 F2 ... T1 T1_K

Identific.

Unique

Desc

ABAP Dictionary

Index

Page 24: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 24

Data Class

TS1

TSn

TS2

.... TS1

TSn

TS2

.... TS1

TSn

TS2

....

TS1 ... TSn

APPL0

(Master)

TSYS1 ... TSYSn

APPL2

(Organization &

Customizing)

TB1 ... TBn

APPL1

(Transaction)

DB

Page 25: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 25

TS1

Dict Table Selection

T1 0

T2 1

T3 2

T4 3

T5 4

DB

TS1 TS1 TS1

0

1

2

3

Number of data records

in a storage area

4

= 0 to 640K

= 610K to 2400K

= 2400K to 9800K

= 9800K to 39000K

= 39000K plus

Size Categories

Page 26: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 26

Exercise 1 - Create Basic ABAP Dictionary Objects, 60 minutes

Exercise 2 - Create Table Indexes, 20 minutes

Exercises

Page 27: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 27

Buffering

1st access

DB

T2

G1 G2 S3 F1 ...

T3

G1 G2 S3 ...

T1

S1 S2 F1 ...

ABAP Dictionary

S1 S2 F1 ... T1 T3

G1 G2 S3 ...

T2

G1 G2 S3 F1 ...

T1

S1 S2 F1 ...

TABL TABLP

Buffer: 100% and generic Buffer: partial

Yes Import record

No

Yes

No Yes

Generic

key

complete

SELECT

SINGLE

record exists

No 1st access

Yes

No

G1 G2 S3 F1 ... T2

S1 S2 F1 ... T3

Change number

of key fields

100% generic

partial

2

Page 28: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 28

Logging

DB

Log T1

Field-related

log records

DD

S1 S2 F1 F2 F3 ... Table T1

System profile

Logging

Change

S1 S2 F2 F3 ...

Manual

Page 29: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 29

INCLUDE Substructure

US USF1 USF2 USF3 .....

Table Field Data element

T1 S1 ...

TRANSP S2 ...

.INCLUDE US

F1 ...

... ...

T2 F1 ...

TRANSP .INCLUDE US

F2 ...

... ...

Page 30: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 30

APPEND Substructure

Table Field Data Element

ZTBL1 FLD1 ...

TRANSP FLD2 ...

.APPEND ZAZTBL1

Database Field Sequence ABAP Dictionary Sequence

FLD1 FLDX FLD2 FLD1 FLD2 FLDX

Append contains

definition of field

FLDX

.APPEND CI_ZTBL1

OR

Customizing Include

Page 31: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 31

Views

FIELD A FIELD B FIELD C FIELD A FIELD D FIELD E FIELD F

TABLE 1 TABLE 2

FIELD A FIELD C FIELD D FIELD F

VIEW 1

Page 32: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 32

User selects row

Values are

returned

User chooses F4

on field

The search path used the

last time is displayed

User chooses a

different search

path

The chosen search

path is displayed

Hit list is displayed

A B C

A B C

Search Help

Page 33: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 33

Search Help Fields

Page 34: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 34

Exercise 3 – Create an Elementary Search Help, 30 minutes

Exercise

Page 35: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 35

Data Browser

ABAP Workbench

Tools

Overview

Data Browser

(SE16)

Page 36: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 36

User Parameters

Page 37: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 37

Using the Browser

Page 38: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 38

Settings

Sort Sequence for

output list ...

- List table fields

- Maximum 9 sort fields

- Flag fields with 1 to 9

Fields to be

selected ...

- List table fields

- Flag the fields to

be included in the

the output list

Affects the

output list

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

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

Page 39: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 39

Exercise 4 - ABAP Dictionary Search, 30 minutes

Exercise 5 - View a Table with the Data Browser, 20 minutes

Exercises

Page 40: 169318090 0104abapdictionary-100831073625-phpapp02

Copyright © 2005 Accenture 40

Any questions?

Questions & Answers