What is view? Different types of view. Explain?
View - A view is a virtual table containing fields from one or more tables. A virtual table that does not contain any data,
but instead provides an application-oriented view of one or more ABAP Dictionary tables.
Different Types of View:
1) Maintenance
2) Database – It is on more than two tables.
3) Projection – It is only on one table.
4) Help
Data for an application object is often distributed on 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.Data from several tables can be combined in a meaningful way using a view (join). You can also hide information that is of no interest to you (projection) or only display those data records that satisfy certain conditions (selection).The data of a view can be displayed exactly like the data of a table in the extended table maintenance.Given two tables TABA and TABB. Table TABA contains 2 entries and table TABB 4 entries.The tables are first appended to one another. This results in the cross-product of the two tables, in which each record of TABA is combined with each record of TABB.Usually the entire cross-product is not a meaningful selection. You should therefore limit the cross-product with a join condition. The join condition describes how the records of the two tables are related.In our example, Field 3 of TABB identifies Field 1 of TABA. The join condition is then:TABA - Field 1 = TABB - Field 3With this join condition, all the records whose entry in Field 1 is not identical to the entry in Field 3 are removed from the cross product. The column for Field 3 in the view is therefore unnecessary.STRUCTURE OF A VIEW:Often some of the fields of the tables involved in a view are of no interest. You can explicitly define the set of fields to be included in the view (projection).The set of records that can be displayed with the view can be further restricted with a selection condition.In our example, only those records with value 'A' in Field 4 should be displayed with the view.A selection condition therefore can also be formulated with a field that is not contained in the view.The join conditions can also be derived from the existing foreign key relationships. Copying the join conditions from the existing foreign keys is supported in the maintenance transaction.The field names of the underlying table fields are normally used as field names in the view. However, you can also choose a different field name. This is necessary for instance if two fields with the same name are to be copied to the view from different tables. In this case you must choose a different name for one of the two fields in the view.Selection with a database view, however, is usually more efficient than selection with a nested SELECT statement.As of Release 4.0 you can formulate the join condition directly in OPEN SQL.A view has type character and can be accessed in programs like all other types and can be used to define data objects.DATA BASE VIEWS: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.If the definition of a database view is changed in the ABAP Dictionary, the view created on the database must be adjusted to this change. Since a 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 same settings (buffering types) can be used here as for table buffering. The buffered view data is invalidated when the data in one of the base tables of the view changes.
Confused? Feel free to ask
Your feedback is always appreciated.I will try to reply Ur queries as soon as time allows.
Regards,
SAPhelpdesk
0 comments:
Post a Comment