Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Diffe b/w View and inner join

Diffe b/w View and inner join

Tags:
Former Member
Former Member replied

Hi Gana,

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.

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

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

<b>View:</b> 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>

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.

R<b>eward Point if helpful</b>

Regards

Gokul

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question