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: 

View and Join

Former Member
0 Kudos

Hi,

What is the Difference between view and join.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

What is a View ?

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.

What is a Inner join ?

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.

Difference between View and Inner Join

Inner Join: 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.

View: 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.

Types of Views:

Database View: 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

Projection View: 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.

Maintenance View: 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.

Search Help View: 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.

4 REPLIES 4

Former Member
0 Kudos

What is a View ?

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.

What is a Inner join ?

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.

Difference between View and Inner Join

Inner Join: 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.

View: 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.

Types of Views:

Database View: 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

Projection View: 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.

Maintenance View: 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.

Search Help View: 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.

0 Kudos

Hi,

A VIew is based on JOIN,

But a VIEW exists in DDIC, and A VIEW can be buffered.

Where as JOIN cannot be buffered.

VIEW is create once and use many times.

JOIN is Create and use every time the program runs.

VIEW's can be used for creating Search helps.

Regards,

Sesh

varma_narayana
Active Contributor
0 Kudos

Hi..

We can use DATABASE View as Alternative to Create Joins in ABAP program.

So a View is like a Stored Join.

Whenever there are Repeated Joins in Several programs we can Create a View.. So it is reusable..

<b>reward if Helpful</b>

Former Member
0 Kudos

HI

VIEWS

Importance/Use of views

Join/Projection/Selection w.r.t views

Inner and Outer joins

Types of views

Database view

Projection view

Maintenance view

Help view

The data that can be selected with a view depends primarily on whether the view implements an inner join or an outer join.

With an inner join, you only get the records of the cross-product for which there is an entry in all tables used in the view.

With an outer join, records are also selected for which there is no entry in some of the tables used in the view. (ABAP allows left outer join.)

REWARD IF USEFULL<b></b>