Post on 17-Dec-2015
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
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
Slide 5
Data Dictionary Transaction Codes Transaction code SE16 gets us to the
Data Browser Transaction code SE11 gets us to the
ABAP Dictionary
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
Slide 7
Data Browser (Select Table) Select the desired table
You need to know the table names and meaning of fields
Slide 8
Data Browser (Table Output)
Slide 9
Data Browser Search for table
Slide 10
The ABAP Dictionary (Accessing) Transaction code SE11
Slide 11
ABAP Dictionary Elements Tables Views
A view is created from one or more tables Data types
Data elements Structured types
Slide 12
ABAP Dictionary Elements (Illustration)
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
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
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)
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
Slide 17
Creating a Table (Steps) Rules for table names Creating the table Creating the fields
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/
Slide 19
Creating a Table (Maintenance)
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
Slide 21
Creating a Table (Delivery and Maintenance) Descriptive information The delivery class drives the transport
of data records during install, upgrade, …
Slide 22
Creating a Table (Delivery and Maintenance) The following controls dictionary rights
Slide 23
Creating a Table(Package) The Package $TMP is a special local
package
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
Slide 25
Domains / Data Elements / Fields (Illustration) Fields have a data element, which
belongs to a domain
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
Slide 27
Domains (Illustration) The Domain BUKRS is the company
code
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
Slide 29
Data Element (Illustration
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)
Slide 31
Company Code (Example) And the domain BUKRS is used in many
places Where used button
Slide 32
Company Code (Example) The Data element BUKRS belongs to the
domain BUKRS
Slide 33
Company Code (Example) And BUKRS is used in the following
tables
Slide 34
Field Domains (Summary) Field domains are themselves stored in
a table So are table fields and data elements
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
Slide 36
Creating a Data Element (1) Select the domain to which the element
applies
Slide 37
Creating a Data Element (2) This is where the field titles come from
for forms and other places
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
Slide 39
Creating a Table (Fields)
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
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
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
Slide 43
Dictionary Technical Settings (Illustration)
Slide 44
Entering Data While the Display table screen is active,
click Utilities / Table contents / Create Entries
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
Slide 46
Object Navigator (Illustration)
Select object type from Object List
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
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
Slide 49
Classes / Interfaces SAP supports an OOP approach to
development using classes and interfaces