03_abap - the data dictionary

Upload: varaprasadp

Post on 14-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 03_ABAP - The Data Dictionary

    1/56

    ABAP - The Data Dictionary

  • 7/30/2019 03_ABAP - The Data Dictionary

    2/56

  • 7/30/2019 03_ABAP - The Data Dictionary

    3/56

    Contents

    Objectives

  • 7/30/2019 03_ABAP - The Data Dictionary

    4/56

  • 7/30/2019 03_ABAP - The Data Dictionary

    5/56

    Contents

    Exploring the Types of Tables

    in ECC

  • 7/30/2019 03_ABAP - The Data Dictionary

    6/56

    3 table types

    transparent

    tables

    pooled tables

    cluster tables

  • 7/30/2019 03_ABAP - The Data Dictionary

    7/56

    Transparent Tables

    transparent table vs. database table:

    one-to-one relationship

    same name

    same number of fields same field names

    used to hold application data:

    master data: vendor master data, customermaster data

    transaction data: purchasing order, sales order

  • 7/30/2019 03_ABAP - The Data Dictionary

    8/56

    Contents

    Exploring Table Components

  • 7/30/2019 03_ABAP - The Data Dictionary

    9/56

    Table Components

    Field: A table is composed of fields.

    Data element: contains the field labels and onlinedocumentation (also called F1 help) for the field -business context.

    Domain: A data element's definition requires a domain.The domain contains the technical characteristics of afield, such as the field length and data type.

    Domains and data elements are reusable. A domaincan be used in more than one data element, and a dataelement can be used in more than one field and inmore than one table.

  • 7/30/2019 03_ABAP - The Data Dictionary

    10/56

    Table Components

  • 7/30/2019 03_ABAP - The Data Dictionary

    11/56

    Example

  • 7/30/2019 03_ABAP - The Data Dictionary

    12/56

    Naming Conventions

    Object Type Max Name Length Allowed FirstCharacter

    Table 16 y, z

    Data element 30 y, z

    Domain 30 y, z

    Field 30 Any character

    Naming Conventions for Tables, Fields, Data Elements, and Domains created

    by the Customer

  • 7/30/2019 03_ABAP - The Data Dictionary

    13/56

    Contents

    Creating a Transparent Table

    and Its Components

  • 7/30/2019 03_ABAP - The Data Dictionary

    14/56

    Ex: Create Vendor table

    Field Name PK DE Name DM Name Data Type Length

    mandt x mandt

    lifnr x zlifnr zlifnr CHAR 10

    name1 zname1 zname1 CHAR 35

    regio zregio zregio CHAR 3

    land1 zland1 zland1 CHAR 3

    Fields and Their Characteristics for Table ZLFA1

  • 7/30/2019 03_ABAP - The Data Dictionary

    15/56

    Approaches for Creating Tables

    bottom-up: create domains data elements table Create domains: zlifnr, zname1

    Create data elements: zlifnr, zname1

    Create table: zlfa1

    Create fields: lifnr, name1 Tcode used: SE11

    top-down: create table data elements domains Change table: zlfa1

    Create field regio data element zregio domain zregio Create field land1 data element zland1 domain

    zland1

    Tcode used: SE11

  • 7/30/2019 03_ABAP - The Data Dictionary

    16/56

    Bottom-up: create domains

  • 7/30/2019 03_ABAP - The Data Dictionary

    17/56

    Bottom-up: create domains

    B tt t d t

  • 7/30/2019 03_ABAP - The Data Dictionary

    18/56

    Bottom-up: create data

    elements

    B tt t d t

  • 7/30/2019 03_ABAP - The Data Dictionary

    19/56

    Bottom-up: create data

    elements

  • 7/30/2019 03_ABAP - The Data Dictionary

    20/56

    B tt t d t

  • 7/30/2019 03_ABAP - The Data Dictionary

    21/56

    Bottom-up: create data

    elements

  • 7/30/2019 03_ABAP - The Data Dictionary

    22/56

    Bottom-up: create table

  • 7/30/2019 03_ABAP - The Data Dictionary

    23/56

    Bottom-up: create table

  • 7/30/2019 03_ABAP - The Data Dictionary

    24/56

    Top-down

  • 7/30/2019 03_ABAP - The Data Dictionary

    25/56

    Top-down

  • 7/30/2019 03_ABAP - The Data Dictionary

    26/56

    Top-down

  • 7/30/2019 03_ABAP - The Data Dictionary

    27/56

    Top-down

  • 7/30/2019 03_ABAP - The Data Dictionary

    28/56

    Top-down

  • 7/30/2019 03_ABAP - The Data Dictionary

    29/56

    Technical Settings

    The data class determines the tablespace in which a table iscreated.

    tablespaces is used to organize and maintain the database.

    makes database administration easier

    increases system performance

    The size category:

    the size of the initial extent

    next extents

    number of possible next extents

  • 7/30/2019 03_ABAP - The Data Dictionary

    30/56

    Technical Settings

    Buffering:

    increases system performance by caching data locally on the

    application server

    fewer database accesses

    used for tables that are seldom updated and often read.

    Automatic logging feature:

    causes a change document to be created each time the table is

    changed

    slows table updates

    only used for tables containing critical data

    non-critical tables, change document objects should be used.

  • 7/30/2019 03_ABAP - The Data Dictionary

    31/56

    Contents

    Special Table Fields

  • 7/30/2019 03_ABAP - The Data Dictionary

    32/56

    Special Table Fields

    currency fields:ex: 1000 U.S. dollars.

    currency field: data type in the domain must be CURR (number 1000) currency key field: type CUKY ( USD)

    quantity fields:numeric measurement (ex: 20 pieces)

    The data type in the domain must be QUAN. ( 20) It must be linked to a field of type UNIT. ( PCs)

  • 7/30/2019 03_ABAP - The Data Dictionary

    33/56

    Special Table Fields

  • 7/30/2019 03_ABAP - The Data Dictionary

    34/56

    Contents

    Modifying Tables

  • 7/30/2019 03_ABAP - The Data Dictionary

    35/56

    Modifying Tables

    copy

    delete

    add more fields

    delete fields

    change fields

  • 7/30/2019 03_ABAP - The Data Dictionary

    36/56

    Copying a Table

    Copy table ZLFA1 to ZLFA1_COPY

    Only copy the table structure

  • 7/30/2019 03_ABAP - The Data Dictionary

    37/56

  • 7/30/2019 03_ABAP - The Data Dictionary

    38/56

    Adding Fields

    Inserting:

    position a field before an existing field.

    Appending:

    add new fields at the end of the table, after all of

    the existing fields.

  • 7/30/2019 03_ABAP - The Data Dictionary

    39/56

    Inserting a Field

  • 7/30/2019 03_ABAP - The Data Dictionary

    40/56

    Appending a Field

  • 7/30/2019 03_ABAP - The Data Dictionary

    41/56

    Deleting Fields

  • 7/30/2019 03_ABAP - The Data Dictionary

    42/56

    Contents

    Working with Data

  • 7/30/2019 03_ABAP - The Data Dictionary

    43/56

    Data browsers

    search for and display rows that meet

    specified criteria

    add new rows

    modify existing rows

    delete rows

  • 7/30/2019 03_ABAP - The Data Dictionary

    44/56

    Using tcode SE11

    U i d SE16 D B

  • 7/30/2019 03_ABAP - The Data Dictionary

    45/56

    Using tcode SE16 - Data Browser

    C t t

  • 7/30/2019 03_ABAP - The Data Dictionary

    46/56

    Contents

    Structures in the Data

    Dictionary

    St t

  • 7/30/2019 03_ABAP - The Data Dictionary

    47/56

    Structures

    The differences between a structure and a table:

    A structure doesn't have an associated database table

    doesn't have a primary key.

    doesn't have technical attributes.

    Structures follow the same naming conventions as transparenttables, and you cannot have a table and structure of the samename.

    The procedure for creating a structure is almost the same as forcreating a transparent table.

    St t

  • 7/30/2019 03_ABAP - The Data Dictionary

    48/56

    Structures

    U d t di I l d

  • 7/30/2019 03_ABAP - The Data Dictionary

    49/56

    Understanding Includes

    A structure/table can contain another structure (nested)

    C t t

  • 7/30/2019 03_ABAP - The Data Dictionary

    50/56

    Contents

    Revised and Active Versions

    R i d d A ti V i

  • 7/30/2019 03_ABAP - The Data Dictionary

    51/56

    Revised and Active Versions

    Two versions of a DDIC object:

    Revised version

    when change save without activate Active version

    when activate Revised version becomes active and replaces the Activeversion

  • 7/30/2019 03_ABAP - The Data Dictionary

    52/56

    Compare Versions

  • 7/30/2019 03_ABAP - The Data Dictionary

    53/56

    Compare Versions

    Additional Versions

  • 7/30/2019 03_ABAP - The Data Dictionary

    54/56

    Additional Versions

    temporary versions:

    menu path Utilities->Versions->Generate version

    is kept until the table is transported into production

    to view: menu path Utilities->Versions->Version Management

    Retrieve Previous Version

  • 7/30/2019 03_ABAP - The Data Dictionary

    55/56

    Retrieve Previous Version

  • 7/30/2019 03_ABAP - The Data Dictionary

    56/56

    Summary The Data Dictionary is a tool used by ABAP/4 programs to create and

    maintain tables. There are three types of tables: transparent, pooled,and cluster. Transparent tables are the most common and are used tocontain application data.

    To create a table, you first need domains and data elements. Domainsprovide the technical characteristics of a field; data elements providethe field labels and F1 help. Both are reusable.

    Within a table, each currency field must be linked to a currency key

    field, and each quantity field must be linked to a field containing theunits of measurement.

    Data browsers enable you to display and modify the data within tables.SE16 is the most general data browser.

    Tables and structures are very similar. The main difference is that atable has an underlying database table and a structure doesn't.

    Dictionary objects must be active before they can be used. If you makea change to a dictionary object, you must reactivate the object beforethe changes take effect.