background image

BC030_2.08.1

ABAP Dictionary Objects:  

Views

background image

BC030_2.08.2

Objectives

• The participants will be able to: 

– Define a View

– Explain the different Relational 

Operations

– Discuss the different types of Views
– Discuss how to use Views in an ABAP 

program

background image

BC030_2.08.3

What is a View?

background image

BC030_2.08.4

The Most Basic Form of a View

background image

BC030_2.08.5

Table 2

Selection

View B

View B

Table 1

Projection

View 

View 

A

A

View C

View C

Join

Table 4

Table 4

Table 3

Table 3

The Relational Operations

background image

BC030_2.08.6

Projection

View A

View A

Table 1

The Projection Operation

background image

BC030_2.08.7

Specifying Projected Fields

background image

BC030_2.08.8

Selection

View B

View B

Table 2

Example:

Staff Level <= 3

The Selection Operation

background image

BC030_2.08.9

Specifying Selection Criteria

1

2

3

4

5

Can include unprojected 
fields

background image

BC030_2.08.10

Table 

Table 

3

3

Join

Table 

Table 

4

4

View C

View C

The Join Operation

background image

BC030_2.08.11

Salary

Salary

ID

 Name

 Salary

5579

 Smith

 $10,000.00

 5579 

 Smith

 $11,000.00

 5579 

 Smith

 $12,000.00

 5579 

 Smith

 $13,000.00

ID

 Name  Salary 1 Salary 2 Salary 3

Employee

Employee

Wrong

The Necessity of the Join 

Operation

background image

BC030_2.08.12

ID

 Salary

Date Effective

5579

 $10,000.00

10/1/91

 5579 

$11,000.00

10/1/92

 5579 

$12,000.00

10/1/94

 5579 

$13,000.00

10/1/96

ID

 Name

 …

Employee

Employee

Salary

Salary

Right

Understanding the Join 

Operation

background image

BC030_2.08.13

View C

View C

Join

Table 4

Table 4

Table 3

Table 3

Primary

Secondary

The Join Operation

and Foreign Keys

background image

BC030_2.08.14

Specifying Joined Fields

Hit the RELATIONSHIPS pushbutton 
to automatically generate Join 
conditions

Join 
Conditions

Indicates the Base Tables 
from which the data will 
come

background image

BC030_2.08.15

Types of Views in

the ABAP Dictionary

• Database View
• Projection View 

• Help View
• Maintenance View

background image

BC030_2.08.16

Database

DB

Database View

The Database View

background image

BC030_2.08.17

View C

Projection View

The Projection View

background image

BC030_2.08.18

Database View

Projection View

Database Vs. Projection Views

background image

BC030_2.08.19

Other Types of Views

• Help View
• Maintenance View

background image

BC030_2.08.20

TABLES: KNA1VV.

SELECT *
FROM

KNA1VV.

WRITE: /    KNA1VV-KUNNR,

KNA1VV-VKORG,
KNA1VV-VTWEG,
KNA1VV-SPART.

ENDSELECT.

Using a View in Program Code

background image

BC030_2.08.21

Summary

• The participants should be able to: 

– Define a View

– Explain the different Relational Operations
– Discuss the different types of Views

– Discuss how to use Views in an ABAP 

program


Document Outline