Application Development and Automation 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: 
Read only

VIEW created from two tables

Former Member
0 Likes
1,088

hi,

i have created a view between two tables.

1. i want to know whether will i get the upto date data if i fetch data from the view.?

2. Does view fetch data from table every time when it is used or it stores it in buffer or something like that.? If it fetches every time ,then what is the advantage over accessing tables directly using joins?

pls help

hi,

i have created a view between two tables.

1. i want to know whether will i get the upto date data if i fetch data from the view.?

2. Does view fetch data from table every time when it is used or it stores it in buffer or something like that.? If it fetches every time ,then what is the advantage over accessing tables directly using joins?

pls help

6 REPLIES 6
Read only

Former Member
0 Likes
929

This is exactly like a join.

A view is a dynamic structure/table filled only at runtime !

This is a projection on 2 or more tables...

If you want a progammaticaly opinion, it's better using a Join, because you won't be able to create a View each time you need to join tables

Hope this helps,

Erwan

Message was edited by:

Erwan LE BRUN

Read only

0 Likes
929

hi erwan,

i used join(mseg and Mkpf) but it takes much time as i have only non key fields(werks) in where clause when i run for whole plant.

at this situation what would you suggest?

Read only

0 Likes
929

Hi Saravanan,

The global views defined in SE11 are fastest and right approach to fetch the records from more than one table. And to reduce the fetch time you can narrow down your query by including more fields.

Even joins are faster then accessing tables individually but views are reusable plus a bit more faster than joins.

Hope this helps.

P.S. rewards points if replies are helpful.

Read only

Former Member
0 Likes
929

Hi,

When you create the view, a buffer will be created for that view, so first time when you access the view then the data will be there in the buffer, so when you retrive the data second time then it will be fetch the data from buffer. so it is bettwe to use the Join instead of the views

Regards

Sudheer

Read only

Former Member
0 Likes
929

Hi ,

Views are database objects .

There are four types of views .

1) Data Base .

2) Projection

3) Help .

4) Maintenance

Views have advantage over joins is View can be used many number of times as it is data base object . according to our business logic we will create view which can be used when that business logic is required .

you can get upto Date data in views using bypassing buffer addition in select statement

Read only

Former Member
0 Likes
929

Hi Saravanan,

Views are definitely advantageous. And you can use views over joins.

But remember that just like joins, views using 3 or more tables can be slightly slow.

The view doesnt store any data on its own. A view is only a logical join.

And it does make use of the DB buffers already defined.

May be, you need to check if you have defined your view correctly. Check your view join conditions.

Hope this answers ur question. Reward points if it does.

Rgds,

Prashanth.

SAP.