introduction to the abap data dictionary. slide 2 lecture overview describe the abap database layer...

49
Introduction to the ABAP Data Dictionary

Upload: gwen-bishop

Post on 17-Dec-2015

232 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Introduction to the ABAP Data Dictionary

Page 2: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 2

Lecture Overview Describe the ABAP database layer and

selected core tables

Page 3: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 3

A First few SAP Tables T000 is the client table T001 is the company code table

Currency and language are defined here Accounting chart of accounts

T006 is for measurement (unit of measure) There are tables for currency conversion

BKPF and BSEG are the FI header and transaction tables

Page 4: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 4

Getting Started with the ABAP Database Layer Remember that we work with data

logically through ABAP, rather than operating or the physical database We do not touch the underlying (native)

database The database layer supplies extensive

metadata beyond most native databases

Page 5: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 5

Data Dictionary Transaction Codes Transaction code SE16 gets us to the

Data Browser Transaction code SE11 gets us to the

ABAP Dictionary

Page 6: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 6

Data Browser (Introduction) The Data Browser allows us to display

data from a table By default the cryptic field name is

displayed in most screens Settings / User Parameters (Data

Browser tab) allows you to select the field label

Page 7: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 7

Data Browser (Select Table) Select the desired table

You need to know the table names and meaning of fields

Page 8: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 8

Data Browser (Table Output)

Page 9: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 9

Data Browser Search for table

Page 10: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 10

The ABAP Dictionary (Accessing) Transaction code SE11

Page 11: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 11

ABAP Dictionary Elements Tables Views

A view is created from one or more tables Data types

Data elements Structured types

Page 12: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 12

ABAP Dictionary Elements (Illustration)

Page 13: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 13

ABAP Dictionary Elements (Tables) A superset of what we usually think of

as a table There are different types of tables

Transparent tables are used to store business data

Pool tables and cluster tables generally store applications

ABAP programs are stored in the database itself in pool and cluster tables

We will not work with these

Page 14: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 14

ABAP Dictionary Elements (Tables - Transparent) Tables contain

Fields having a field name and a data type Foreign keys describe relationships

between other tables Technical settings describe how the table

is created in the database Indexes are used to improve performance

Page 15: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 15

ABAP Dictionary Elements (Views) In general database terms, it’s a virtual

table that is not physically stored SAP has different types of views based

on the underlying fundamental database operations The SAP views are semantic (more later)

Page 16: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 16

ABAP Dictionary Elements (Views – Types) Database – These are views from one

or many tables Projection views apply to only one

table and restrict the number of fields to display

Structure views are pretty much obsolete We will not talk about them here

Page 17: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 17

Creating a Table (Steps) Rules for table names Creating the table Creating the fields

Page 18: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 18

Creating a Table (Table Names) 16 case insensitive characters Customer (created) tables should begin

with the characters Z or Y You can use anything for a field name Create data element and domain names

beginning with Z or Y Other namespaces (SAP) are letter

sequences enclosed by slashes /SAPPRESS/

Page 19: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 19

Creating a Table (Maintenance)

Page 20: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 20

Creating a Table (Attributes) Change and language information Packages group objects (including tables)

They control transport behavior They organize objects Objects without a package cannot be

transported

Page 21: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 21

Creating a Table (Delivery and Maintenance) Descriptive information The delivery class drives the transport

of data records during install, upgrade, …

Page 22: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 22

Creating a Table (Delivery and Maintenance) The following controls dictionary rights

Page 23: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 23

Creating a Table(Package) The Package $TMP is a special local

package

Page 24: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 24

Domains / Data Elements / Fields Most of you are used to database fields

having some primary data type Integer, double , date, string, etc.

SAP utilizes layers of indirection called domains and data elements

A data element can be used in one or many table fields

Page 25: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 25

Domains / Data Elements / Fields (Illustration) Fields have a data element, which

belongs to a domain

Page 26: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 26

Domains A domain describes the technical

attributes of a field Data type Number of positions (size) Optional value range

Fields belonging to a domain are changed if the domain is changed

Page 27: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 27

Domains (Illustration) The Domain BUKRS is the company

code

Page 28: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 28

Data Elements A data element is an elementary type It defines

Field label values Help information

It may or may not belong to a domain If it does, then fields of the elementary

type will change if the domain changes

Page 29: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 29

Data Element (Illustration

Page 30: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 30

Company Code (Example) One of the core SAP concepts is the Company

Code The domain BUKRS defines the company code

as a CHAR (4)

Page 31: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 31

Company Code (Example) And the domain BUKRS is used in many

places Where used button

Page 32: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 32

Company Code (Example) The Data element BUKRS belongs to the

domain BUKRS

Page 33: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 33

Company Code (Example) And BUKRS is used in the following

tables

Page 34: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 34

Field Domains (Summary) Field domains are themselves stored in

a table So are table fields and data elements

Page 35: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 35

Field Domains (Creating) I prefer to create the domains and then

create the fields Your book suggests forward navigation DON’T FORGET TO ACTIVATE THEM

Page 36: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 36

Creating a Data Element (1) Select the domain to which the element

applies

Page 37: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 37

Creating a Data Element (2) This is where the field titles come from

for forms and other places

Page 38: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 38

Creating a Table (Fields) Table fields work a bit differently in SAP In SAP fields belong to a domain

It’s the domain that defines The data type The value range

Domains must be activated before they can be used

Page 39: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 39

Creating a Table (Fields)

Page 40: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 40

Creating a Table (Fields) Field name Key fields uniquely identify a row

Composite keys can have a maximum of 16 key fields

Give a field an initial value The Data Element field defines the

field’s data type You can use predefined data types or

create new ones

Page 41: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 41

Dictionary Technical Settings (1) With the desired table active, select

GoTo, Technical Settings These technical settings describe how

the system treats the table Data Class defines the ‘physical’ area

of the database where the table is stored Master data, transactional data,

organizational data

Page 42: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 42

Dictionary Technical Settings (2) Size category defines the number of

records expected Buffering whether a record or table is

buffered (prefetched into the work area) when accessed

Page 43: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 43

Dictionary Technical Settings (Illustration)

Page 44: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 44

Entering Data While the Display table screen is active,

click Utilities / Table contents / Create Entries

Page 45: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 45

Object Navigator It’s used to organize programing in the

SAP integrated development environment Repository Browser is the primary code

storage area The Repository Information System is used

to search for programming objects The Transport Organizer manages changes

made during configuration and development and propagates (transports) changes to test and production systems

Page 46: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 46

Object Navigator (Illustration)

Select object type from Object List

Page 47: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 47

Repository Browser (Object Lists) The application hierarchy contains all

development objects A package contains logically related

development objects In this class, we will create local

objects, which are not transported to QA / production systems

Page 48: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 48

Packages (Contents) Packages contain many things

Programs containing fields, events, subroutines, screens, and so on

Function groups are containers for functions (external procedure calls)

Dictionary objects contain (roughly speaking) references to SAP data

Remember, all data is processed through the SAP API

SHOW PACKAGE FARC

Page 49: Introduction to the ABAP Data Dictionary. Slide 2 Lecture Overview Describe the ABAP database layer and selected core tables

Slide 49

Classes / Interfaces SAP supports an OOP approach to

development using classes and interfaces