SlideShare a Scribd company logo
IBM Global Services
© 2005 IBM CorporationABAP Dictionary Objects: Views |
2.08
March-2005
ABAP Dictionary Objects: Views
IBM Global Services
© 2005 IBM Corporation2 March-2005ABAP Dictionary Objects: Views | 2.08
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.
IBM Global Services
© 2005 IBM Corporation3 March-2005ABAP Dictionary Objects: Views | 2.08
What is a View?
 Views are used to look into one or more tables.
 A view does not contain data of its own.
IBM Global Services
© 2005 IBM Corporation4 March-2005ABAP Dictionary Objects: Views | 2.08
The Most Basic Form of a View
 In its most basic form, a view simply mirrors an entire database table
IBM Global Services
© 2005 IBM Corporation5 March-2005ABAP Dictionary Objects: Views | 2.08
The Relational Operations
Table 2
Selection
View BView B
Table 1
Projection
View AView A View CView C
Join
Table 4Table 4Table 3Table 3
 We can use views to Join several tables, Project (or choose) certain fields
from one or more tables & Select (or choose) certain records from one or
more tables.
IBM Global Services
© 2005 IBM Corporation6 March-2005ABAP Dictionary Objects: Views | 2.08
The Projection Operation
Projection
View AView A
Table 1
 The projection operation is used to narrow a view’s focus to certain fields in a
table.
IBM Global Services
© 2005 IBM Corporation7 March-2005ABAP Dictionary Objects: Views | 2.08
Specifying Projected Fields
Can use any field name if database view,
otherwise must be same name as table field.
IBM Global Services
© 2005 IBM Corporation8 March-2005ABAP Dictionary Objects: Views | 2.08
The Selection Operation
Selection
View BView B
Table 2
Example:
Staff Level <= 3
 The selection operation is used to narrow a view’s focus to certain records in a
table.
IBM Global Services
© 2005 IBM Corporation9 March-2005ABAP Dictionary Objects: Views | 2.08
Specifying Selection Criteria
1 2 3 4 5
Can include unprojected fields
IBM Global Services
© 2005 IBM Corporation10 March-2005ABAP Dictionary Objects: Views | 2.08
The Join Operation
Table 3Table 3
Join
Table 4Table 4
View CView C
 The join operation is used to combine information from multiple tables into a
single view.
IBM Global Services
© 2005 IBM Corporation11 March-2005ABAP Dictionary Objects: Views | 2.08
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
Wrong
 Database design principles often require related data to be stored in separate
tables. This is called normalising.
The Necessity of the Join Operation
IBM Global Services
© 2005 IBM Corporation12 March-2005ABAP Dictionary Objects: Views | 2.08
ID Name …
EmployeeEmployee
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
Understanding the Join Operation
SalarySalary
Right
 The join operation essentially reverses the normalising process.
 The result of a join is a view that looks like a table with redundant data.
IBM Global Services
© 2005 IBM Corporation13 March-2005ABAP Dictionary Objects: Views | 2.08
The Join Operation and Foreign Keys
View CView C
Join
Table 4Table 4Table 3Table 3
Primary Secondary
 Therefore, in order to use the join operation in SAP, you must first ensure that
the appropriate foreign key relationships exist among the tables to be joined.
IBM Global Services
© 2005 IBM Corporation14 March-2005ABAP Dictionary Objects: Views | 2.08
Specifying Joined Fields
Indicate base tables that data will come from.Indicate base tables that data will come from.
Hit button to see related tables and
automatically generate join conditions.
Join Conditions
IBM Global Services
© 2005 IBM Corporation15 March-2005ABAP Dictionary Objects: Views | 2.08
Types of Views in the ABAP Dictionary
 Database View
 Projection View
 Help View
 Maintenance View
IBM Global Services
© 2005 IBM Corporation16 March-2005ABAP Dictionary Objects: Views | 2.08
Database
The Database View
DB
Database View
 The database view is the only type of view in SAP that is physically created at
the database level.
IBM Global Services
© 2005 IBM Corporation17 March-2005ABAP Dictionary Objects: Views | 2.08
Demonstration
 Creation of a database view using two related database tables.
IBM Global Services
© 2005 IBM Corporation18 March-2005ABAP Dictionary Objects: Views | 2.08
Practice
 Creation of a database view using two related database tables.
IBM Global Services
© 2005 IBM Corporation19 March-2005ABAP Dictionary Objects: Views | 2.08
The Projection View
View C
Projection View
 The projection view is a logical view. In this context, the word “logical” means
that the view exists within the ABAP Dictionary but is not recognized by the
underlying database system.
IBM Global Services
© 2005 IBM Corporation20 March-2005ABAP Dictionary Objects: Views | 2.08
Database vs. Projection Views
Database ViewProjection View
• Must be built over a single table
• Data can be updated
• Data updates must use open SQL
• Updates are less efficient
• Fields in the view must be named the same
as the fields in the underlying table
• Can’t be buffered
• Can be built over many tables
• Data can be updated if the view is built
over a single table
• Data updates can use open or native SQL
• Updates are more efficient
• Fields in the view can be named differently
from the fields in the underlying table
• Can be buffered
IBM Global Services
© 2005 IBM Corporation21 March-2005ABAP Dictionary Objects: Views | 2.08
Other Types of Views
 Help View:
Help views can be used as selection methods for Search Helps.It might be
necessary to create a Help View if you are trying to accomplish an outer join.
 Maintenance View:
