Upload
talk2parimi
View
219
Download
0
Embed Size (px)
Citation preview
8/6/2019 View Creation
http://slidepdf.com/reader/full/view-creation 1/8
View creation
Views
General Concept:
In the language of relational databases, a view is a virtual table, thatis, a table that is not actually physically stored, instead being derived
from one or more other tables.
In the simplest case, this derivation process can involve simplysuppressing the display of one or more fields from a base table
(Projection) or transferring only certain records from a base table tothe view (Selection). More complicated views can be assembled from
several base tables, with individual tables being linked using the
relational Join operation.
The way views are defined in relational database systems, it is possible
to use any desired combination of the three fundamental operations -projection, selection, and join - with the single constraint being that
only views derived from a single base table, i.e. without applying the
join operation, may be relationally operated on in turn.
SAP view concept:
The SAP view concept is based on the fundamental relational
operations, which are projection, selection, and join.
However, whereas in strictly relational systems links between differenttables must be dynamically forged using join operations, the SAP data
model with its foreign key concept offers the possibility of staticallydefining semantic foreign keys between tables in the ABAP
Dictionary.
In order to ensure that only semantically meaningful views will begenerated, the view definition used only permits tables to be joined
that are already linked by appropriate foreign keys in the ABAPDictionary.
This definition of views allows logical cross-sections of data to be
generated in response to the needs of specific applications, so that therequired data can be directly and efficiently accessed.
The following view types are supported:
8/6/2019 View Creation
http://slidepdf.com/reader/full/view-creation 2/8
• Database views
• Projection views
• Help views
• Maintenance views
Database views
The view defined in the ABAP Dictionary is reproduced in the
underlying database. You can use both ABAP Open SQL and ABAP
Native SQL to access such views from ABAP programs, but you canonly define them using transparent tables. If you define a database
view using only one table, you can make changes to the view. Fordatabase views containing several tables, however, only read accesses
are allowed
Projection views (table projection only)
Projection views are used to suppress certain fields from a table in theinterests of minimizing interfaces. A projection view can only refer to
one table and, in contrast to database views; you cannot specify anyrestrictions with regard to table type. This view type also permits both
read and writes accesses with ABAP Open SQL.
Help views
Help views are used as the selection method of elementary search
helps if the selection is too complex to be defined with a single
database table. In contrast to database views, help views implementan outer join. For this reason they are suitable for linking
supplementary information such as explanatory text from secondarytables. If the supplementary information were missing in an inner join,
the entire dataset would not be selected.
If the selection is only to use a table and its text table , it is sufficient
to specify the table directly as selection method of the search helpsince the fields of the text table can also be used as parameters in thesearch help in this case.
You should not use a help view if you expect the selection to be
restricted frequently with fields of the secondary tables. In this case
8/6/2019 View Creation
http://slidepdf.com/reader/full/view-creation 3/8
you should create a database view instead. You might also have tocreate suitable indexes for the base tables.
You can only speed up selection with help views if you restrict the
primary table. When accessing help views with the help processor,
special selection routines are generated. These routines always firstmake the selection using the primary table and then use the recordsfound as a key for selecting the supplementary information.
Notes
1. Direct access to help views is not possible.2. Prior to Release 4.0 help views were automatically used to
define the check table help for the primary table of the help
view. This is no longer valid as of Release 4.0.You can get the same effect by creating a suitable search help
and attaching it to the check table
Maintenance views
Maintenance views provide you with a business view of the data. You
can change it either with the table maintenance transaction SM30,
which allows you to maintain data from the base tables in a view atthe same time, or with the customizing transaction. The mechanisms
for data maintenance such as screens and processing programs can becreated with a special transaction (SE54).
1) In order to create a VIEW go to the T-Code SE11. Creation of
view is only possible if there is a foreign key relationship
between the two or more tables. Creation of view is also startedwith either Y or Z.
8/6/2019 View Creation
http://slidepdf.com/reader/full/view-creation 4/8
Give view name and click on create.
Give Short description then give two or more tables, which are having
foreign key relationships and then click on relationships
8/6/2019 View Creation
http://slidepdf.com/reader/full/view-creation 5/8
Select the check box and then click on copy. It gives the tablesnames along with the filed, which is common in the tables.
8/6/2019 View Creation
http://slidepdf.com/reader/full/view-creation 6/8
Then click on view fields tab and click on tables’ fields.
Select one table and click on Choose, then select what ever fields wewant from that table and click on copy.
8/6/2019 View Creation
http://slidepdf.com/reader/full/view-creation 7/8
Do same process for the 2nd table also.
Click on save, check and Activate. And then click on contents tab.
8/6/2019 View Creation
http://slidepdf.com/reader/full/view-creation 8/8
Click on execute.
This is the creation of VIEW