You are on page 1of 117

ITC Infotech India Ltd

Overview of the ABAP Dictionary

Definition and functions of the ABAP Dictionary Basic objects of the ABAP Dictionary The Database Utility

ITC Infotech India Ltd

What is a Data Dictionary?

ITC Infotech India Ltd

Functions of the ABAP Dictionary

Data Integrity

No Redundant Data Definitions

Integration with the ABAP Workbench

ITC Infotech India Ltd

Data Integrity

ITC Infotech India Ltd

No Redundant Data Definitions

ITC Infotech India Ltd

Integration with the ABAP Workbench

ITC Infotech India Ltd

Basic Objects of the ABAP Dictionary


Table A Table B Table C

Data Element 1

Data Element 2

Domain

ITC Infotech India Ltd

Database Utility

Database Database Utility

ITC Infotech India Ltd

ABAP Dictionary Objects


Tables Data Elements Domains Using a Table in an ABAP Program

ITC Infotech India Ltd

Accessing the ABAP Dictionary

ITC Infotech India Ltd

Basic Objects of the ABAP Data Dictionary


Table A Table B Table C

Data Element 1

Data Element 2

Domain

ITC Infotech India Ltd

Tables
TABLE KNA1 (Customers)

Table: KNA1 MANDT KUNNR Name 1 ORT 02

ITC Infotech India Ltd

Create a Table
Maintain delivery class Enter a description (short text).

Maintain field attributes in Fields tab

Table maintenance attribute

ITC Infotech India Ltd

Two-Level Domain Concept


Data Element 1 Data Element 2

Domain

ITC Infotech India Ltd

Data Elements
Table A Table B

Data Element 1

ITC Infotech India Ltd

Pre-Defined Data Elements

ITC Infotech India Ltd

Data Element Documentation

ITC Infotech India Ltd

Create Data Element name. Enter a description (short text). Enter domain

Maintain field labels and column headers in the Field Label tab

ITC Infotech India Ltd

Domains
Table A

Data Elements

Domain

ITC Infotech India Ltd

Characteristics of Domains
Table A

Data Elements

Domain

ITC Infotech India Ltd

Allowed Values
Domain Domain

January February

Value Table

March . . . . . . . December

ITC Infotech India Ltd

Benefits of Using Allowed Values

valid values

invalid values

ITC Infotech India Ltd

Create a Domain
Enter a description (short text).

Enter data type and length.

Explicit Values, Intervals or a value table may be entered In the Value range tab

ITC Infotech India Ltd

Using a Table in Program Code


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

ITC Infotech India Ltd

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

ITC Infotech India Ltd

Definition of Foreign Keys

ITC Infotech India Ltd

Uses of Foreign Keys


Maintain data integrity Provide help texts Create aggregate dictionary objects

ITC Infotech India Ltd

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.

ITC Infotech India Ltd

Foreign Keys: Key Terminology


Value Table

Check Table

Foreign Key Table

ITC Infotech India Ltd

Foreign Key Terminology: Check Table = Value Table

Check Table

Value Table

ITC Infotech India Ltd

Foreign Key Terminology: Check Table Value Table

Check Table

Value Table

ITC Infotech India Ltd

Establishing a Foreign Key Relationship in the ABAP Dictionary

ITC Infotech India Ltd

Cardinality

n : m
1
C 1 C N CN

ITC Infotech India Ltd

Foreign Key Field Type


Check Table: Students Foreign Key Table: Course Enrolment
Course Enrolment

STUDENT_ID

ITC Infotech India Ltd

Foreign Key Type: Key Fields or Key Field Candidates

Faculty

Course

ITC Infotech India Ltd

Foreign Key Type: Key Fields of a Text Table


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

ITC Infotech India Ltd

Foreign Key Type: Non-Key Field Candidates


Professor

Course

ITC Infotech India Ltd

Creating a Foreign Key Relationship

Foreign key push-button

ITC Infotech India Ltd

Maintaining a Foreign Key Relationships Attributes


Enter a description (short text).