These views permit maintenance of base table data. Transactions SM30 and
SE54 are provided for working with maintenance views.
IBM Global Services
© 2005 IBM Corporation22 March-2005ABAP Dictionary Objects: Views | 2.08
Using a View in Program Code
TABLES: YXXEMP_V.
SELECT*
FROM YXXEMP_V.
WRITE: / YXXEMP_V-EMP_ID
YXXEMP_V-LAST_NAME,
YXXEMP_V-FIRST_NAME.
ENDSELECT.
IBM Global Services
© 2005 IBM Corporation23 March-2005ABAP Dictionary Objects: Views | 2.08
Demonstration
 Select data from the database view created earlier and display selected data in a
report.
IBM Global Services
© 2005 IBM Corporation24 March-2005ABAP Dictionary Objects: Views | 2.08
Practice
 Select data from the database view created earlier and display selected data in a
report.
IBM Global Services
© 2005 IBM Corporation25 March-2005ABAP Dictionary Objects: Views | 2.08
Summary
 Views are used to look into one or more tables. A view does not contain data of
its own.
 The projection operation is used to narrow a view’s focus to certain fields
in a table.
 The Selection Operation is used to narrow a view’s focus to certain records
in a table.
 The Join Operation is used to combine information from multiple tables into a
single view.
 Types of Views in the ABAP Dictionary are Database View, Projection View, Help
View & Maintenance View.
 The syntax to reference a view in an ABAP program is the same syntax we use to
reference a table.
IBM Global Services
© 2005 IBM Corporation26 March-2005ABAP Dictionary Objects: Views | 2.08
Questions
 What is a View ?
 What is a Database view ?
 What is a Projection view ?
 What is a Maintenance view ?
 What is a Help view ?

More Related Content

What's hot

Oracle BI Publsiher Using Data Template
Oracle BI Publsiher Using Data TemplateOracle BI Publsiher Using Data Template
Oracle BI Publsiher Using Data Template
Edi Yanto
 
VIEWS
VIEWSVIEWS
Bi publisher for jde
Bi publisher for jdeBi publisher for jde
Bi publisher for jde
nihitha19
 
Chapter 09 overview of search helps1
Chapter 09 overview of search helps1Chapter 09 overview of search helps1
Chapter 09 overview of search helps1
Kranthi Kumar
 
XLS PE How To Tutorials Tips & Tricks
XLS PE How To Tutorials Tips & TricksXLS PE How To Tutorials Tips & Tricks
XLS PE How To Tutorials Tips & Tricks
guest92a5de
 
Building BI Publisher Reports using Templates
Building BI Publisher Reports using TemplatesBuilding BI Publisher Reports using Templates
Building BI Publisher Reports using Templates
p6academy
 
Best Implementation Practices with BI Publisher
Best Implementation Practices with BI PublisherBest Implementation Practices with BI Publisher
Best Implementation Practices with BI Publisher
Mohan Dutt
 
What is bip_v2
What is bip_v2What is bip_v2
What is bip_v2
kanaugust
 
14 Easy Steps to End-User Empowerment: Convert Custom Reports to BI Publisher
14 Easy Steps to End-User Empowerment: Convert Custom Reports to BI Publisher14 Easy Steps to End-User Empowerment: Convert Custom Reports to BI Publisher
14 Easy Steps to End-User Empowerment: Convert Custom Reports to BI Publisher
Mohan Dutt
 
The many-faces-of-bi-publisher-in-oracle-ebs paper-1
The many-faces-of-bi-publisher-in-oracle-ebs paper-1The many-faces-of-bi-publisher-in-oracle-ebs paper-1
The many-faces-of-bi-publisher-in-oracle-ebs paper-1
Santosh Raj
 
Improving Business Agility through IBM Business Insight Advanced
Improving Business Agility through IBM Business Insight AdvancedImproving Business Agility through IBM Business Insight Advanced
Improving Business Agility through IBM Business Insight Advanced
DataClarity Corporation
 
Ten Steps To Empowerment
Ten Steps To EmpowermentTen Steps To Empowerment
Ten Steps To Empowerment
Mohan Dutt
 
L22 analyzing data using smart view
L22 analyzing data using smart viewL22 analyzing data using smart view
L22 analyzing data using smart view
Naresh Kumar SAHU
 
Bi Publisher 11g: Only good news
Bi Publisher 11g: Only good newsBi Publisher 11g: Only good news
Bi Publisher 11g: Only good news
Edelweiss Kammermann
 
Now you can password protect excel outputs too in bi publisher
Now you can password protect excel outputs too in bi publisherNow you can password protect excel outputs too in bi publisher
Now you can password protect excel outputs too in bi publisher
Feras Ahmad
 
Kanban view in odoo14
Kanban view in odoo14Kanban view in odoo14
Kanban view in odoo14
GeorgeHazlewood1
 
Gl wand-5.5-brochure-2014
Gl wand-5.5-brochure-2014Gl wand-5.5-brochure-2014
Gl wand-5.5-brochure-2014
Jarod Ouye
 
Empowering Business Users: OBIEE 12c Visual Analyzer and Data Mashup
Empowering Business Users: OBIEE 12c Visual Analyzer and Data MashupEmpowering Business Users: OBIEE 12c Visual Analyzer and Data Mashup
Empowering Business Users: OBIEE 12c Visual Analyzer and Data Mashup
Edelweiss Kammermann
 
HANA Modelling process flow
HANA Modelling process flowHANA Modelling process flow
HANA Modelling process flow
jk571983
 
Abap faq
Abap faqAbap faq
Abap faq
Kranthi Kumar
 

What's hot (20)

Oracle BI Publsiher Using Data Template
Oracle BI Publsiher Using Data TemplateOracle BI Publsiher Using Data Template
Oracle BI Publsiher Using Data Template
 
