Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

VIEWS - ABAP Dictionary

Tags: table

VIEWS

Data on the application object is often distributed on the several database tables. Database systems therefore provide you with a way of defining application-specific views on data in several tables. These are called views.

Four different view types are supported. These differ in the way in which the view is implemented and in the methods permitted for accessing the view data.

1. Database views:
are implemented with an equivalent view on the database.
  • Database views implement an inner join. The other view types implement an outer join.
  • A database view is defined in the ABAP Dictionary and automatically created on the database during activation.
  • Accesses to a database view are passed directly to the database from the database interface .
  • The database software performs the data selection.
  • The definition of a database view is changed in the ABAP Dictionary, the view created on the database must be adjusted to this change.
  • view does not contain any data, this adjustment is made by deleting the old view definition and creating the view again in the ABAP Dictionary with its new definition.
  • The maintenance status defines whether you can only read with the view or whether you can also write with it.
  • If a database view was defined with more than one table, this view must be read only.
  • The data read with a database view can be buffered.
  • View data is buffered analogously to tables.
  • The technical settings of a database view control whether the view data may be buffered and how this should be done.
  •  The buffered view data is invalidated when the data in one of the base tables of the view changes.
  • In database views, the join conditions can be formulated using equality relationships between any base fields. 
  • In the other types of view, they must be taken from existing foreign keys. That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys. 
  • It can include entire tables in database views . 
  • All the fields of the included table become fields of the view (whereby you can explicitly exclude certain fields).
  • If new fields are included in the table or existing fields are deleted, the view is automatically adjusted to this change.
  • A new or deleted field is therefore automatically included in the view or deleted from it.
  • To include a table in a view, you must enter the character '*' in field View field in the view maintenance, the name of the table to be included in the field Table and the character '*' again in the field name.
  • If you do not want to insert a field of the included table in the view, you must enter a '-' in field View field, the name of the included table in field Table and the name of the field to be excluded in field name.
 2. Projection views: 
 are used to hide fields of a table (only projection).

  • Projection views are used to hide fields of a table. This can minimize interfaces.
for example,
when you access the database, you only read and write the field contents actually needed.
  • A projection view contains exactly one table.
  • We cannot define selection conditions for projection views. 
  • There is no corresponding object in the database for a projection view. 
  • The R/3 System maps the access to a projection view to the corresponding access to its base table. 
  • We can also access pooled tables and cluster tables with a projection view. 
  • The maintenance status of the view controls how the data of the table can be accessed with the projection view.
3. Help views:
can be used as selection method in search helps.
  • Create a help view if a view with outer join is needed as selection method of a search help.
  • The selection method of a search help is either a table or a view.
  • If you have to select data from several tables for the search help, you should generally use a database view as selection method.
  • All the tables included in a help view must be linked with foreign keys.
  • Only foreign keys that have certain attributes can be used.
  • The first table to be inserted in the help view is called the primary table of the help view.
  • The tables added to this primary table with foreign keys are called secondary tables.
  • Help views are used to output additional information when the online help system is called.
  • When the F4 button is pressed for a screen field, a check is first made on whether a matchcode is defined for this field .
  • If this is not the case, the help view is displayed in which the check table of the field is the primary table.
  • Thus, for each table no more than one help view can be created, that is, a table can only be primary table in at most one help view.
4.  Maintenance views: 
permit you to maintain the data distributed on several tables for one application object at one time

  • Data that is distributed on more than one table often forms a logical unit, called an application object .
  • It can be able to display, change and create the data of such an application object together . 
  • All the tables used in a maintenance view must be linked with a foreign key . 
  • The join conditions are always derived from the foreign key in the maintenance view. 
  • We cannot enter the join conditions directly as in a database view. 
  • A maintenance interface with which the data of the view can be displayed, changed and created must be generated from the definition of a maintenance view in the ABAP Dictionary. 
  • When the maintenance interface is created, function modules that distribute the data maintained with the view on the underlying tables are automatically generated. 
  • The maintenance interface is generated with the Transaction Generate Table View (Transaction SE54) or from the view maintenance screen with Utilities -> Tab.maint.generator. 
  • Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. 
  • Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.




This post first appeared on The World Of SAP, please read the originial post: here

Share the post

VIEWS - ABAP Dictionary

×

Subscribe to The World Of Sap

Get updates delivered right to your inbox!

Thank you for your subscription

×