Check table (defaults to value table)

Maintain foreign key type

Maintain cardinality n : m

ITC Infotech India Ltd

Foreign Keys with Multiple Fields

ITC Infotech India Ltd

Field-By-Field Assignment
Foreign Key Table Check Table

ITC Infotech India Ltd

Partial Foreign Keys

ITC Infotech India Ltd

Constant Foreign Keys

ITC Infotech India Ltd

Changing the Field Assignment

Generic foreign key Constant foreign key

ITC Infotech India Ltd

ABAP Dictionary Tables in Relational Databases


SAP Table Types Technical Settings Indexes

ITC Infotech India Ltd

SAP Table Types

Transparent Table (TRANSP)

Structure (INTTAB)

Pool Table

Cluster Table

View

ITC Infotech India Ltd

Transparent Tables Type = TRANSP


Master Data

ITC Infotech India Ltd

Table Types TRANSP in the Database


PROFILE

DB

ITC Infotech India Ltd

Mapping a Table of Type INTTAB


PROFILE

DB

ITC Infotech India Ltd

Pool and Cluster Tables: Overview


Pool Table Cluster Table

ITC Infotech India Ltd

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

Size category

Buffering

Single records, generic, full, not buffered

Log data changes

on or off

ITC Infotech India Ltd

Data Class
Transaction data
Organization and Customizing data

Master data

User data

DB

ITC Infotech India Ltd

Size Categories

ITC Infotech India Ltd

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

ITC Infotech India Ltd

Logging

ITC Infotech India Ltd

Maintaining Technical Settings

ITC Infotech India Ltd

Index

ITC Infotech India Ltd

Database Utility

DB

ITC Infotech India Ltd

ABAP Repository Information System


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

ITC Infotech India Ltd

ABAP Repository Info System: Typical Queries


ABAP Dictionary

Find (Object Search)


Find all objects of type A with attributes X, Y, Z.

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

ITC Infotech India Ltd

ABAP Repository: Initial Screen

ITC Infotech India Ltd

Find: Selection Screen

Enter a single value for the search attributes or use the arrow push-buttons for selection options Use the All Selections pushbutton to limit search criteria on other object attributes

ITC Infotech India Ltd

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

ITC Infotech India Ltd

Hit List Options: Standard Options

ITC Infotech India Ltd

Hit List Options: Application Toolbar

ITC Infotech India Ltd

Where-Used List: Selection Screen

List of all objects that object may be used in

ITC Infotech India Ltd

Relationship between Objects Where-Used and Sub-Objects Lists


Program

Table Data Elements Domains

Screen

ITC Infotech India Ltd

ABAP Repository Info System


Modeling

ABAP Dictionary

Programming

Environment

ITC Infotech India Ltd

ABAP Dictionary Changes


Activation Data Consistency and Conversion Version Management Miscellaneous Changes

ITC Infotech India Ltd

Activation
Data Object

ABAP Dictionary Activation Icon

ITC Infotech India Ltd

Mass Activation
Online

Background

ITC Infotech India Ltd

Table Activation
Screen Painter
ABAP Programs

? Consistency

Checks?

Log Entries

Updates

ITC Infotech India Ltd

Database Utility

Online vs. Background

Log File
DB

ITC Infotech India Ltd

Change Key of Value Table


Tables YANGIE1 YEMPLOY YZIPCODES Value Table
1 1 9 9 7 7 0 0 2 2

Domain YZIP
NUMC 10

ITC Infotech India Ltd

Versions

ITC Infotech India Ltd

Version Management

modified (revised) version

active version

temporary versions

ITC Infotech India Ltd

Version Management
Display

Compare

Retrieve stored version of object

REMOTE compare

ITC Infotech India Ltd

Locks on Dictionary Objects

ITC Infotech India Ltd

SPDD Transaction

ITC Infotech India Ltd

ABAP Dictionary Objects: Views


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

ITC Infotech India Ltd

What is a View?

ITC Infotech India Ltd

The Most Basic Form of a View

ITC Infotech India Ltd