VIEWS
VIEWSVIEWS
VIEWS
 
Bi publisher for jde
Bi publisher for jdeBi publisher for jde
Bi publisher for jde
 
Chapter 09 overview of search helps1
Chapter 09 overview of search helps1Chapter 09 overview of search helps1
Chapter 09 overview of search helps1
 
XLS PE How To Tutorials Tips & Tricks
XLS PE How To Tutorials Tips & TricksXLS PE How To Tutorials Tips & Tricks
XLS PE How To Tutorials Tips & Tricks
 
Building BI Publisher Reports using Templates
Building BI Publisher Reports using TemplatesBuilding BI Publisher Reports using Templates
Building BI Publisher Reports using Templates
 
Best Implementation Practices with BI Publisher
Best Implementation Practices with BI PublisherBest Implementation Practices with BI Publisher
Best Implementation Practices with BI Publisher
 
What is bip_v2
What is bip_v2What is bip_v2
What is bip_v2
 
14 Easy Steps to End-User Empowerment: Convert Custom Reports to BI Publisher
14 Easy Steps to End-User Empowerment: Convert Custom Reports to BI Publisher14 Easy Steps to End-User Empowerment: Convert Custom Reports to BI Publisher
14 Easy Steps to End-User Empowerment: Convert Custom Reports to BI Publisher
 
The many-faces-of-bi-publisher-in-oracle-ebs paper-1
The many-faces-of-bi-publisher-in-oracle-ebs paper-1The many-faces-of-bi-publisher-in-oracle-ebs paper-1
The many-faces-of-bi-publisher-in-oracle-ebs paper-1
 
Improving Business Agility through IBM Business Insight Advanced
Improving Business Agility through IBM Business Insight AdvancedImproving Business Agility through IBM Business Insight Advanced
Improving Business Agility through IBM Business Insight Advanced
 
Ten Steps To Empowerment
Ten Steps To EmpowermentTen Steps To Empowerment
Ten Steps To Empowerment
 
L22 analyzing data using smart view
L22 analyzing data using smart viewL22 analyzing data using smart view
L22 analyzing data using smart view
 
Bi Publisher 11g: Only good news
Bi Publisher 11g: Only good newsBi Publisher 11g: Only good news
Bi Publisher 11g: Only good news
 
Now you can password protect excel outputs too in bi publisher
Now you can password protect excel outputs too in bi publisherNow you can password protect excel outputs too in bi publisher
Now you can password protect excel outputs too in bi publisher
 
Kanban view in odoo14
Kanban view in odoo14Kanban view in odoo14
Kanban view in odoo14
 
Gl wand-5.5-brochure-2014
Gl wand-5.5-brochure-2014Gl wand-5.5-brochure-2014
Gl wand-5.5-brochure-2014
 
Empowering Business Users: OBIEE 12c Visual Analyzer and Data Mashup
Empowering Business Users: OBIEE 12c Visual Analyzer and Data MashupEmpowering Business Users: OBIEE 12c Visual Analyzer and Data Mashup
Empowering Business Users: OBIEE 12c Visual Analyzer and Data Mashup
 
HANA Modelling process flow
HANA Modelling process flowHANA Modelling process flow
HANA Modelling process flow
 
Abap faq
Abap faqAbap faq
Abap faq
 

Viewers also liked

Sap abap-data structures and internal tables
Sap abap-data structures and internal tablesSap abap-data structures and internal tables
Sap abap-data structures and internal tables
Mustafa Nadim
 
Creating simple comp
Creating simple compCreating simple comp
Creating simple comp
Kranthi Kumar
 
Creating messages
Creating messagesCreating messages
Creating messages
Kranthi Kumar
 
Dynamic binding
Dynamic bindingDynamic binding
Dynamic binding
Kranthi Kumar
 
Dot Net 串接 SAP
Dot Net 串接 SAPDot Net 串接 SAP
Dot Net 串接 SAP
LearningTech
 
022006 zaidi badi
022006   zaidi badi022006   zaidi badi
022006 zaidi badi
sandeep_ganganaboina
 
Dr John Dee - Communications With Spirits - Free Ebook
Dr John Dee -  Communications With Spirits - Free EbookDr John Dee -  Communications With Spirits - Free Ebook
Dr John Dee - Communications With Spirits - Free Ebook
Chuck Thompson
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
Kranthi Kumar
 
Enhancement framework the new way to enhance your abap systems
Enhancement framework   the new way to enhance your abap systemsEnhancement framework   the new way to enhance your abap systems
Enhancement framework the new way to enhance your abap systems
Kranthi Kumar
 
Exercise in alv
Exercise in alvExercise in alv
Exercise in alv
Kranthi Kumar
 
Creation of a web service in sap
Creation of a web service in sapCreation of a web service in sap
Creation of a web service in sap
rajdongre
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programming
Satheesh Kanna
 
SAP ABAP web services creation.
SAP ABAP web services creation. SAP ABAP web services creation.
SAP ABAP web services creation.
Anjali Rao
 
Yash technologies interview questions and answers
Yash technologies interview questions and answersYash technologies interview questions and answers
Yash technologies interview questions and answers
GarySpeed1234
 
Introducing enhancement framework.doc
Introducing enhancement framework.docIntroducing enhancement framework.doc
Introducing enhancement framework.doc
Kranthi Kumar
 
Scenario on business transaction events
Scenario on business transaction eventsScenario on business transaction events
Scenario on business transaction events
Kranthi Kumar
 
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantSAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional Consultant
Ankit Sharma
 
