40
ABAP Dictionary

0104 abap dictionary

  • Upload
    vkyecc1

  • View
    5.846

  • Download
    5

Embed Size (px)

DESCRIPTION

m1

Citation preview

Page 1: 0104 abap dictionary

ABAP Dictionary

Page 2: 0104 abap dictionary

Copyright © 2005 Accenture2

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: 0104 abap dictionary

Copyright © 2005 Accenture3

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: 0104 abap dictionary

Copyright © 2005 Accenture4

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

ABAPProgram X

Unix WindowsNT

SAP Database(Oracle)

SAP Database(MS SQL Server)

Page 5: 0104 abap dictionary

Copyright © 2005 Accenture5

ABAP Dictionary Functionality

• Records• Storage

• ABAP Dict Objects• Where-used

lists• Relationships

Modificationanalysis

• ABAP Dict Objects• Time Stamp

Validation• Entries in

DB Catalog

• ABAP Dictionary• Repository Info System• Documentation

AN

AL

YS

IS

AC

TIV

AT

ION

INTEGRATION

ADMINISTRATION

Page 6: 0104 abap dictionary

Copyright © 2005 Accenture6

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: 0104 abap dictionary

Copyright © 2005 Accenture7

Basic Data Dictionary Objects

FieldField

Data ElementData Element

DomainDomainTableTable

usesuses

usesuses

Page 8: 0104 abap dictionary

Copyright © 2005 Accenture8

Levels of Abstraction

DomainDomain

Data Element Data Element

• Data type• Number of characters• Output length• Value table

• Attributes inherited from domain• Field labels

FieldField

Table

• Field name• Primary key indicator• Attributes inherited from data element

Page 9: 0104 abap dictionary

Copyright © 2005 Accenture9

Two-Level Domain Concept

S_CITY

S_TO_CITYS_FROM_CIT

DepartureCity

DestinationCity

Domain

Dataelement

City

Page 10: 0104 abap dictionary

Copyright © 2005 Accenture10

Domain

Page 11: 0104 abap dictionary

Copyright © 2005 Accenture11

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: SCARRCarrier ID Name

AA AmericanDL DeltaLH LufthansaSA SingaporeUA United

Page 12: 0104 abap dictionary

Copyright © 2005 Accenture12

Data Element

Attributes inherited from the domain

Page 13: 0104 abap dictionary

Copyright © 2005 Accenture13

Interdependency of ABAP Dictionary Objects

Tab.

Tab.

Tables Domains"technicalfield description"

From City

To City

S_FROM_CIT

S_TO_CITY

City

S_CITY

Tab.

Data elements"semanticfield description"

Page 14: 0104 abap dictionary

Copyright © 2005 Accenture14

Table

Primary key (Field) values

Table SCARR

Carrier ID

AADLLHUA...

Carrier Name

American AirlinesDeltaLufthansaUnited Airlines...

TABLEAirline Carriers

Rows (tuples)

Page 15: 0104 abap dictionary

Copyright © 2005 Accenture15

Relationships Between Tables: Foreign Keys

PLANETYPE SEATSMAX

747-200 200 20000A310-200 211 24000757-300 301 17000

CheckTable

FLDATECARRID PRICECONNID

AA 1234 03/22/1999 500 747-200 125 UA 5678 01/06/1999 600 A310-200 90

ForeignKeyTable

Table 1: Airplane Details Table SAPLANE

Table 2: Flight Table SFLIGHT

PLANETYPE SEATSOCC

CARGOMAX

Primary Key Foreign Key

Primary Key

Page 16: 0104 abap dictionary

Copyright © 2005 Accenture16

Check Table - System Default

- DOMAIN S_PLANE

Value table

SAPLANE

System default

- Table SFLIGHT- Field PLANETYPE

Check table SAPLANE

Page 17: 0104 abap dictionary

Copyright © 2005 Accenture17

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: 0104 abap dictionary

Copyright © 2005 Accenture18

ConfigurationData

MasterData

TransactionData

SystemData

• 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: 0104 abap dictionary

Copyright © 2005 Accenture19

SAP Table Types

Transparent

Cluster

Pool

Internal

ABAPDictionary

ABAPProgram

Page 20: 0104 abap dictionary

Copyright © 2005 Accenture20

Table Definition

TRANSP table Structure table

Createtransp. table

Activate

Note: DB table will be createdautomatically!

Createint. table

Activate

Page 21: 0104 abap dictionary