The Relational Operations


Projection Table 1 Selection Table 2 Join Table 3 Table 4

View A View B

View C

ITC Infotech India Ltd

The Projection Operation


Projection
Table 1

View A

ITC Infotech India Ltd

Specifying Projected Fields


Indicate actual name of table field that holds that data.

Can use any name if database view, otherwise must be same name as table field.

ITC Infotech India Ltd

The Selection Operation


Selection Table 2

Example: Staff Level <= 3


View B

ITC Infotech India Ltd

Specifying Selection Criteria


Can include unprojected fields

ITC Infotech India Ltd

The Join Operation


Join
Table 3 Table 4

View C

ITC Infotech India Ltd

The Necessity of the Join Operation


Employee ID Salary Name Salary 1 Salary 2 Salary 3

ID
5579 5579 5579 5579

Name
Smith Smith Smith Smith

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

ITC Infotech India Ltd

Understanding the Join Operation


Employee ID Salary ID 5579 5579 5579 5579 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 Name

ITC Infotech India Ltd

The Join Operation and Foreign Keys


Primary
Table 3

Join

Secondary
Table 4

View C

ITC Infotech India Ltd

Specifying Joined Fields


Indicate base tables that data will come from.

Hit button to see related tables and automatically generate join conditions.

ITC Infotech India Ltd

Types of Views in the ABAP Dictionary


Database View Projection View Help View Maintenance View

ITC Infotech India Ltd

The Database View


Database View

DB

Database

ITC Infotech India Ltd

The Projection View


Projection View

ITC Infotech India Ltd

Database vs. Projection Views


Projection View Database View

ITC Infotech India Ltd

Other Types of Views


Help View Maintenance View

ITC Infotech India Ltd

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.

ITC Infotech India Ltd

Overview of Search Helps


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

ITC Infotech India Ltd

The Benefits of Search Helps


What was Smiths vendor number, anyway?

F4

ITC Infotech India Ltd

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

ITC Infotech India Ltd

Creating an Elementary Search Help


1
5 2 3 4

Create search help from Dictionary pushbutton on workbench, or from within Repository Browser.

ITC Infotech India Ltd

Defining an Elementary Search Help

Interface Parameters

ITC Infotech India Ltd

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

Position parameter will be on dialog box

Optional default for parameter

ITC Infotech India Ltd

Assigning an Elementary Search Help - Priority Levels

ITC Infotech India Ltd

Using Elementary Search Helps


F4

ITC Infotech India Ltd

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.

Defining a Collective Search Help Adding Elementary Search Helps

ITC Infotech India Ltd

Dont forget to assign parameters for each elementary search help.

ITC Infotech India Ltd

Using a Collective Search Help

F4

ITC Infotech India Ltd

Search Help Exits


Function Module with ABAP code
_________ ______ _______ ______ _____ _____

Search Help Processing

ITC Infotech India Ltd

Online Help & Documentation


Documentation for Dictionary objects F1 help F4 help Data element documentation/ supplemental documentation

ITC Infotech India Ltd

Online Help & Documentation


F1: Field Help DE doc. DE supp. doc. Other documentation: Tables Structures Domains

F4: Possible Input Values

ITC Infotech India Ltd

Data Element Documentation

ITC Infotech India Ltd

Table THLPF
Program Screen Table/field No entry necessary DE Supplement number

ITC Infotech India Ltd

Create Documentation through F1 or Screen Painter


From Plain F1 From DE Doc. From DE Doc. or from DE Supp. Doc. if DE Supp. Doc. is maintained

ITC Infotech India Ltd

Type Groups
ABAP Editor ABAP Editor PROGRAM 123.

PROGRAM ABC.

ABAP Editor PROGRAM XYZ.

TYPE-POOL . . .

TYPE-POOL . . .

TYPE-POOL . . .

TYPE GROUP

ABAP Dictionary

ITC Infotech India Ltd

Type Group - Use in Programs


ABAP Dictionary ABAP Editor

ABAP Program Run-Time Selection Screen

You might also like