SAP FICO BBP Sample Document PDF NEW!
SAP FICO BBP Sample Document PDF NEW!SAP FICO BBP Sample Document PDF NEW!
SAP FICO BBP Sample Document PDF NEW!
sapdocs. info
 
Badi document
Badi documentBadi document
Badi document
hamisha_malik
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
Uttam Agrawal
 

Viewers also liked (20)

Sap abap-data structures and internal tables
Sap abap-data structures and internal tablesSap abap-data structures and internal tables
Sap abap-data structures and internal tables
 
Creating simple comp
Creating simple compCreating simple comp
Creating simple comp
 
Creating messages
Creating messagesCreating messages
Creating messages
 
Dynamic binding
Dynamic bindingDynamic binding
Dynamic binding
 
Dot Net 串接 SAP
Dot Net 串接 SAPDot Net 串接 SAP
Dot Net 串接 SAP
 
022006 zaidi badi
022006   zaidi badi022006   zaidi badi
022006 zaidi badi
 
Dr John Dee - Communications With Spirits - Free Ebook
Dr John Dee -  Communications With Spirits - Free EbookDr John Dee -  Communications With Spirits - Free Ebook
Dr John Dee - Communications With Spirits - Free Ebook
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
 
Enhancement framework the new way to enhance your abap systems
Enhancement framework   the new way to enhance your abap systemsEnhancement framework   the new way to enhance your abap systems
Enhancement framework the new way to enhance your abap systems
 
Exercise in alv
Exercise in alvExercise in alv
Exercise in alv
 
Creation of a web service in sap
Creation of a web service in sapCreation of a web service in sap
Creation of a web service in sap
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programming
 
SAP ABAP web services creation.
SAP ABAP web services creation. SAP ABAP web services creation.
SAP ABAP web services creation.
 
Yash technologies interview questions and answers
Yash technologies interview questions and answersYash technologies interview questions and answers
Yash technologies interview questions and answers
 
Introducing enhancement framework.doc
Introducing enhancement framework.docIntroducing enhancement framework.doc
Introducing enhancement framework.doc
 
Scenario on business transaction events
Scenario on business transaction eventsScenario on business transaction events
Scenario on business transaction events
 
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantSAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional Consultant
 
SAP FICO BBP Sample Document PDF NEW!
SAP FICO BBP Sample Document PDF NEW!SAP FICO BBP Sample Document PDF NEW!
SAP FICO BBP Sample Document PDF NEW!
 
Badi document
Badi documentBadi document
Badi document
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 

Similar to Chapter 08 abap dictionary objects views1

Bilir's Business Intelligence Portfolio SSAS Project
Bilir's Business Intelligence Portfolio SSAS ProjectBilir's Business Intelligence Portfolio SSAS Project
Bilir's Business Intelligence Portfolio SSAS Project
Figen Bilir
 
Chapter 01 overview of abap dictionary1
Chapter 01 overview of abap dictionary1Chapter 01 overview of abap dictionary1
Chapter 01 overview of abap dictionary1
Kranthi Kumar
 
Alv view.pptx
Alv view.pptxAlv view.pptx
Alv view.pptx
AnimeshBehera5
 
Dbms fast track 2/3
Dbms fast track 2/3Dbms fast track 2/3
Dbms fast track 2/3
Dr. C.V. Suresh Babu
 
Queries
QueriesQueries
Queries
wmassie
 
obiee-training-obiee-11g-bi-publisher.pdf
obiee-training-obiee-11g-bi-publisher.pdfobiee-training-obiee-11g-bi-publisher.pdf
obiee-training-obiee-11g-bi-publisher.pdf
AhmedChakroun13
 
bi-publisher.pptx
bi-publisher.pptxbi-publisher.pptx
bi-publisher.pptx
kjkombrink
 
Best Practices for Users - Connecting Tableau to OBIEE with BI Connector
Best Practices for Users - Connecting Tableau to OBIEE with BI ConnectorBest Practices for Users - Connecting Tableau to OBIEE with BI Connector
Best Practices for Users - Connecting Tableau to OBIEE with BI Connector
BI Connector
 
4) databases
4) databases4) databases
4) databases
techbed
 
AAO BI Portfolio
AAO BI PortfolioAAO BI Portfolio
AAO BI Portfolio
Al Ottley
 
DSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BI
DSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BI
DSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BI
EzekielJames8
 
Siebel Open UI Presentation
Siebel Open UI PresentationSiebel Open UI Presentation
Siebel Open UI Presentation
Ajeeth Pingle
 
Part 2Provider Database (Open Office Database)Use the project.docx
Part 2Provider Database (Open Office Database)Use the project.docxPart 2Provider Database (Open Office Database)Use the project.docx
Part 2Provider Database (Open Office Database)Use the project.docx
dewhirstichabod
 
Chapter 02 abap dictionary objects1
Chapter 02 abap dictionary objects1Chapter 02 abap dictionary objects1
Chapter 02 abap dictionary objects1
Kranthi Kumar
 
knowledgeforumpowerbitrainingnew-230816140827-5eb14be7.pdf
knowledgeforumpowerbitrainingnew-230816140827-5eb14be7.pdfknowledgeforumpowerbitrainingnew-230816140827-5eb14be7.pdf
knowledgeforumpowerbitrainingnew-230816140827-5eb14be7.pdf
Rame28
 
PowerBI Training
PowerBI Training PowerBI Training
PowerBI Training
Knowledge And Skill Forum
 
