Vous êtes sur la page 1sur 93

ABAP Dictionary Objects

Tables Data Elements Domains Using a Table in an ABAP Program

BC030_03.1

ABAP Dictionary Objects

Accessing the ABAP Dictionary

BC030_03.2

ABAP Dictionary Objects

Basic Objects of the ABAP Data Dictionary


Table A Table B Table C

Data Element 1

Data Element 2

Domain
BC030_03.3 ABAP Dictionary Objects

Tables
TABLE KNA1 (Customers)

Table: KNA1 MANDT KUNNR Name 1 ORT 02

BC030_03.4

ABAP Dictionary Objects

Create a Table

Enter a description (short text).

Maintain delivery class

Table Maintenance attributes

BC030_03.5

ABAP Dictionary Objects

Create a Table

Maintain field attributes

BC030_03.6

ABAP Dictionary Objects

Two-Level Domain Concept

Data Element 1

Data Element 2

Domain

BC030_03.7

ABAP Dictionary Objects

Data Elements
Table A Table B

Data Element 1

BC030_03.8

ABAP Dictionary Objects

Pre-Defined Data Elements

BC030_03.9

ABAP Dictionary Objects

Data Element Documentation

BC030_03.10

ABAP Dictionary Objects

Create Data Element

Enter a description (short text).

Enter domain name.

BC030_03.11

ABAP Dictionary Objects

Create Data Element

Maintain field labels and column headers.

BC030_03.12

ABAP Dictionary Objects

Domains
Table A

Data Elements

Domain

BC030_03.13

ABAP Dictionary Objects

Characteristics of Domains
Table A

Data Elements

Domain

BC030_03.14

ABAP Dictionary Objects

Allowed Values
Domain Domain

January February March . . . . . . . December


BC030_03.15 ABAP Dictionary Objects

Value Table

Benefits of Using Allowed Values

valid values

invalid values

BC030_03.16

ABAP Dictionary Objects

Create a Domain

Enter a description (short text).

Enter data type and length.

BC030_03.17

ABAP Dictionary Objects

Create a Domain

Explicit values or a value table may be entered.

BC030_03.18

ABAP Dictionary Objects

Using a Table in Program Code

TABLES: YEMPLOY. SELECT * FROM YEMPLOY. WRITE: / YEMPLOY_ID YEMPLOY_NAME YEMPLOY_SALARY ENDSELECT.

BC030_03.19

ABAP Dictionary Objects

Foreign Key Relationships


Definition & Uses of Foreign Keys Prerequisites for Constructing Foreign Key Relationships Key Terminology Cardinality and Foreign Key Field Types Foreign Keys with Multiple Fields

BC030_03.20

ABAP Dictionary Objects

Definition of Foreign Keys

BC030_03.21

ABAP Dictionary Objects

Uses of Foreign Keys


Maintain data integrity Provide help texts Create aggregate dictionary objects

BC030_03.22

ABAP Dictionary Objects

Prerequisites for Constructing Foreign Key Relationships


The foreign key field and the primary key of the check table must share the same domain. A value table must exist for that domain.

BC030_03.23

ABAP Dictionary Objects

Foreign Keys: Key Terminology

Value Table

Check Table

Foreign Key Table


BC030_03.24 ABAP Dictionary Objects

Foreign Key Terminology: Check Table = Value Table

Check Table

Value Table

BC030_03.25

ABAP Dictionary Objects

