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

Hi

Former Member
0 Likes
589

Hi to all,

Hear I am having two views from these views How i will retrive the data depending upon the condiations, the views are having some fields from vbep and vbak

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
568

Hi

If they are DATABASE VIEWS you can fetch the data from them like how you fetch data from the Transparent tables only using the SELECT statements

by using the key fields joiing from both like VBELN and POSNR

Reward if useful

Anji

6 REPLIES 6
Read only

Former Member
0 Likes
569

Hi

If they are DATABASE VIEWS you can fetch the data from them like how you fetch data from the Transparent tables only using the SELECT statements

by using the key fields joiing from both like VBELN and POSNR

Reward if useful

Anji

Read only

Former Member
0 Likes
568

Hi,

If u are asking about the coding, u can simply write normal selects in ur code on the views and it will give u the data.

for extracting the data from two views having some key fields in common, u can use Joins on the two views.

Regards,

Himanshu

Read only

Former Member
0 Likes
568

Hi

<b>Importance/Use of Views</b>

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.

<b>Join, Projection and Selection </b>

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.

<b>Join condition</b>

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

<b>Inner Join and Outer Join </b>

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

The data that can be selected with a view depends primarily on whether the view implements an inner join or an outer join.

<b>Projection</b>

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.

<b>Selection Conditions</b>

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.

<b>Reward if usefull</b>

Read only

Former Member
0 Likes
568

Give the syntax how to retrive data and stored into an internal table

Read only

0 Likes
568

Hi

selecting from view in this case and selecting from table is same.Because in this view, the data is only selected from t880 table.

<b>Reward if useful</b>

Read only

0 Likes
568

Hi,

Select amatnr amtart bwerks into corresponding fields of table itab from mara as a join marc as b on amatnr = bmatnr where amatnr in s_matnr and b~werks in s_werks.

Here in place of Mara and Marc u can use ur views and the S_matnr and s_werks are the select options defined in ur code.

Hope it helps.

Please reward points for useful answers.

Regards,

Himanshu.