Sql server indexed views speed up your select queries part 1 - code-projec
Sql server indexed views   speed up your select queries  part 1 - code-projecSql server indexed views   speed up your select queries  part 1 - code-projec
Sql server indexed views speed up your select queries part 1 - code-projec
Kaing Menglieng
 
Alv for web
Alv for webAlv for web
Alv for web
Kranthi Kumar
 
Part 2Provider Database (Open Office Database)Use the project des.docx
Part 2Provider Database (Open Office Database)Use the project des.docxPart 2Provider Database (Open Office Database)Use the project des.docx
Part 2Provider Database (Open Office Database)Use the project des.docx
danhaley45372
 
Power bi
Power biPower bi
Power bi
Tarun Bamba
 

Similar to Chapter 08 abap dictionary objects views1 (20)

Bilir's Business Intelligence Portfolio SSAS Project
Bilir's Business Intelligence Portfolio SSAS ProjectBilir's Business Intelligence Portfolio SSAS Project
Bilir's Business Intelligence Portfolio SSAS Project
 
Chapter 01 overview of abap dictionary1
Chapter 01 overview of abap dictionary1Chapter 01 overview of abap dictionary1
Chapter 01 overview of abap dictionary1
 
Alv view.pptx
Alv view.pptxAlv view.pptx
Alv view.pptx
 
Dbms fast track 2/3
Dbms fast track 2/3Dbms fast track 2/3
Dbms fast track 2/3
 
Queries
QueriesQueries
Queries
 
obiee-training-obiee-11g-bi-publisher.pdf
obiee-training-obiee-11g-bi-publisher.pdfobiee-training-obiee-11g-bi-publisher.pdf
obiee-training-obiee-11g-bi-publisher.pdf
 
bi-publisher.pptx
bi-publisher.pptxbi-publisher.pptx
bi-publisher.pptx
 
Best Practices for Users - Connecting Tableau to OBIEE with BI Connector
Best Practices for Users - Connecting Tableau to OBIEE with BI ConnectorBest Practices for Users - Connecting Tableau to OBIEE with BI Connector
Best Practices for Users - Connecting Tableau to OBIEE with BI Connector
 
4) databases
4) databases4) databases
4) databases
 
AAO BI Portfolio
AAO BI PortfolioAAO BI Portfolio
AAO BI Portfolio
 
DSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BI
DSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BI
DSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BIDSN_Power BI
 
Siebel Open UI Presentation
Siebel Open UI PresentationSiebel Open UI Presentation
Siebel Open UI Presentation
 
Part 2Provider Database (Open Office Database)Use the project.docx
Part 2Provider Database (Open Office Database)Use the project.docxPart 2Provider Database (Open Office Database)Use the project.docx
Part 2Provider Database (Open Office Database)Use the project.docx
 
Chapter 02 abap dictionary objects1
Chapter 02 abap dictionary objects1Chapter 02 abap dictionary objects1
Chapter 02 abap dictionary objects1
 
knowledgeforumpowerbitrainingnew-230816140827-5eb14be7.pdf
knowledgeforumpowerbitrainingnew-230816140827-5eb14be7.pdfknowledgeforumpowerbitrainingnew-230816140827-5eb14be7.pdf
knowledgeforumpowerbitrainingnew-230816140827-5eb14be7.pdf
 
PowerBI Training
PowerBI Training PowerBI Training
PowerBI Training
 
Sql server indexed views speed up your select queries part 1 - code-projec
Sql server indexed views   speed up your select queries  part 1 - code-projecSql server indexed views   speed up your select queries  part 1 - code-projec
Sql server indexed views speed up your select queries part 1 - code-projec
 
Alv for web
Alv for webAlv for web
Alv for web
 
Part 2Provider Database (Open Office Database)Use the project des.docx
Part 2Provider Database (Open Office Database)Use the project des.docxPart 2Provider Database (Open Office Database)Use the project des.docx
Part 2Provider Database (Open Office Database)Use the project des.docx
 
Power bi
Power biPower bi
Power bi
 

More from Kranthi Kumar

Data binding
Data bindingData binding
Data binding
Kranthi Kumar
 
Creating a comp
Creating a compCreating a comp
Creating a comp
Kranthi Kumar
 
Controllers and context programming
Controllers and context programmingControllers and context programming
Controllers and context programming
Kranthi Kumar
 
Context at design
Context at designContext at design
Context at design
Kranthi Kumar
 
Binding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseBinding,context mapping,navigation exercise
Binding,context mapping,navigation exercise
Kranthi Kumar
 
Web(abap introduction)
Web(abap introduction)Web(abap introduction)
Web(abap introduction)
Kranthi Kumar
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
Kranthi Kumar
 
Crm technical
Crm technicalCrm technical
Crm technical
Kranthi Kumar
 
control techniques
control techniquescontrol techniques
control techniques
Kranthi Kumar
 
Chapter 07 debugging sap scripts
Chapter 07 debugging sap scriptsChapter 07 debugging sap scripts
Chapter 07 debugging sap scripts
Kranthi Kumar
 
Chapter 06 printing sap script forms
Chapter 06 printing sap script formsChapter 06 printing sap script forms
Chapter 06 printing sap script forms
Kranthi Kumar
 
Chapter 05 sap script - configuration
Chapter 05 sap script - configurationChapter 05 sap script - configuration
Chapter 05 sap script - configuration
Kranthi Kumar
 
Chapter 04 sap script - output program
Chapter 04 sap script - output programChapter 04 sap script - output program
Chapter 04 sap script - output program
Kranthi Kumar
 
Chapter 02 sap script forms
Chapter 02 sap script formsChapter 02 sap script forms
Chapter 02 sap script forms
Kranthi Kumar
 
