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: 

Creation of Views

Former Member
0 Kudos

Hai Experts,

I'm new to the ABAP development area. I am learning about tables, buffers etc. And now i want to know about Views and the creation of Views. So can anybody give me the steps involved in the creation of views?

Regards,

P.Shanthi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

10 REPLIES 10

Former Member
0 Kudos

Hi,

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.

Check this links,

https://forums.sdn.sap.com/click.jspa?searchID=3584914&messageID=1810591

Regards,

Priyanka.

Former Member
0 Kudos

hi,

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.

Creating Database View:

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed06446011d189700000e8322d00/content.htm

Creating Projection View:

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecc5446011d189700000e8322d00/frameset.htm

Creating Help View:

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecd2446011d189700000e8322d00/frameset.htm

Creating maintenance View:

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecdf446011d189700000e8322d00/frameset.htm

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

Rgds

Reshma

Former Member
0 Kudos

Creating a Maintenance View

http://help.sap.com/saphelp_40b/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/5a/0c88924d5911d2a5fb0000e82deaaa/content.htm

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abap+dictionary&focusedcommentid=39861

Enter the name of the view in the initial screen of the ABAP Dictionary, select object class Views and choose Create. A dialog box appears, in which you must choose the type of the view. Select the type Maintenance view.

The maintenance screen for maintenance views appears. You will see three input areas for tables, join conditions and view fields. Carry out the following actions in this screen:

Enter a short explanatory text in the field Short text.

In Tables, enter the primary tables of the view.

If required, include more tables in the view. In a help view you can only include tables which are linked to one another with foreign keys.

Position the cursor on the primary table and choose Relationships. All existing foreign key relationships of the primary table are displayed. Check the foreign keys you require and choose Copy. The secondary tables involved in such a foreign key are included in the view. The join conditions derived from the foreign keys ( Foreign Key Relationship and Join Condition) are displayed.

You can also include tables which are linked to one of the previously included secondary tables with a foreign key. To do this, position the cursor on the secondary table and choose Relationships. Then proceed as described above.

You can only select foreign keys in which the secondary table for the primary table or for the secondary table which transitively preceded it is in an n:1 relationship. This is the case if the secondary table is the check table of the base table and the foreign key was not defined generically. If the base table is the check table, the foreign key fields must be key fields of a text table or the foreign key must have cardinality of n:1 or n:C.

The foreign keys violating these conditions are displayed at the end of the list under the header Relationships with unsuitable cardinality.

Select the fields which you want to include in the view.

You can enter the field names directly. If you do not know the field names, you can copy them from the tables. To do this, position the cursor on a table and choose TabFields. The fields of the table are now displayed in a dialog box. You can copy fields from here by marking the first column and choosing on Copy.

Formulate the selection conditions. To do this choose Goto ® Selection condition. The input area for the selection conditions appears in place of the input areas for the fields. Maintain the selection condition as described in Maintaining the Selection Condition for a View. You can then switch back to the fields display with Goto ® View fields.

Activate the view with View ® Activate. A log is written during activation. You can display it with Utilities ® Activation log. If errors or warnings occurred during the activation of the view, you branch directly to the activation log.

Create the documentation for the view with Goto ® Documentation. This documentation is output for example when you print the view with View ® Print.

Branch to transaction SE54 with Environment ® Tab.maint.generator. From the view definition you can generate maintenance modules and maintenance interfaces there which distribute the data entered with the view to the base tables. You can find more information about using this transaction in the documentation Generating the Table Maintenance Dialog.

Optional Settings

You can make the following optional settings:

Change data element of a view field:

Select the Mod column (modify) for the view field and choose Enter. The Data element field is now ready for input. Enter the new data element there. This data element must refer to the same domain as the original data element. With the F4 help key for the Data element field, you can display all the data elements which refer to the domain of the field. If you want to assign the original data element again, you only have to reset the Mod flag and choose Enter.

Change maintenance status:

The Maintenance Status defines how you can access the view data with the standard maintenance transaction (SM30). Choose Extras ® Maintenance status. A dialog box appears in which you can select the maintenance status of the view.

Define the delivery class of the view:

