04_SAP ABAP Dictionary

Embed Size (px)

Citation preview

  • 7/28/2019 04_SAP ABAP Dictionary

    1/172

    Overview of the ABAPDictionarySrinivasulu Nettem

  • 7/28/2019 04_SAP ABAP Dictionary

    2/172

    July 13, 2013

    Overview of the ABAP Dictionary

    Definition and functions of the ABAP Dictionary

    Basic objects of the ABAP Dictionary

    The Database Utility

  • 7/28/2019 04_SAP ABAP Dictionary

    3/172

    July 13, 2013

    What is a Data Dictionary?

    Data

    Dictionary

  • 7/28/2019 04_SAP ABAP Dictionary

    4/172

    July 13, 2013

    No Redundant Data Definitions

    Functions of the ABAP Dictionary

    Integration with the ABAP

    Workbench

    Data

    Dictionary

    Data Integrity

  • 7/28/2019 04_SAP ABAP Dictionary

    5/172

    July 13, 2013

    Data Integrity

  • 7/28/2019 04_SAP ABAP Dictionary

    6/172

    July 13, 2013

    No Redundant Data Definitions

  • 7/28/2019 04_SAP ABAP Dictionary

    7/172

    July 13, 2013

    Integration with the ABAP Workbench

    Data

    Dictionary

  • 7/28/2019 04_SAP ABAP Dictionary

    8/172

  • 7/28/2019 04_SAP ABAP Dictionary

    9/172

    July 13, 2013

    Database Utility

    Data

    Dictionary

    DatabaseUtility

    DatabaseDatabase

  • 7/28/2019 04_SAP ABAP Dictionary

    10/172

    July 13, 2013

    Data Modeling

    What is data modeling?

    Entities, attributes, & entity types

    Data modeling vs. ABAP Dictionary terminology

    Relationships and relationship types

    Cardinality

    Optionality

    Category

    Data model hierarchies Linking a data model to dictionary objects

  • 7/28/2019 04_SAP ABAP Dictionary

    11/172

    July 13, 2013

    Data Dictionary

    Real World

    What is Data Modeling?

    DataData

    DictionaryDictionary

    Data Model

  • 7/28/2019 04_SAP ABAP Dictionary

    12/172

    July 13, 2013

    Uses of a Data Model

  • 7/28/2019 04_SAP ABAP Dictionary

    13/172

    July 13, 2013

    EntityEntityCustomer

    Basic Components of a Data Model

    AttributeAttribute

    30 S. 17th St.

    Entity TypeEntity Type

    Order

  • 7/28/2019 04_SAP ABAP Dictionary

    14/172

    July 13, 2013

    Entity

    Customer

    Order

    Product

  • 7/28/2019 04_SAP ABAP Dictionary

    15/172

    July 13, 2013

    Attribute

    J. ElkinsJ. Elkins

    Customer30 S. 17th St.30 S. 17th St.30 S. 17th St.30 S. 17th St.

    215-555-8000215-555-8000215-555-8000215-555-8000

  • 7/28/2019 04_SAP ABAP Dictionary

    16/172

    July 13, 2013

    Entity Type

    Order

    CustomerProduct

  • 7/28/2019 04_SAP ABAP Dictionary

    17/172

    July 13, 2013

    Data Modeler/ABAP Dictionary Terminology

    Data Modeler ABAP DictionaryCustomer: entity record

    Customer address: attribute field

    Customers: entity type table

  • 7/28/2019 04_SAP ABAP Dictionary

    18/172

    July 13, 2013

    Customer

    Order

    Relationships between Entities

  • 7/28/2019 04_SAP ABAP Dictionary

    19/172

    July 13, 2013

    One - to - Many

    Many - to - ManyOne - to - One

    Cardinality

  • 7/28/2019 04_SAP ABAP Dictionary

    20/172

    July 13, 2013

    Order

    Order Lines

    1 1 A26Order # Qty

    Part #

    1 3 C589

    2 1 A26

    Many-to-Many Relationships

    Primary Key: Order Number

    Primary Key: Product Number

    Primary Keys: Order NumberProduct Number

  • 7/28/2019 04_SAP ABAP Dictionary

    21/172

    July 13, 2013

    ?

    Customer Order

    ?Customer

    Optionality

  • 7/28/2019 04_SAP ABAP Dictionary

    22/172

    July 13, 2013

    Dependent Entity Type

    Referenced Entity Type

    Customer ID Name Address . . .

    Order ID Date of Order Customer ID . . .

    Customer

    Order

    Referenced

    Dependent

    Referenced and Dependent Entity Types

  • 7/28/2019 04_SAP ABAP Dictionary

    23/172

    July 13, 2013

    SAP Graphic Notation

  • 7/28/2019 04_SAP ABAP Dictionary

    24/172

    July 13, 2013

    Customers Orders

    Example Using Graphic Notation

  • 7/28/2019 04_SAP ABAP Dictionary

    25/172

    July 13, 2013

    Professors

    Students

    Practice Using Graphic Notation I

  • 7/28/2019 04_SAP ABAP Dictionary

    26/172

    July 13, 2013

    Professors

    Students

    Practice Using Graphic Notation II

  • 7/28/2019 04_SAP ABAP Dictionary

    27/172

    July 13, 2013

    StudentsEnrolmentRecords

    Courses

    Practice Using Graphic Notation III

  • 7/28/2019 04_SAP ABAP Dictionary

    28/172

  • 7/28/2019 04_SAP ABAP Dictionary

    29/172

    July 13, 2013

    1

    C

    N

    CN

    1

    C

    N

    CN

    1

    C

    1

    C

    nn :: mmnn :: mm

    SAP Text Notation

  • 7/28/2019 04_SAP ABAP Dictionary

    30/172

    July 13, 2013

    Customers Orders

    1 CN:

    Example Using Text Notation

  • 7/28/2019 04_SAP ABAP Dictionary

    31/172

    July 13, 2013

    Students

    Professors

    :

    Practice Using Text Notation I

  • 7/28/2019 04_SAP ABAP Dictionary

    32/172

    July 13, 2013

    Students

    Professors

    :

    Practice Using Text Notation II

  • 7/28/2019 04_SAP ABAP Dictionary

    33/172

    July 13, 2013

    StudentsEnrolmentRecords

    Courses

    :

    Practice Using Text Notation III

  • 7/28/2019 04_SAP ABAP Dictionary

    34/172

    July 13, 2013

    Referential

    Hierarchical

    Aggregating

    ?

    Conditional-Referential

    Specialisation

    Category

  • 7/28/2019 04_SAP ABAP Dictionary

    35/172

  • 7/28/2019 04_SAP ABAP Dictionary

    36/172

    July 13, 2013

    Student

    Key:Student ID Number Enrollment Record

    Key:Student ID Number

    Course NumberCourse

    Key:Course Number

    Relationship Category: Aggregating

  • 7/28/2019 04_SAP ABAP Dictionary

    37/172

    July 13, 2013

    Department

    Key:Department Number

    Professor

    Key:Professor Number

    Relationship Category: Referential

    Relationship Categor

  • 7/28/2019 04_SAP ABAP Dictionary

    38/172

    July 13, 2013

    Department

    Key:Department Number

    Professor

    Key:Professor Number

    Relationship Category:Conditional-Referential

    Relationship Category

  • 7/28/2019 04_SAP ABAP Dictionary

    39/172

    July 13, 2013

    Business Customer

    Key:ID Number

    Customer

    Key:ID Number

    Relationship Category:Specialisation

  • 7/28/2019 04_SAP ABAP Dictionary

    40/172

    July 13, 2013

    GeneralAccounting

    Chart ofAccounts

    Currency

    FI

    . . .

    ..

    .

    ..

    .

    Data Model Hierarchies and the SAP EDM

    Linking a Data Model to ABAP Dictionary

  • 7/28/2019 04_SAP ABAP Dictionary

    41/172

    July 13, 2013

    DataData

    DictionaryDictionary

    Data Model

    Linking a Data Model to ABAP DictionaryObjects

  • 7/28/2019 04_SAP ABAP Dictionary

    42/172

    July 13, 2013

    ABAP Dictionary Objects

    Tables

    Data Elements

    Domains

    Using a Table in an ABAP Program

  • 7/28/2019 04_SAP ABAP Dictionary

    43/172

    July 13, 2013

    Accessing the ABAP Dictionary

    Data

    Dictionary

  • 7/28/2019 04_SAP ABAP Dictionary

    44/172

    July 13, 2013

    Basic Objects of the ABAPData Dictionary

    Table CTable BTable A

    Data Element 1 Data Element 2

    DomainDomain

  • 7/28/2019 04_SAP ABAP Dictionary

    45/172

    July 13, 2013

    Tables

    TABLE KNA1TABLE KNA1(Customers)(Customers)

    Name 1 ORT 02MANDT KUNNRTable: KNA1Table: KNA1Table: KNA1Table: KNA1

  • 7/28/2019 04_SAP ABAP Dictionary

    46/172

    July 13, 2013

    Create a Table

    Table maintenance attribute

    Enter a description (short text).Maintain delivery class

    Maintain field attributes in Fields tab

  • 7/28/2019 04_SAP ABAP Dictionary

    47/172

    July 13, 2013

    Two-Level Domain Concept

    Data Element 1 Data Element 2

    DomainDomain

  • 7/28/2019 04_SAP ABAP Dictionary

    48/172

    July 13, 2013

    Data Elements

    Table BTable A

    Data Element 1

  • 7/28/2019 04_SAP ABAP Dictionary

    49/172

    July 13, 2013

    Pre-Defined Data Elements

  • 7/28/2019 04_SAP ABAP Dictionary

    50/172

    July 13, 2013

    Data Element Documentation

  • 7/28/2019 04_SAP ABAP Dictionary

    51/172

    July 13, 2013

    Create Data Element

    Enter a description (short text).Enter domain name.

    intain field labels and column headers in the Field Label tab

  • 7/28/2019 04_SAP ABAP Dictionary

    52/172

    July 13, 2013

    Domains

    Table ATable A

    Data ElementsData Elements

    DomainDomain

  • 7/28/2019 04_SAP ABAP Dictionary

    53/172

    July 13, 2013

    Characteristics of Domains

    Table ATable A

    Data ElementsData Elements

    DomainDomain

  • 7/28/2019 04_SAP ABAP Dictionary

    54/172

    July 13, 2013

    Allowed Values

    Value Table

    DomainDomain DomainDomain

    January

    February

    March.......

    December

    fi f i ll d l

  • 7/28/2019 04_SAP ABAP Dictionary

    55/172

    July 13, 2013

    validvalues

    invalidvalues

    Benefits of Using Allowed Values

    C D i

  • 7/28/2019 04_SAP ABAP Dictionary

    56/172

    July 13, 2013

    Create a Domain

    Enter a description (short text).

    Enter data type and length.

    Explicit Values, Intervalsor

    a value table may be

    enteredIn the Value ran e tab

    U i T bl i P C d

  • 7/28/2019 04_SAP ABAP Dictionary

    57/172

    July 13, 2013

    Using a Table in Program Code

    TABLES:YEMPLOY.

    SELECT *FROM YEMPLOY.

    WRITE:/ YEMPLOY_IDYEMPLOY_NAME

    YEMPLOY_SALARY

    ENDSELECT.

    F i K R l ti hi

  • 7/28/2019 04_SAP ABAP Dictionary

    58/172

    July 13, 2013

    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

    D fi iti f F i K

  • 7/28/2019 04_SAP ABAP Dictionary

    59/172

    July 13, 2013

    Definition of Foreign Keys

    U f F i K

  • 7/28/2019 04_SAP ABAP Dictionary

    60/172

    July 13, 2013

    Uses of Foreign Keys

    Maintain data integrity

    Provide help texts

    Create aggregate dictionary objects

    Prerequisites for Constructing

  • 7/28/2019 04_SAP ABAP Dictionary

    61/172

    July 13, 2013

    e equ s es o Co s uc gForeign 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.

    F i K K T i l

  • 7/28/2019 04_SAP ABAP Dictionary

    62/172

    July 13, 2013

    Check TableCheck Table

    Value TableValue Table

    Foreign Keys: Key Terminology

    Foreign Key TableForeign Key Table

    Foreign Key Terminology:

  • 7/28/2019 04_SAP ABAP Dictionary

    63/172

    July 13, 2013

    CheckTable

    Value

    Table

    g y gyCheck Table = Value Table

    Foreign Key Terminology:

  • 7/28/2019 04_SAP ABAP Dictionary

    64/172

    July 13, 2013

    g y gyCheck Table Value Table

    Check

    Table

    Valu

    eTable

    E bli hi F i K

  • 7/28/2019 04_SAP ABAP Dictionary

    65/172

    July 13, 2013

    Data

    Dictionary

    Establishing a Foreign KeyRelationship in the ABAP Dictionary

    Cardinality

  • 7/28/2019 04_SAP ABAP Dictionary

    66/172

    July 13, 2013

    Cardinality

    nn :: mmnn :: mm1

    C

    1

    C

    N

    CN

    Foreign Key Field Type

  • 7/28/2019 04_SAP ABAP Dictionary

    67/172

    July 13, 2013

    Course Enrolment

    STUDENT_ID ?

    Foreign Key Field Type

    Check Table: Students

    Foreign Key Table: Course Enrolment

    Foreign Key Type:

  • 7/28/2019 04_SAP ABAP Dictionary

    68/172

    July 13, 2013

    g y ypKey Fields or Key Field Candidates

    Faculty Course

    Foreign Key Type:

  • 7/28/2019 04_SAP ABAP Dictionary

    69/172

    July 13, 2013

    g y ypKey Fields of a Text Table

    T005(Country Codes)

    (T002)

    (Language Codes)

    T005T(Country descriptions)

    Foreign Key Type:

  • 7/28/2019 04_SAP ABAP Dictionary

    70/172

    July 13, 2013

    Non-Key Field Candidates

    Course

    Professor

  • 7/28/2019 04_SAP ABAP Dictionary

    71/172

    July 13, 2013

    Foreign key push-button

    Creating a Foreign Key Relationship

    Maintaining a Foreign Key Relationships

  • 7/28/2019 04_SAP ABAP Dictionary

    72/172

    July 13, 2013

    Enter a description (short text).

    Maintain cardinality n : m

    Maintain foreignkey type

    Check table(defaults tovalue table)

    Attributes

    Foreign Keys with Multiple Fields

  • 7/28/2019 04_SAP ABAP Dictionary

    73/172

    July 13, 2013

    Foreign Keys with Multiple Fields

    Field-By-Field Assignment

  • 7/28/2019 04_SAP ABAP Dictionary

    74/172

    July 13, 2013

    Check TableCheck Table

    Field-By-Field Assignment

    Foreign Key TableForeign Key Table

    Partial Foreign Keys

  • 7/28/2019 04_SAP ABAP Dictionary

    75/172

    July 13, 2013

    Partial Foreign Keys

    Constant Foreign Keys

  • 7/28/2019 04_SAP ABAP Dictionary

    76/172

    July 13, 2013

    Constant Foreign Keys

    BIO

  • 7/28/2019 04_SAP ABAP Dictionary

    77/172

    ABAP Dictionary Tables

  • 7/28/2019 04_SAP ABAP Dictionary

    78/172

    July 13, 2013

    in Relational Databases SAP Table Types

    Technical Settings

    Indexes

  • 7/28/2019 04_SAP ABAP Dictionary

    79/172

    Transparent TablesT TRANSP

  • 7/28/2019 04_SAP ABAP Dictionary

    80/172

    July 13, 2013

    Type = TRANSP

    Master DataMaster Data

    Table Types TRANSPi th D t b

  • 7/28/2019 04_SAP ABAP Dictionary

    81/172

    July 13, 2013

    in the Database

    DB

    PROFILE

    Mapping a Table of Type INTTAB

  • 7/28/2019 04_SAP ABAP Dictionary

    82/172

    July 13, 2013

    Mapping a Table of Type INTTAB

    DB xx

    PROFILE

    Pool and Cluster Tables: Overview

  • 7/28/2019 04_SAP ABAP Dictionary

    83/172

    July 13, 2013

    Pool and Cluster Tables: Overview

    Pool Table Cluster TableCluster Table

    Technical Settings

  • 7/28/2019 04_SAP ABAP Dictionary

    84/172

    July 13, 2013

    MasterTransaction

    Organization &Customizing

    User

    Technical Settings

    Data class

    Number of data records inDB storage

    Single records,

    generic, full, notbuffered

    on or off

    Size category

    Buffering

    Log data changes

    Data Class

  • 7/28/2019 04_SAP ABAP Dictionary

    85/172

    July 13, 2013

    Master data User data

    Data Class

    Organization andCustomizing data

    Transaction data

    DB

    Size Categories

  • 7/28/2019 04_SAP ABAP Dictionary

    86/172

    July 13, 2013

    g

    Buffering Type

  • 7/28/2019 04_SAP ABAP Dictionary

    87/172

    July 13, 2013

    g yp

    None

    Single Record Generic

    Full

    KF1 KF2 KF3 F4 F5 F6 KF1 KF2 KF3 F4 F5 F6

    KF1 KF2 KF3 F4 F5 F6

    Logging

  • 7/28/2019 04_SAP ABAP Dictionary

    88/172

    July 13, 2013

    gg g

    Maintaining Technical Settings

  • 7/28/2019 04_SAP ABAP Dictionary

    89/172

    July 13, 2013

    g g

    Index

  • 7/28/2019 04_SAP ABAP Dictionary

    90/172

    July 13, 2013

    Database Utility

  • 7/28/2019 04_SAP ABAP Dictionary

    91/172

    July 13, 2013

    ABAPABAPDictionar

    Dictionaryy

    DB

    y

    Adding Structures

  • 7/28/2019 04_SAP ABAP Dictionary

    92/172

    July 13, 2013

    g

    Substructures

    Customizing Includes

    Append Structures

    Including Structures in Tables

  • 7/28/2019 04_SAP ABAP Dictionary

    93/172

    July 13, 2013

    Table XYZ

    .INCLUDE CI_XXX

    Table T

    .APPEND ZAT

    Table YCUSTAB

    .INCLUDE YSTRUC

    Append StructuresAppend Structures

    SubstructuresSubstructures Customizing IncludesCustomizing Includes

    Customer Tables SAPTables

    SAP Tables

    Field 1Field 1Field 2Field 2......Field nField n

    g

    Substructure

  • 7/28/2019 04_SAP ABAP Dictionary

    94/172

    July 13, 2013

    YS-F1 YS-F2 YS-F3...

    TableTable FieldField Data elementData elementYT2YT2 S1S1

    (TRANSP)(TRANSP) S2S2

    F1F1

    TableTable FieldField Data elementData element

    YT1YT1 S1S1

    (TRANSP)(TRANSP) S2S2

    F1F1

    .INCLUDE YS

    .INCLUDE YS

    YS

    Customizing Include

  • 7/28/2019 04_SAP ABAP Dictionary

    95/172

    July 13, 2013

    CI_XXX

    TableTable FieldField Data elementData element

    XYZXYZ S1S1F1F1. . .. . .

    FnFn

    TableTable FieldField Data elementData element

    XYZXYZ S1S1F1F1. . .. . .

    FnFn

    .INCLUDE CI_XXX

    CI_XXX-F1CI_XXX-F2 CI_XXX-F3

    Append Structure

  • 7/28/2019 04_SAP ABAP Dictionary

    96/172

    July 13, 2013

    ZAT-F1 ZAT-F2 ZAT-F3

    TableTable FieldField Data elementData element

    TT S1S1F1F1. . .. . .

    FnFn

    .APPEND ZAT

    ZAT

    ABAP RepositoryInformation System

  • 7/28/2019 04_SAP ABAP Dictionary

    97/172

    July 13, 2013

    Information System The Repository Information System

    Object Searches (Find)

    Use of Objects in Objects (Where-Used) Searching for Objects Outside the Dictionary

    ABAP Repository Info System: Typical Queries

  • 7/28/2019 04_SAP ABAP Dictionary

    98/172

    July 13, 2013

    ABAPABAPDictionaryDictionary

    Find (Object Search)Find (Object Search)

    Find all objects ofFind all objects oftype A withtype A with

    attributes X, Y, Z.attributes X, Y, Z.

    Where-used listsWhere-used lists

    Find all objects ofFind all objects oftype A that usetype A that use

    object Bobject B

    ABAP Repository: Initial Screen

  • 7/28/2019 04_SAP ABAP Dictionary

    99/172

    July 13, 2013

    Find: Selection Screen

  • 7/28/2019 04_SAP ABAP Dictionary

    100/172

    July 13, 2013

    Enter a singleEnter a single

    value forvalue forthe searchthe search

    attributes orattributes oruse the arrowuse the arrowpush-buttonspush-buttons

    for selectionfor selectionoptionsoptions

    Use the All SelectionsUse the All Selectionspushbutton to limit search criteriapushbutton to limit search criteria

    on other object attributeson other object attributes

    Selection Options

  • 7/28/2019 04_SAP ABAP Dictionary

    101/172

    July 13, 2013

    Simplified Selection (single values)

    =

    >