Foreign Key Terminology: Check Table { Value Table

Check Table

Value Table

BC030_03.26

ABAP Dictionary Objects

Establishing a Foreign Key Relationship in the ABAP Dictionary

BC030_03.27

ABAP Dictionary Objects

Cardinality

n : m
1 C 1 C N CN
BC030_03.28 ABAP Dictionary Objects

Foreign Key Field Type


Check Table: Students

Foreign Key Table: Course Enrolment

Course Enrolment

STUDENT_ID

BC030_03.29

ABAP Dictionary Objects

Foreign Key Type: Key Fields or Key Field Candidates

Faculty

Course

BC030_03.30

ABAP Dictionary Objects

Foreign Key Type: Key Fields of a Text Table

T005 (Country Codes) T005T (Country descriptions) (T002) (Language Codes)

BC030_03.31

ABAP Dictionary Objects

Foreign Key Type: Non-Key Field Candidates

Professor

Course

BC030_03.32

ABAP Dictionary Objects

Creating a Foreign Key Relationship

Foreign key push-button

BC030_03.33

ABAP Dictionary Objects

Maintaining a Foreign Key Relationships Attributes

Check table (defaults to value table)

Enter a description (short text).

Maintain foreign key type Maintain cardinality n : m


BC030_03.34 ABAP Dictionary Objects

Foreign Keys with Multiple Fields

BC030_03.35

ABAP Dictionary Objects

Field-By-Field Assignment

Foreign Key Table

Check Table

BC030_03.36

ABAP Dictionary Objects

Partial Foreign Keys

BC030_03.37

ABAP Dictionary Objects

Constant Foreign Keys

BC030_03.38

ABAP Dictionary Objects

Changing the Field Assignment

Generic foreign key

Constant foreign key

BC030_03.39

ABAP Dictionary Objects

ABAP Dictionary Tables in Relational Databases


SAP Table Types Technical Settings Indexes

BC030_03.40

ABAP Dictionary Objects

SAP Table Types

Transparent Table (TRANSP) Pool Table

Structure (INTTAB)

Cluster Table

View
BC030_03.41 ABAP Dictionary Objects

Transparent Tables Type = TRANSP

Master Data

BC030_03.42

ABAP Dictionary Objects

Table Types TRANSP in the Database


PROFILE

DB

BC030_03.43

ABAP Dictionary Objects

Mapping a Table of Type INTTAB


PROFILE

DB
BC030_03.44 ABAP Dictionary Objects

Pool and Cluster Tables: Overview


Pool Table Cluster Table

BC030_03.45

ABAP Dictionary Objects

Technical Settings
Master Transaction Organization & Customizing User Number of data records in DB storage

Data class

Size category

Buffering

Single records, generic, full, not buffered

Log data changes


BC030_03.46

on or off
ABAP Dictionary Objects

Data Class
Transaction data Organization and Customizing data

Master data

User data

DB

BC030_03.47

ABAP Dictionary Objects

Size Categories

BC030_03.48

ABAP Dictionary Objects

Buffering Type
Single Record
KF1 KF2 KF3 F4 F5 F6

Generic
KF1 KF2 KF3 F4 F5 F6

Full
KF1 KF2 KF3 F4 F5 F6

None

BC030_03.49

ABAP Dictionary Objects

Logging

BC030_03.50

ABAP Dictionary Objects

Maintaining Technical Settings

BC030_03.51

ABAP Dictionary Objects

Index

BC030_03.52

ABAP Dictionary Objects

Database Utility

DB
BC030_03.53 ABAP Dictionary Objects

ABAP Repository Information System


The Repository Information System Object Searches (Find) Use of Objects in Objects (Where-Used) Searching for Objects Outside the Dictionary

BC030_03.54

ABAP Dictionary Objects

ABAP Repository Info System: Typical Queries


ABAP Dictionary

Find (Object Search) Find all objects of type A with attributes X, Y, Z.

WhereWhere-used lists Find all objects of type A that use object B

BC030_03.55

ABAP Dictionary Objects

ABAP Repository: Initial Screen

BC030_03.56

ABAP Dictionary Objects

Find: Selection Screen

Enter a single value for the search attributes or use the arrow pushpush-buttons for selection options Use the All Selections pushbutton to limit search criteria on other object attributes
BC030_03.57 ABAP Dictionary Objects

Selection Options
Simplified Selection (single values)

= > <

Equal Pattern Greater than or equal Less than or equal

> <

Not equal Exclude pattern Greater than Less than

Toggle push-buttons Complex Selection (ranges)

[]

Inclusive

][

Exclusive
ABAP Dictionary Objects

BC030_03.58

Hit List Options: Standard Options

BC030_03.59

ABAP Dictionary Objects

Where-Used List: Selection Screen

List of all objects that object may be used in

BC030_03.60

ABAP Dictionary Objects

Relationship between Objects Where-Used and Sub-Objects Lists

Program

Table Data Elements Domains

Screen
BC030_03.61 ABAP Dictionary Objects

ABAP Repository Info System

Modeling

ABAP Dictionary

Programming

Environment

BC030_03.62

ABAP Dictionary Objects

ABAP Dictionary Objects: Views


Definition Relational operations Types of views Using a view in program code

BC030_03.63

ABAP Dictionary Objects

What is a View?

BC030_03.64

ABAP Dictionary Objects

The Most Basic Form of a View

BC030_03.65

ABAP Dictionary Objects

The Relational Operations


Projection Table 1 Selection Table 2 Join Table 3 Table 4

View A View B

View C

BC030_03.66

ABAP Dictionary Objects

The Projection Operation


Projection Table 1

View A

BC030_03.67

ABAP Dictionary Objects

Specifying Projected Fields


Indicate actual table Fields and data elements.

Can use any name if database view, otherwise must be same name as table field.
BC030_03.68 ABAP Dictionary Objects

The Selection Operation


Selection Table 2

Example: Staff Level <= 3 View B

BC030_03.69

ABAP Dictionary Objects

Specifying Selection Criteria


Can include unprojected fields

BC030_03.70

ABAP Dictionary Objects

The Join Operation


Join Table 3 Table 4

View C

BC030_03.71

ABAP Dictionary Objects

The Necessity of the Join Operation


Employee ID Salary ID 5579 5579 5579 5579
BC030_03.72

Name

Salary 1

Salary 2 Salary 3

Name Smith Smith Smith Smith

Salary $10,000.00 $11,000.00 Wrong $12,000.00 $13,000.00


ABAP Dictionary Objects

Understanding the Join Operation


Employee ID Salary ID 5579 5579 5579 5579
BC030_03.73

Name

Salary $10,000.00 $11,000.00 $12,000.00 $13,000.00

Date Effective 10/1/91 10/1/92 Right 10/1/94 10/1/96


ABAP Dictionary Objects

The Join Operation and Foreign Keys


Primary
Table 3

Join

Secondary
Table 4

View C

BC030_03.74

ABAP Dictionary Objects

Specifying Joined Fields


Indicate base tables that data will come from.

Hit button to see related tables and automatically generate join conditions.
BC030_03.75 ABAP Dictionary Objects

Types of Views in the ABAP Dictionary


Database View Projection View Help View Maintenance View

BC030_03.76

ABAP Dictionary Objects

The Database View


Database View

DB
BC030_03.77

Database

ABAP Dictionary Objects

The Projection View


Projection View

BC030_03.78

ABAP Dictionary Objects

Database vs. Projection Views


Projection View Database View

BC030_03.79

ABAP Dictionary Objects

Other Types of Views


Help View Maintenance View

BC030_03.80

ABAP Dictionary Objects

Using a View in Program Code

TABLES:

YXXEMP_V.

SELECT * FROM YXXEMP_V. WRITE:/ YXXEMP_V-EMP_ID YXXEMP_V-LAST_NAME, YXXEMP_V-FIRST_NAME.

ENDSELECT.

BC030_03.81

ABAP Dictionary Objects

Overview of Search Helps


Benefits of Search Helps Elementary Search Helps Collective Search Helps Search Help Exits

BC030_03.82

ABAP Dictionary Objects

The Benefits of Search Helps


What was Smiths vendor number, anyway?

F4

BC030_03.83

ABAP Dictionary Objects

Elementary vs. Collective

Collective Search Help

E l e m e n t a r y 1

Field H Field B Field K

E l e m e n t a r y 2

Field Z

Field O

E l e m e n t a r y 3

Field A

E l e m e n t a r y 4

Field R Field X Field B Field O Field Q

BC030_03.84

ABAP Dictionary Objects

Creating an Elementary Search Help

Create search help from Dictionary pushbutton on workbench, or from within Repository Browser.
BC030_03.85 ABAP Dictionary Objects

Defining an Elementary Search Help

Data source for hit list Hit List Display Method Used to identify search help

Optio nal exit

Interface Parameters

BC030_03.86

ABAP Dictionary Objects

Defining an Elementary Search Help - Interface Parameters


Parameters for values you want to send and receive Parameter is display only Data element associated with parameter

Declaration of parameters as import and/or export

Position parameter will be on hit list


BC030_03.87

Position parameter will be on dialog box

Optional default for parameter

ABAP Dictionary Objects

Assigning an Elementary Search Help - Priority Levels

Table Field

Data Element
BC030_03.88 ABAP Dictionary Objects

Using Elementary Search Helps

F4

BC030_03.89

ABAP Dictionary Objects

Defining a Collective Search Help - Interface

Notice there is no selection method. A collective search help is a set of one or more elementary search helps.

BC030_03.90

ABAP Dictionary Objects

Defining a Collective Search Help Adding Elementary Search Helps

Dont forget to assign parameters for each elementary search help.


BC030_03.91 ABAP Dictionary Objects

Using a Collective Search Help

F4

Only difference from Before - toggle tab between elementary Search helps.

BC030_03.92

ABAP Dictionary Objects

Search Help Exits

Function Module with ABAP code _________ ______ _______ ______ _____ _____

Search Help Processing

BC030_03.93

ABAP Dictionary Objects

Vous aimerez peut-être aussi