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: 

DB View on MSEG , AFPO and AFKO

Former Member
0 Kudos

I want to create a view based on the following conditions between tables - MKPF , MSEG , AFPO , AFKO

CONDITION -

1. Get the date based on the movement types ( tables mkpf and mseg )

2.I NEED TO LINK SALES ORDER AND SALES ORDER LINE ITEM field FROM MSEG and AFPO.

3. THEN AFTER DETERMINING THE PO FROM THE ABOVE CONDITION , LINK THE Production Order (AFPO) TO AFKO TABLE.

HOW CAN THIS BE DONE. PLZ HELP MATTER URGENT.

2 REPLIES 2

Former Member
0 Kudos

Hi

Take the EBELN and EBLP fields from MSEG table

which are PO no and Item

pass them to EKKN table and take the VBELN and POSNR fields from it which are SALES ORDER and ITEM number

and pass this VBELN to AFPO and take the AUFNR field

Regards

Anji

Former Member
0 Kudos

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>