VIEWS
· A View is collection of fields from multiple Tables.
· Views doesn't store any data.
· Whenever a view is executed, it displays the data by selecting from multiple Tables.
· To create a view , we must join the tables.
· To join the tables there must be at least one common key field.
JOIN:
· It is a concept to link two (or) multiple tables for displaying the data.
· There are two types joins.
1. Inner Join.
2. Outer Join (or) Left Outer Join.
INNER JOIN:
· In this type of join, only the matching record b/w two (or) multiple tables will be selected.
· The unmatched records will not be selected.
OUTER JOIN:
· In this type of join , all the records from left table(1st table) will be displayed.
· If there is a matching record in the 2nd (or) 3rd table the data will be displayed.
· If there is no matching record, the data will be displayed as blank values.
Types of Views:
· There are 4 types views.
1. DATABASE View
2. PROJECTION View.
3. HELP View.
4. MAINTENANCE View.
1. DATABASE VIEW:
· A view created on two (or) more tables by clubbing the fields using inner join is called " DATABASE VIEW".
· In this View, we can only read the data.
· we cannot do any maintenance operation.
· Since , database view uses inner join , it selects only the matching records b/w the tables.
Steps to create DB View:
Business Req: Develop a DB View on MARA , MAKT tables to displays MATNR, MTART,
MBRSH , MEINS , SPRAS , MAKTX.
Steps:
· Go to SE11.
· Select View and give the name as: ZDBVIEW1
· Click on Create button.
· Select the DATABASE VIEW as below and click copy button.
· Go to Tables/Joins Conditions.
· Provide Table names along with JOIN condition as below.