sap script overview
sap script overviewsap script overview
sap script overview
Kranthi Kumar
 
Batch input session
Batch input sessionBatch input session
Batch input session
Kranthi Kumar
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATION
Kranthi Kumar
 
Call transaction method
Call transaction methodCall transaction method
Call transaction method
Kranthi Kumar
 
Using folder options for page protection
Using folder options for page protectionUsing folder options for page protection
Using folder options for page protection
Kranthi Kumar
 
Business workflow
Business workflowBusiness workflow
Business workflow
Kranthi Kumar
 

More from Kranthi Kumar (20)

Data binding
Data bindingData binding
Data binding
 
Creating a comp
Creating a compCreating a comp
Creating a comp
 
Controllers and context programming
Controllers and context programmingControllers and context programming
Controllers and context programming
 
Context at design
Context at designContext at design
Context at design
 
Binding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseBinding,context mapping,navigation exercise
Binding,context mapping,navigation exercise
 
Web(abap introduction)
Web(abap introduction)Web(abap introduction)
Web(abap introduction)
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
Crm technical
Crm technicalCrm technical
Crm technical
 
control techniques
control techniquescontrol techniques
control techniques
 
Chapter 07 debugging sap scripts
Chapter 07 debugging sap scriptsChapter 07 debugging sap scripts
Chapter 07 debugging sap scripts
 
Chapter 06 printing sap script forms
Chapter 06 printing sap script formsChapter 06 printing sap script forms
Chapter 06 printing sap script forms
 
Chapter 05 sap script - configuration
Chapter 05 sap script - configurationChapter 05 sap script - configuration
Chapter 05 sap script - configuration
 
Chapter 04 sap script - output program
Chapter 04 sap script - output programChapter 04 sap script - output program
Chapter 04 sap script - output program
 
Chapter 02 sap script forms
Chapter 02 sap script formsChapter 02 sap script forms
Chapter 02 sap script forms
 
sap script overview
sap script overviewsap script overview
sap script overview
 
Batch input session
Batch input sessionBatch input session
Batch input session
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATION
 
Call transaction method
Call transaction methodCall transaction method
Call transaction method
 
Using folder options for page protection
Using folder options for page protectionUsing folder options for page protection
Using folder options for page protection
 
Business workflow
Business workflowBusiness workflow
Business workflow
 

