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: 

abap general

Former Member
0 Kudos
149

what is the use of making views in real time

1 ACCEPTED SOLUTION

Former Member
0 Kudos
123

This message was moderated.

5 REPLIES 5

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
123

Hi,

The use is the VIEWS are created in the underlying database table and you need not use a JOIN and ask for a dynamic view creation.

Also you can have buffering for the VIEWS.

With the help of different types of views you can maintain the data using table maintenance generator you can insert into multiple database tables at once.

Regards,

Sesh

Former Member
0 Kudos
123

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.

Please have a look at below link. It will help you.

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

for more detailed info look on:

http://www.sap-img.com/abap/what-is-the-different-types-and-usage-of-views.htm

&

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

Former Member
0 Kudos
123

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.

reward points if it is usefull.....

Girish

Former Member
0 Kudos
123

Hi

Instead of writing Select statements to multiple tables if we have all tables data together in a View we will write a single select to that view and fetch the complete data into a single Internal table and use

see for example a view called

VIAUFKS

it has got 4 tables

AFIH

AUFK

AFKO

ILOA

so to fetch data from those 4 tables we need to write 4 select statments or some joins

instead of that we can write a single select to the above VIEW and fetch the data in a straight way and use.

Hope you understood it.

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos
124

This message was moderated.