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: 

selection conditions urgent

Former Member
0 Kudos

Hello Guys i have 2 tables for which i have to create maintainable view and alos i need to write selection statment.my question is how to create maintainece view foe 2 tables and where to write the selection statement.its urgent.

Regards

Janapathi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Importance/Use of Views



Data for an application object is often distributed on several database tables. Database systems therefore provide you with a way of defining application-specific views on the data contained in several tables. These are called views.

Data from several tables can be combined in a meaningful way using a view (join). You can also hide information that is of no interest to you (projection) or only display those data records that satisfy certain conditions (selection).

A view is a logical view on one or more tables, that is, a view is not actually physically stored, instead being derived from one or more other tables.

The data of a view can be displayed exactly like the data of a table in the extended table maintenance.

Join, Projection and Selection



CROSS PRODUCT
Given two tables TABA and TABB. Table TABA has 2 entries and table TABB has 4 entries

Each record of TABA is first combined with each record of TABB. If a join condition is not defined, the cross product of tables TABA and TABB is displayed with the view.

Join condition
A join condition describes how the records of the two tables are connected.

Inner Join and Outer Join


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.)


Selection Conditions



Selection conditions that are used as a filter can be defined for a view.

Specifying these conditions under the Selection conditions tab when creating a view in the dictionary would have an effect which is similar to specifying a where clause when writing a select query to restrict data.

Projection

Sometimes some of the fields of the tables involved in a view are not of interest. The set of fields used in the view can be defined explicitly (projection). In our example, Field 4 is of no interest and can be hidden.

We specify the fields which we need to show in our view by including them under the view flds tab when creating a view in the dictionary.


View Types



Four different view types are supported. These differ in the way in which the view is implemented and in the methods permitted for accessing the view data .

Database views are implemented with an equivalent view on the database.

Projection views are used to hide fields of a table (only projection).

Help views can be used as selection method in Search help.

Maintenance views permit you to maintain the data distributed on several tables for one application object at one time.

maintenance view


A maintenance view permits you to maintain the data of an application object together.
The maintenance status determines which accesses to the data of the underlying tables are possible with the maintenance view.

Maintenance Status



The maintenance status of a view controls whether data records can also be changed or inserted in the tables contained in the view.

The maintenance status can be defined as follows:
Read only: Data can only be read through the view.
Read, change, delete, insert: Data of the tables contained in the view can be
changed, deleted, and inserted through the view.
Read and change: Existing view entries can be changed. However, records
cannot be deleted or inserted.
Read and change (time-dependent views): Only entries whose non-time
dependent part of the key is the same as that of existing entries may be
inserted.

Restrictions for Maintenance View



There are some restrictions for selecting the secondary tables of a maintenance view or help view. The secondary tables have to be in an N:1 dependency to the primary table or directly preceding secondary table. This ensures that there is at most one dependent record in each of the secondary tables for a data record in the primary table.



reward if usefull

 

3 REPLIES 3

Former Member
0 Kudos

Hi,

In SE11, give ur view name. It should start with Z and click create. In the next dialog box select Maintenance view, In table <b>join condition</b> tab mention two tables and in <b>selection condition</b>tab give common keyfields in conditions. Finally save and activate it.

Message was edited by:

Sathyaa

Former Member
0 Kudos

You cannot SELECT from maintenance views.

Rob

Former Member
0 Kudos

Hi

Importance/Use of Views



Data for an application object is often distributed on several database tables. Database systems therefore provide you with a way of defining application-specific views on the data contained in several tables. These are called views.

Data from several tables can be combined in a meaningful way using a view (join). You can also hide information that is of no interest to you (projection) or only display those data records that satisfy certain conditions (selection).

A view is a logical view on one or more tables, that is, a view is not actually physically stored, instead being derived from one or more other tables.

The data of a view can be displayed exactly like the data of a table in the extended table maintenance.

Join, Projection and Selection



CROSS PRODUCT
Given two tables TABA and TABB. Table TABA has 2 entries and table TABB has 4 entries

Each record of TABA is first combined with each record of TABB. If a join condition is not defined, the cross product of tables TABA and TABB is displayed with the view.

Join condition
A join condition describes how the records of the two tables are connected.

Inner Join and Outer Join


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.)


Selection Conditions



Selection conditions that are used as a filter can be defined for a view.

Specifying these conditions under the Selection conditions tab when creating a view in the dictionary would have an effect which is similar to specifying a where clause when writing a select query to restrict data.

Projection

Sometimes some of the fields of the tables involved in a view are not of interest. The set of fields used in the view can be defined explicitly (projection). In our example, Field 4 is of no interest and can be hidden.

We specify the fields which we need to show in our view by including them under the view flds tab when creating a view in the dictionary.


View Types



Four different view types are supported. These differ in the way in which the view is implemented and in the methods permitted for accessing the view data .

Database views are implemented with an equivalent view on the database.

Projection views are used to hide fields of a table (only projection).

Help views can be used as selection method in Search help.

Maintenance views permit you to maintain the data distributed on several tables for one application object at one time.

maintenance view


A maintenance view permits you to maintain the data of an application object together.
The maintenance status determines which accesses to the data of the underlying tables are possible with the maintenance view.

Maintenance Status



The maintenance status of a view controls whether data records can also be changed or inserted in the tables contained in the view.

The maintenance status can be defined as follows:
Read only: Data can only be read through the view.
Read, change, delete, insert: Data of the tables contained in the view can be
changed, deleted, and inserted through the view.
Read and change: Existing view entries can be changed. However, records
cannot be deleted or inserted.
Read and change (time-dependent views): Only entries whose non-time
dependent part of the key is the same as that of existing entries may be
inserted.

Restrictions for Maintenance View



There are some restrictions for selecting the secondary tables of a maintenance view or help view. The secondary tables have to be in an N:1 dependency to the primary table or directly preceding secondary table. This ensures that there is at most one dependent record in each of the secondary tables for a data record in the primary table.



reward if usefull