Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

datadictionary (se11) why do we need view?explain?

Former Member
0 Kudos

hi

1 why do we need view?

2 .what is the difference between view & inner join?

3.tell me about view types?

regards

eswar

8 REPLIES 8

Former Member
0 Kudos

Hi,

Data about an application object is often distributed on several tables. By defining a view, you can define an application-dependent view that combines this data. The structure of such a view is defined by specifying the tables and fields used in the view. Fields that are not required can be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.

http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ec5d446011d189700000e8322d00/content.htm

Regards

Sudheer

Former Member
0 Kudos

Hi,

1 why do we need view?

If we want to see output of some of the fields of 2 or more tables having some join relation in them, then we use the views.

2 .what is the difference between view & inner join?

Inner join is very similar to view. But view is visible in data dictionary and you cannot always make a view while connecting two tables, so we use inner joins rather than views.

3.tell me about view types?

Maintenance view

selection view

projection view

regards

eswar

Former Member
0 Kudos

Hi,

<b>1 why do we need view?</b>

A view is a virtual table which gets data from different tables and displays on a single screen actually in real time every time we require data from different tables in such case we create a view and we call that view in the program.Views are created to combine data from two table

<b>2 .what is the difference between view & inner join?</b>

Both views and joins are used to select the data from two or more tables,

JOINS help us to retrieve the data from the database, i.e., in the select query after using joins we get combined data. This is done in SE38.

but through VIEWS we can select the data which is already combined at the dictionary level. This is done in SE11.

<b>3.tell me about view types?</b>

There are 4 types views are avilable in SAP.

Database View - To club more than one table

Projection View - To hide fields in one table

Maintanance View - To maintain database records in table

Help View - To provide help for a fields (Same functionality as Search help. This is outdated)

View are improves perfromance in the following aspects

1. If you want to use more than two table in 'JOIN' condition better to use Views . It will improves performance of a program

2. If you want to use mutiple FOR ALL ENTRIES clause, better to club all SELECT statement in a view.

note:

1.Views does not contain data in it. It fetches data from the database only depending on the condition ...

2.Views are part of data dictionary. They are a window to view the data in database

3.views can be used to give security to data. users can be allowed to view only basic data only

Reagrds,

Priyanka.

Former Member
0 Kudos

Hi,

These views are generally created for inserting data into more than one tabe at a time.

Views improve perfromance in the following aspects

1. If you want to use more than two table in 'JOIN' condition better to use Views . It will improve performance of a program

2. If you want to use mutiple FOR ALL ENTRIES clause, better to club all SELECT statement in a view.

Note:

1.Views does not contain data in it. It fetches data from the database only depending on the condition ...

2.Views are part of data dictionary. They are a window to view the data in database

3.Views can be used to give security to data. users are allowed to view only basic data only

Regards

Message was edited by:

Kiran Sure(skk)

Former Member
0 Kudos

Hi Eswar,

<b>View:</b>

When you want ot fetch data from one or more than one tables from the database, Views can be used.

It can also be used to only display the data to the user, restricting him from modifying the data.

<b>Difference between View and Inner Join</b>

Inner Join: For inner join, you require more than table and it requires monly Transparent Tables.

View: It can be based on one or more than one table. Any type of join can be written in the conditions tab.

<b>View Types:</b>

1. Database View: This view is only based on tables where you cant modify the data. It is used mainly to display the data and based on Inner Join

2. Projection View: This view is used to select few columns from >1 table(s).

3. Maintenance View: This view is based on Outer Join condition and data can be modified.

4. Help View: This view is based on Outer Join

<b>Reward Point if helpful</b>

Harish

Former Member
0 Kudos

HI,

1 why do we need view?

A view is a virtual table which gets data from different tables and displays on a single screen actually in real time every time we require data from different tables in such case we create a view and we call that view in the program.Views are created to combine data from two table

2 .what is the difference between view & inner join?

Both views and joins are used to select the data from two or more tables,

JOINS help us to retrieve the data from the database, i.e., in the select query after using joins we get combined data. This is done in SE38.

but through VIEWS we can select the data which is already combined at the dictionary level. This is done in SE11.

3.tell me about view types?

There are 4 types views are avilable in SAP.

Database View - To club more than one table

Projection View - To hide fields in one table

Maintanance View - To maintain database records in table

Help View - To provide help for a fields (Same functionality as Search help. This is outdated)

View are improves perfromance in the following aspects

1. If you want to use more than two table in 'JOIN' condition better to use Views . It will improves performance of a program

2. If you want to use mutiple FOR ALL ENTRIES clause, better to club all SELECT statement in a view.

