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: 

How to creat views.

Former Member
0 Kudos

Hi all ,

Please give me full documentation on "How to creat views".If you have screen shot that will

be better for me.

my mail id is pankaj.sinhas@gmail.com.

Thanks and regards

Pankaj Sinha.

5 REPLIES 5

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.

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

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.

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.

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.

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.

Reward points

Former Member
0 Kudos

HI,

From Trasaction SE11 select View and click on create.

Then it gives you a pop-up asking wehter you want to create

Database view (Inner jOIN)

Maintanence view (OUTER JOIN)

Help View (OUTR JOIN)

Project view

Check this links,

Check the help on Database View

http://help.sap.com/saphelp_nw04/helpdata/en/36/74c0358373003ee10000009b38f839/frameset.htm

Help on Projection view

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed20446011d189700000e8322d00/frameset.htm

Help on Maintenace view.

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/frameset.htm

Help on Help view

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed13446011d189700000e8322d00/frameset.htm

Regards

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

There are lot many links in SDN as well as in google where u can get as much information as u want , so plzz check those things before posting.

if u hav any doubts then u can ask furthere.

Rgds

Reshma