Chapter 08 abap dictionary objects views1

  • 1. IBM Global Services © 2005 IBM CorporationABAP Dictionary Objects: Views | 2.08 March-2005 ABAP Dictionary Objects: Views
  • 2. IBM Global Services © 2005 IBM Corporation2 March-2005ABAP Dictionary Objects: Views | 2.08 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.
  • 3. IBM Global Services © 2005 IBM Corporation3 March-2005ABAP Dictionary Objects: Views | 2.08 What is a View?  Views are used to look into one or more tables.  A view does not contain data of its own.
  • 4. IBM Global Services © 2005 IBM Corporation4 March-2005ABAP Dictionary Objects: Views | 2.08 The Most Basic Form of a View  In its most basic form, a view simply mirrors an entire database table
  • 5. IBM Global Services © 2005 IBM Corporation5 March-2005ABAP Dictionary Objects: Views | 2.08 The Relational Operations Table 2 Selection View BView B Table 1 Projection View AView A View CView C Join Table 4Table 4Table 3Table 3  We can use views to Join several tables, Project (or choose) certain fields from one or more tables & Select (or choose) certain records from one or more tables.
  • 6. IBM Global Services © 2005 IBM Corporation6 March-2005ABAP Dictionary Objects: Views | 2.08 The Projection Operation Projection View AView A Table 1  The projection operation is used to narrow a view’s focus to certain fields in a table.
  • 7. IBM Global Services © 2005 IBM Corporation7 March-2005ABAP Dictionary Objects: Views | 2.08 Specifying Projected Fields Can use any field name if database view, otherwise must be same name as table field.
  • 8. IBM Global Services © 2005 IBM Corporation8 March-2005ABAP Dictionary Objects: Views | 2.08 The Selection Operation Selection View BView B Table 2 Example: Staff Level <= 3  The selection operation is used to narrow a view’s focus to certain records in a table.
  • 9. IBM Global Services © 2005 IBM Corporation9 March-2005ABAP Dictionary Objects: Views | 2.08 Specifying Selection Criteria 1 2 3 4 5 Can include unprojected fields
  • 10. IBM Global Services © 2005 IBM Corporation10 March-2005ABAP Dictionary Objects: Views | 2.08 The Join Operation Table 3Table 3 Join Table 4Table 4 View CView C  The join operation is used to combine information from multiple tables into a single view.
  • 11. IBM Global Services © 2005 IBM Corporation11 March-2005ABAP Dictionary Objects: Views | 2.08 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 Wrong  Database design principles often require related data to be stored in separate tables. This is called normalising. The Necessity of the Join Operation
  • 12. IBM Global Services © 2005 IBM Corporation12 March-2005ABAP Dictionary Objects: Views | 2.08 ID Name … EmployeeEmployee 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 Understanding the Join Operation SalarySalary Right  The join operation essentially reverses the normalising process.  The result of a join is a view that looks like a table with redundant data.
  • 13. IBM Global Services © 2005 IBM Corporation13 March-2005ABAP Dictionary Objects: Views | 2.08 The Join Operation and Foreign Keys View CView C Join Table 4Table 4Table 3Table 3 Primary Secondary  Therefore, in order to use the join operation in SAP, you must first ensure that the appropriate foreign key relationships exist among the tables to be joined.
  • 14. IBM Global Services © 2005 IBM Corporation14 March-2005ABAP Dictionary Objects: Views | 2.08 Specifying Joined Fields Indicate base tables that data will come from.Indicate base tables that data will come from. Hit button to see related tables and automatically generate join conditions. Join Conditions
  • 15. IBM Global Services © 2005 IBM Corporation15 March-2005ABAP Dictionary Objects: Views | 2.08 Types of Views in the ABAP Dictionary  Database View  Projection View  Help View  Maintenance View
  • 16. IBM Global Services © 2005 IBM Corporation16 March-2005ABAP Dictionary Objects: Views | 2.08 Database The Database View DB Database View  The database view is the only type of view in SAP that is physically created at the database level.
  • 17. IBM Global Services © 2005 IBM Corporation17 March-2005ABAP Dictionary Objects: Views | 2.08 Demonstration  Creation of a database view using two related database tables.
  • 18. IBM Global Services © 2005 IBM Corporation18 March-2005ABAP Dictionary Objects: Views | 2.08 Practice  Creation of a database view using two related database tables.
  • 19. IBM Global Services © 2005 IBM Corporation19 March-2005ABAP Dictionary Objects: Views | 2.08 The Projection View View C Projection View  The projection view is a logical view. In this context, the word “logical” means that the view exists within the ABAP Dictionary but is not recognized by the underlying database system.
  • 20. IBM Global Services © 2005 IBM Corporation20 March-2005ABAP Dictionary Objects: Views | 2.08 Database vs. Projection Views Database ViewProjection View • Must be built over a single table • Data can be updated • Data updates must use open SQL • Updates are less efficient • Fields in the view must be named the same as the fields in the underlying table • Can’t be buffered • Can be built over many tables • Data can be updated if the view is built over a single table • Data updates can use open or native SQL • Updates are more efficient • Fields in the view can be named differently from the fields in the underlying table • Can be buffered
  • 21. IBM Global Services © 2005 IBM Corporation21 March-2005ABAP Dictionary Objects: Views | 2.08 Other Types of Views  Help View: Help views can be used as selection methods for Search Helps.It might be necessary to create a Help View if you are trying to accomplish an outer join.  Maintenance View: These views permit maintenance of base table data. Transactions SM30 and SE54 are provided for working with maintenance views.
  • 22. IBM Global Services © 2005 IBM Corporation22 March-2005ABAP Dictionary Objects: Views | 2.08 Using a View in Program Code TABLES: YXXEMP_V. SELECT* FROM YXXEMP_V. WRITE: / YXXEMP_V-EMP_ID YXXEMP_V-LAST_NAME, YXXEMP_V-FIRST_NAME. ENDSELECT.
  • 23. IBM Global Services © 2005 IBM Corporation23 March-2005ABAP Dictionary Objects: Views | 2.08 Demonstration  Select data from the database view created earlier and display selected data in a report.
  • 24. IBM Global Services © 2005 IBM Corporation24 March-2005ABAP Dictionary Objects: Views | 2.08 Practice  Select data from the database view created earlier and display selected data in a report.
  • 25. IBM Global Services © 2005 IBM Corporation25 March-2005ABAP Dictionary Objects: Views | 2.08 Summary  Views are used to look into one or more tables. A view does not contain data of its own.  The projection operation is used to narrow a view’s focus to certain fields in a table.  The Selection Operation is used to narrow a view’s focus to certain records in a table.  The Join Operation is used to combine information from multiple tables into a single view.  Types of Views in the ABAP Dictionary are Database View, Projection View, Help View & Maintenance View.  The syntax to reference a view in an ABAP program is the same syntax we use to reference a table.
  • 26. IBM Global Services © 2005 IBM Corporation26 March-2005ABAP Dictionary Objects: Views | 2.08 Questions  What is a View ?  What is a Database view ?  What is a Projection view ?  What is a Maintenance view ?  What is a Help view ?