Choose Extras ® Delivery class. A dialog box appears in which you can enter the delivery class of the maintenance view.

Define the maintenance attribute of a view field

The maintenance attribute defines special access modes for the fields of the view. You can make the following entries in field F in the input area for the view fields:

R : Only purely read accesses are permitted for fields with this flag. Maintenance with transaction SM30 is not possible for such fields.

S : Fields with this flag are used to create subsets when maintaining view data. Only a subset of the data is displayed. This subset is defined by entering the corresponding value in this field.

H : Fields with this flag are hidden from the user during online maintenance. They do not appear on the maintenance screen. You have to ensure in a separate procedure that each such field has the correct contents. Otherwise, they are left empty.

: There are no restrictions on field maintenance.

Check functions:

With Extras ® Runtime object ® Check you can determine whether the definition of the view in the ABAP Dictionary maintenance is identical to the specifications in the runtime object of the view. With Extras ® Runtime object ® Display you can display the runtime object of the view.

Display foreign key of a view field:

If a foreign key which was automatically included in the view definition is defined for the field of the base table, you can display it. To do so, position the cursor on the view field and choose Extras ® Foreign keys.

Display foreign key on which a join condition is based:

If a join condition was derived from a foreign key, you can display its definition. To do so, position the cursor on the join condition and choose Extras ® Foreign keys.

See also:

Maintenance Views

Former Member
0 Kudos
" Using table buffering

Use of buffered tables is recommended to improve the performance considerably. The buffer is bypassed while using the following statements

1.Select distinct

2.Select … for update

3.Order by, group by, having clause

4.Joins

Use the Bypass buffer addition to the select clause in order to explicitly bypass the buffer while selecting the data.

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

<b>Not recommended</b>

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

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

Endselect.

<b>Recommended</b>

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

Endselect.

<b>What is the Different Types and Usage of Views

This is often asked in an interview about the types of views:</b>

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.

Reward points if it is usefull .....

Girish

Former Member
0 Kudos

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

Former Member
0 Kudos

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. The maintenance status determines which accesses to the data of the underlying tables are possible with the maintenance view.

database view

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.

help views

Help views are used if a view with an outer join is needed as selection method in a search help.

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.

Former Member
0 Kudos

Hi Shanti,

Check this thread:

Regards,

Chandra Sekhar

Former Member
0 Kudos

Hi Shanthi,

View:

Projection let u hide field of only one table

you can use views for a number of reasons in abap

database views can be used in the same way as tables.

Maintenance views can be used for generating different maintaining in sm30 for your table..

there are four options in maintainnec views like :-

read only

read and change

read ,change, delete and insert

read and change(time-specific)

help views are used for search helps.

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

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

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

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

Database views should be created if want to select logically connected data from different tables simultaneously.

Database views implement an inner join.

Application programs can access the data of a database view using the database interface. (Just as we write select queries on database tables, we can write them for views as well.)

Includes in Database Views

An entire table can be included in a database view. In this case all the fields of the included table will become fields of the view (whereby you can explicitly exclude certain fields).

To include one of the tables in the view, enter character * in field View field, the name of the table to be included in field Table and character * again in field Field name on the View fields tab page of the maintenance screen of the view.

You can also exclude individual fields of an included table. If you do not want to include a field of the included table in the view, enter - in field View field, the name of the included table in field Table and the name of the field to be excluded in field Field name.

Inserts with Database Views

If a database view contains only one single table, data can be inserted in this table with the view .

You have the following options for the contents of the table fields not contained in the view:

If the field is defined on the database with NOT NULL as initial value, the field is filled with the corresponding initial value.

If the field is defined on the database as NOT NULL without initial value, an insert is not possible. This results in a database error.

If the field is not defined on the database as NOT NULL, there will be a NULL value in this field.

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.

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.

Maintenance View (SE54)

You can use a maintenance view to maintain data, which is distributed over several tables, at the same time.

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.

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

regards,

Ranveer.

Former Member
0 Kudos

select se11

then view option

nmae the view

start to create

select data base view

enter

maintainshort text

maintain data base tables used for view

maintain join condition available between two tables

select view fields

save

select utilities

select contents

execute(f8)