note:

1.Views does not contain data in it. It fetches data from the database only depending on the condition ...

2.Views are part of data dictionary. They are a window to view the data in database

3.views can be used to give security to data. users can be allowed to view only basic data only

IF HELPFUL REWARD SOME POINTS.

WITH REGARDS,

SURESH ALURI

former_member183890
Participant
0 Kudos

Hi Eswar,

Pls see my answer for your questions.

<b>What is a View ?</b>

When you want to fetch data from one or more than one tables from the database, Views can be used. But once a view is created it resides permanently in the database memory for future usage. Also with a view creation it can be used to maintain data in the SM30 transaction when a table maintainence is created for a table. Before creating a view we need to be definite if it is of definite usage in the future.

<b>What is a Inner join ?</b>

When you want to fetch data from one or more than one tables from the database, only in a ABAP program Inner joins can be used. The inner join does the same thing as the view but it is available only in the run time of ABAP code execution.

<b>Difference between View and Inner Join</b>

<u>Inner Join</u>: Run time entity enable to join only Transparent Tables. As the no. of tables fopr the join increases the performace decreases as it occupies more meory and runtime. Also the code becomes complex.

<u>View</u>: A view is a permanent database entity. There is no restriction on the no. of tables. Any type of join can be written in the conditions tab. At run time in a ABAP code a view can be used with select statements as we do with tables.

<b>Types of Views:</b>

<u>Database View</u>: This is a view that can be used on to fetch data in the ABAP code to. Data about an application object is often distributed on several database tables. A database view provides an application-specific view on such distributed data. Database views are defined in the ABAP Dictionary. A database view is automatically created in the underlying database when it is activated. Application programs can access the data of a database view using the database interface. You can access the data in ABAP programs with both OPEN SQL and NATIVE SQL. However, the data is actually selected in the database. Since the join operation is executed in the database in this case, you can minimize the number of database accesses in this way. Database views implement an inner join

<u>Projection View</u>: 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. You 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. You can also access pooled tables and cluster tables with a projection view.

<u>Maintenance View</u>: These views are created for the table maintainance for tables. Maintenance views offer easy ways to maintain complex application objects. Data distributed on several tables often forms a logical unit, for example an application object, for the user. You want to be able to display, modify and create the data of such an application object together. Normally the user is not interested in the technical implementation of the application object, that is in the distribution of the data on several tables. A maintenance view permits you to maintain the data of an application object together. The data is automatically distributed in the underlying database tables.

<u>Search Help View</u>: It is used for producing search helps. You have to 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. However, a database view always implements an inner join. If you need a view with outer join for the data selection, you have to use a help view as selection method.

Hope it helps. Reward Point if helpful

- Irudayaraj Peter

Former Member
0 Kudos

Use of Views instead of base tables

Many times ABAP programmers deal with base tables and nested selects. Instead it is always advisable to see whether there is any view provided by SAP on those base tables, so that the data can be filtered out directly, rather than specially coding for it.

Not recommended

Select * from zcntry where cntry like ‘IN%’.

Select single * from zflight where cntry = zcntry-cntry and airln = ‘LF’.

Endselect.

Recommended

Select * from zcnfl where cntry like ‘IN%’ and airln = ‘LF’.

Endselect.

Joins

Proper use of Inner Join

When multiple SAP tables are logically joined, it is always advisable to use inner join to read the data from them. This certainly reduces the load on the network.

Let us take an example of 2 tables, zairln and zflight. The table zairln has the field airln, which is the airline code and the field lnnam, which is the name of the airline. The table zflight has the field airln, the airline code and other fields which hold the details of the flights that an airline operates.

Since these 2 tables a re logically joined by the airln field, it is advisable to use the inner join.

Select aairln alnnam bfligh bcntry into table int_airdet

From zairln as a inner join zflight as b on aairln = bairln.

In order to restrict the data as per the selection criteria, a where clause can be added to the above inner join.

What is the Different Types and Usage of Views

This is often asked in an interview about the types of views:

The followings are different types of views:

- Database View (SE11)

Database views are implement an inner join, that is, only records of the primary table (selected via the join operation) for which the corresponding records of the secondary tables also exist are fetched. Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set.

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.

- Help View ( SE54)

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.

- Projection View

Projection views are used to suppress or mask certain fields in a table (projection), thus minimizing the number of interfaces. This means that only the data that is actually required is exchanged when the database is accessed.

A projection view can draw upon only one table. Selection conditions cannot be specified for projection views.

- Maintenance View ( SE54 )

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.

regards,

srinivas

<b>*reward for useful answers*</b>