Editor's Notes

  1. A view is an object, like the telescope, that provides a picture of something. We can construct a view with special “lenses” or “filters” to allow us to look at one or more dictionary tables. We can look at parts of one table (selected records and/or fields) or combinations of tables and parts of tables. A view is an ABAP Dictionary object. In many cases, you reference a view in an ABAP program just as you would a table. For example, you can select data from a view. However, a view does not contain data of its own – rather, the view provides specialised access to the data that exists in other tables. For this reason, views are often called virtual tables.
  2. In its most basic form, a view simply mirrors an entire database table. It looks just like the table and it acts just like the table – but it isn’t actually the table. Of course, if this is all that views could do, they wouldn’t be very useful. Let’s take a look at some of the other capabilities of views. The view name cannot be the same as an existing table name.
  3. We can use views to: Join several tables Project (or choose) certain fields from one or more tables Select (or choose) certain records from one or more tables Join, projection, and selection are called relational operations.
  4. The projection operation is used to narrow a view’s focus to certain fields in a table. For example, we might have a view of an employee table that does not contain the salary field. Employees authorised to view salary data would be given authorisation to view the actual table, while other employees might only have authorisation to use the view without the salary data.
  5. When designing a view, view fields need to be given names. The view field names should be the same as the regular table fields they are reflecting, unless the view is a database view. Only in that situation are you permitted to use different names. When referencing the view field in code, you would refer to VIEW_NAME-VIEW_FIELD_NAME. You can also indicate the following in the View field column: : Include every field from the table. It follows that in the Field name column, you would indicate a * as well. : This removes a specific field from a view. You can use this option in conjunction with the one above to fine-tune which fields you want included in the view.
  6. The selection operation is used to narrow a view’s focus to certain records in a table. For example, we might sometimes wish to view only the information about employees belonging to a certain staff classification. This might mean creating one view containing partners and principals one view containing principal consultants, and another view containing consultants. Each view would be built using selection criteria that indicated which records to include in that view. As an example of why such a view might be used, staff members might be permitted to view the billing rates of employees in the same staff classification or lower, but not of employees in a higher classification.
  7. You specify selection criteria by building logical expressions that compare specific fields of a table to hard-coded literal values. (1 &amp; 2) Specify the table and field on which the restricted selection should take place. Any fields, including unprojected ones, can be indicated. (3) Specify the relational operator used to compare the field to the value. You may use EQ, NE, LE, LT, GE, GT, LIKE, and NOT LIKE. (4) Specify the comparison value. Comparison values must be text or numeric literals. Text literals must be enclosed in single quotes. (5) You can specify multiple selection criteria (one per line) and link them using the logical operators AND and OR. Unlike elsewhere in SAP (and most other systems), OR takes priority over AND. Also, OR operations are only permitted between lines which refer to the same field. If the projection and selection operations are both used within the same view, it is possible to specify selection criteria for fields that are not included within the view. For example, it would be possible to create a view that contained only employees making over $100,000 per year even if the view did not contain the salary field.
  8. The join operation is used to combine information from multiple tables into a single view. For example, we might wish to create a report listing employees by name, along with their salary history. Database design considerations would probably result in the salary history being stored in one table and basic employee information (such as the name) being stored in another. Thus, we might create a view that would combine the data from both tables. We could write our report program using this view, and it would seem to our program as if the data was stored in a single table. Using the join operation within a view is generally the most efficient way to access data from multiple tables. We’ll examine some other methods later on.
  9. Database design principles often require related data to be stored in separate tables. This is necessary to provide flexibility in one-to-many and many-to-many relationships, and also to prevent data redundancy. For example, if employee name and salary history were stored in the same table, we would encounter one of the following situations: If we stored salary history on the employee record, we would have to create a fixed number of “previous salary” fields in the employee table. For many employees, most of those fields would be blank, and for long-term employees, we might eventually run out of fields. If we stored employee name on the salary history record, we would have many copies of the employee’s name. If the employee’s name changed, that change would have to be made many times. Additionally, we would run the risk of not updating all the data correctly, and the employee and the salary table could get “out of sync.” Whenever possible, redundant copies of the same information should be avoided. As a result, data is often “broken apart” into several tables. This is called normalising the database. The join operation essentially reverses this process. The result of a join is a view that looks like a table with redundant data.
  10. When data is broken apart into separate tables, it is still necessary to duplicate some data – namely the key fields of the tables involved. For example, the salary history table would contain a field for employee ID number, so that we knew which employee each salary record belonged to. In this case, the employee ID number becomes a foreign key in the salary history table. The key to understanding the join operation is to understand that different tables are joined together using foreign keys. We don’t want every employee’s name associated with every salary history record. Rather, we want each employee’s name to be associated with only those salary records belonging to that employee.
  11. Therefore, in order to use the join operation in SAP, you must first ensure that the appropriate foreign key relationships exist among the tables to be joined. Also, you must ensure that the semantic attributes of those foreign keys have been maintained (see Chapter 4 for a discussion of semantic attributes and foreign keys). Other notes on the join operation: Views are created with a primary table and up to 10 secondary tables. The primary table can be either a check table or a foreign key table with respect to the other tables in the view (i.e., the primary table does not have to be the check table). Note : When a join operation is employed, only those primary table records that have a match in all secondary tables are retrieved. For example, in a join between employees and salary history, employees with no salary history records would not appear at all.
  12. You can hard code all the tables you need all at once. Then you would have to hard code the foreign key relationships between them as well. It might be simpler to input the first base table, and from there hit the Relationships pushbutton. Then you can select a related table and the join conditions will be filled in automatically for you.
  13. The database view is the only type of view in SAP that is physically created at the database level. In other words, the underlying database system also directly recognises the view, apart from SAP. Therefore, database views must be created over transparent tables. With the database view, all three of the relational operations (projection, selection, and join) can be used. Database views can be buffered just like transparent tables. In the technical settings you can decide whether to have buffering off, or on with type single record, generic, or full.
  14. The projection view is a logical view. In this context, the word “logical” means that the view exists within the ABAP Dictionary but is not recognised by the underlying database system. Projection views must be defined over a single transparent table. The only relational operation that is valid for a projection view is projection.
  15. Projection Views Database Views Must be built over a single table Can be built over many tables Data can be updatedData can be updated if the view is built over asingle table Data updates must use open SQLData updates can use open SQL or Native SQL Updates are less efficient than usingUpdates are more efficient than usinga Database Viewa Projection View Fields in the view must be named the Fields in the view can be namedsame as the fields in the differently from the fields in theunderlying table underlying table(s) Can’t be bufferedCan be buffered
  16. Help Views: Help views can be used as selection methods for Search Helps. It might be necessary to create a Help View if you are trying to accomplish an outer join, since database views only create inner joins. Maintenance Views: These views permit maintenance of base table data. Transactions SM30 and SE54 are provided for working with maintenance views. In previous releases, Help Views used to play a major role in matchcodes. However, matchcodes have been replaced by Search Helps, and therefore, Help Views no longer have as big a presence.
  17. In the code above, we select data from the view YXXEMP_V to write data from the id, name, and salary fields to the screen. The syntax to reference a view in an ABAP program is the same as that used to reference a table.