0% found this document useful (0 votes)
158 views

Unit 3 - Transparent Tables in The ABAP Dictionary

This presentation contains the following topics: 1. Data Modeling and ABAP Dictionary 2. How to create transparent tables 3. Table Maintenance Generator 4. Viewing data in transparent tables 5. ABAP Exercise: Airline Relational Model

Uploaded by

Carlos
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
158 views

Unit 3 - Transparent Tables in The ABAP Dictionary

This presentation contains the following topics: 1. Data Modeling and ABAP Dictionary 2. How to create transparent tables 3. Table Maintenance Generator 4. Viewing data in transparent tables 5. ABAP Exercise: Airline Relational Model

Uploaded by

Carlos
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Unit 3: Introduction to the

ABAP Dictionary

Lesson: Data Modeling and Descriptive Elements in the


ABAP Dictionary
Lesson Overview

In this lesson you will get an overview of data modeling,


which has to be done before the application development.
Furthermore, you will learn about the basic descriptive
elements in the ABAP Dictionary.
You will also find out when and why it is appropriate to
use data types (data descriptions) from the ABAP
Dictionary.

Business Example
When you define data objects in your ABAP program, you
should use the advantages of the ABAP Dictionary.

Data Modeling

In the development of business application software, parts


of the real world must be represented in data form.
We refer to an Entity Relationship Model (ERM).
You use this data model as the basis for implementing
appropriate table definitions (transparent tables) including
their relationships with each other in the ABAP Dictionary.

Airline

Flight
Schedule

Flight

Flight
Booking

Airport

City

CityAirport
Assignme
nt
Flight
Customer

Sales
Office

Travel
Agency

Relatio
nal
Data
Model
(Flight
Data
Model)

Working with the Object Navigator


The flight data model contains entities for all business
information that is logically connected, such as:
Cities
Airports
Airlines
Flight routes
Flights
...

These entities all relate to each other in certain ways:


Each flight schedule contains exactly one airline, one
departure airport, and one destination airport.
Each bookable flight always belongs to exactly one
existing flight schedule.
Assignments can be set between cities and nearby
airports.

SCARR
MANDT

CARRID

CARRNAME

CURRCODE

URL

Implementation Using
Transparent Tables

SPFLI
MANDT

CARRID

CONNID

AIRPFROM

AIRPTO

DEPTIM
E

SEATSM
AX

SEATSOCC

BOOKID

CUSTOMID

COUNTER

SPFLI
MANDT

CARRID

CONNID

FLDATE

SPFLI
MANDT

CARRID

CONNID

FLDATE

For each entity fixed in the data model, the developer


creates a transparent table in the ABAP Dictionary.
This is merely a platform-independent description of
a database table, not the database table itself.
A transparent table contains different fields (columns) to
allow you to store and manage data records in a
structured way.

You have to declare table fields as key fields when their


content is to be used for the clear identification of data
records.
The key value of a data record is a unique ID within the
table.

Descriptive Elements in the ABAP Dictionary


Before we deal with the transparent table, we must first
explain two other Dictionary terms: data element and
domain.

A data element is a total description of a field. This


includes the semantic as well as the technical field
attributes.
The technical field attributes such as data type and field
length are usually not specified in the actual data element
but by means of a reference to a domain.
Data elements can be used for defining program-internal
variables or for describing fields of transparent tables.

Data Elements S_CARR_ID


Short Descriptions
Short text for Airline

Data Element
and Domain.

Documentation

File ID
Airline / Airline /
Data Type
Reference domain
S_CARR_ID
Search Help

DOMAIN
Format
CHAR 3
Value Range

In the ABAP Dictionary, a transparent table is an


implemented description of the corresponding database
table that contains the actual application data.

Technical Structure of a Transparent


Table
Transparent Table
Field
Described by
Data
Element
Points to
Domain

Transparent Tables in the


ABAP Dictionary
.

The fields of the transparent table form the identicallynamed columns of the corresponding database table.

Usually, a structure in the ABAP Dictionary is used to centrally


describe structure variables that are to contain the fields of
various tables.
You can then use these dictionary structures in the ABAP
program to define data objects (concrete structure
variables) that either serve as temporary data storage in the
program or as an interface for the field transport between the
screen and ABAP program.
With structures however, we refer to component and
component type as opposed to field and data element, it is
posible to have a structure as the component of another
structure.

Structures in the ABAP


Dictionary

Such structures with included substructures as components


are called complex structures. In contrast, structures with
simple components are called flat.

Data
Element
Structu
re Field
Table
Field
Structur
e
Transparent
Table

Using Dictionary Elements to


Define Data Objects Within the
Program

The definitions in the above graphic have the


following meaning:
DATA mycarrid TYPE s_carr_id.
Returns a data object (variable) of the type specified in the
data element s_carr_id.
DATA myconnid TYPE sbc400focc-connid.
Returns a data object (variable) that has the same type as the
structure field sbc400focc-connid.
PARAMETERS pa_carr TYPE spfli-carrid.
Returns an input field on the selection screen as well as a
variable that has the same type as the table field spfli-carrid.

DATA wa_focc TYPE sbc400focc.


Returns a structure variable that has the same type as the
dictionary structure sbc400focc.
DATA wa_spfli TYPE spfli.
Returns a structure variable which has the same type as a
line of the table spfli.

Domain
Domain describes the technical attributes such as
data type and length of a table field.

Data Element gives the field labels and


documentation for the table field.

Procedure: Creating Tables


Create your first table
Enter data into your table
View the data in your table

You should now be able to:


Explain the purpose and the benefits of using a data model in
application development
Describe the structure of data elements and domains
Describe the structure of a transparent table
Describe the structure of a structure
Use the mentioned Dictionary elements in your ABAP
programs

Unit 3: Case Study Airline Relational Data Model


Your assignment is to:
Create a relational data model for an airline company that
needs to store data from the passengers such as Name,
ID, Address and Flight ; data from the flights such as ID,
Origin and Destination; and data from the airline company
such as ID, Airline Name and Flight numbers assigned to
it.
Create transparent tables in the ABAP Dictionary to
represent your relational model.

Flight Information Relational Data


ZTFlight Flight
Model
3
Transparent Tables
Information
Flight_ID
ZTAirline Airline
Air_ID

Nam Flight_ID
e

Origin
ZTPassengers
Passengers

Destinatio
n

Pass_ID

ONE Airline can have MANY Flights (1-N)


ONE Passenger can have MANY Flights
ONE Flight can have MANY Passengers

Pass_ID

Name

Addre
ss

Flight_ID

Flight Information Relational Data


Model

You might also like