View

Views are objects that are projection of SAP database tables. ‘Database’, ‘Projection’, ‘Maintenance’ and ‘Help’ views are the View types in Data Dictionary. Most of these types have very little differences but the ‘Maintenance’ has quite distinct configuration and usage. As ‘Database’ and ‘Maintenance’ are the most used types i will briefly explain how to create and configure them.

  • Database Views

This type of views are an equivalance of INNER JOIN command of SQL as a Data Dictionary object. For instance on behalf of writing below code, you can create a database view which is joining mara and equi tables and then use it in sql statement directly.

without view
select a~matnr a~mtart a~matkl a~meins b~equnr b~sernr
from mara as a
inner join equi as b
on a~matnr eq b~matnr
where mtart eq ‘ABC’

create view

database_view
databse_view2
databse_view3

with database view
select * from zya_database

  • Maintenance Views

This type of views are aimed to be created for maintaining more than one table at the same time. Because maintenance views provides Table Maintenance Generator option but other views do not, we can use this type of view when joining two or more tables. Moreover when generating table maintenance screens automatically, Maintenance Views carries Maintenance attribute for view field to configure screen. This field is located in View Flds tab and has the following values:

—————————————————————–
|MF|Short Descript.                                             |
—————————————————————–
|  |View field is available as normal                           |
|R |View field can only be read                                 |
|S |View field is used to form subsets                          |
|H |View field is not transferred to the maintenance screens    |
—————————————————————–

Now in order to create a maintenance screen view which is populating one custom table and joining another standart table(in order to extract a display only field) follow the below steps. I did this in Eclipse environment.

 

  • Projection Views

This type of views are consist of just one table and provides a projection upon this table.

  • Help Views

This type of views are very close with database views except they join tables with left outer join whereas database views make inner join.