Copyright © 2005 Accenture21

Creating / Changing Tables

Page 22: 0104 abap dictionary

Copyright © 2005 Accenture22

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: 0104 abap dictionary

Copyright © 2005 Accenture23

Indexes

DBDB

S1 S2 ... F1 F2 ... F2 S1 S2

T1_KT1_KT1T1

S1 S2 ... F1 F2 ...T1T1 T1_KT1_K

Identific.UniqueDesc

ABAP Dictionary

IndexIndex

Page 24: 0104 abap dictionary

Copyright © 2005 Accenture24

Data Class

TS1TS1

TSnTSn

TS2TS2

........TS1TS1

TSnTSn

TS2TS2

........TS1TS1

TSnTSn

TS2TS2

........

TS1 ... TSnTS1 ... TSn

APPL0APPL0(Master)(Master)

TSYS1 ... TSYSnTSYS1 ... TSYSn

APPL2APPL2(Organization & (Organization &

Customizing)Customizing)

TB1 ... TBnTB1 ... TBn

APPL1APPL1(Transaction)(Transaction)

DBDB

Page 25: 0104 abap dictionary

Copyright © 2005 Accenture25

TS1TS1

Dict Table Selection

T1 0T2 1T3 2T4 3

T5 4

DBDB

TS1TS1 TS1TS1TS1TS1

0000

1111

2222

3333

Number of data recordsin a storage area

4444

= 0 to 640K

= 610K to 2400K

= 2400K to 9800K

= 9800K to 39000K

= 39000K plus

Size Categories

Page 26: 0104 abap dictionary

Copyright © 2005 Accenture26

Exercise 1 - Create Basic ABAP Dictionary Objects, 60 minutesExercise 2 - Create Table Indexes, 20 minutes

Exercises

Page 27: 0104 abap dictionary

Copyright © 2005 Accenture27

Buffering

1st access

DBDB

T2T2

G1 G2 S3 F1 ...

T3T3

G1 G2 S3 ...

T1T1

S1 S2 F1 ...

ABAP DictionaryABAP Dictionary

S1 S2 F1 ...T1T1 T3T3

G1 G2 S3 ...T2T2

G1 G2 S3 F1 ...

T1T1

S1 S2 F1 ...

TABL TABLP

Buffer: 100% and generic Buffer: partial

Yes Import record

No

Yes

NoYes

Generickey

complete

SELECT SINGLErecord exists

No1st access

Yes

No

G1 G2 S3 F1 ...T2T2

S1 S2 F1 ...T3T3

Change numberof key fields

100% genericpartial

2

Page 28: 0104 abap dictionary

Copyright © 2005 Accenture28

Logging

DBDB

LogLogT1T1

Field-relatedlog records

DDDD

S1 S2 F1 F2 F3 ...Table T1Table T1

System profile

Logging

Change

S1 S2 F2 F3 ...

Manual

Page 29: 0104 abap dictionary

Copyright © 2005 Accenture29

INCLUDE Substructure

US USF1 USF2 USF3 .....

Table Field Data element

T1 S1 ...TRANSP S2 ...

.INCLUDE USF1 ...... ...

T2 F1 ...TRANSP .INCLUDE US

F2 ...... ...

Page 30: 0104 abap dictionary

Copyright © 2005 Accenture30

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: 0104 abap dictionary

Copyright © 2005 Accenture31

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: 0104 abap dictionary

Copyright © 2005 Accenture32

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: 0104 abap dictionary

Copyright © 2005 Accenture33

Search Help Fields

Page 34: 0104 abap dictionary

Copyright © 2005 Accenture34

Exercise 3 – Create an Elementary Search Help, 30 minutes

Exercise

Page 35: 0104 abap dictionary

Copyright © 2005 Accenture35

Data Browser

ABAP Workbench

Tools

Overview

Data Browser (SE16)

Page 36: 0104 abap dictionary

Copyright © 2005 Accenture36

User Parameters

Page 37: 0104 abap dictionary

Copyright © 2005 Accenture37

Using the Browser

Page 38: 0104 abap dictionary

Copyright © 2005 Accenture38

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 Fields to be used for data used for data selection ...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 Sort User parameters Choose FieldsChoose FieldsFields For SelectionFields For Selection

Page 39: 0104 abap dictionary

Copyright © 2005 Accenture39

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

Exercises

Page 40: 0104 abap dictionary

Copyright © 2005 Accenture40

Any questions?

Questions & Answers