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

regarding databaseview

Former Member
0 Likes
363

hi experts,

i have developed a database view to replace inner join in my program,,,but its not giving proper output ,,plz help me to solve this,,,here is my select statement and views. fields which i decalared in view fields......

*this is my select statement in my program::

select mard~matnr

mard~werks

mard~lgort

mard~labst

mard~insme

mard~speme

mard~einme

mard~retme

mseg~lifnr

into

table itab_final from mard inner join mseg on

mard~matnr =

msegmatnr where mardmatnr in matnr and mard~werks = s_werks.

in my views in tab join condition i given:::

MARD MANDT = MSEG MANDT

MARD MATNR = MSEG MATNR

in tab views fields::

MANDT MARD MANDT

MATNR MARD MATNR

WERKS MARD WERKS

LGORT MARD LGORT

LABST MARD LABST

INSME MARD INSME

SPEME MARD SPEME

EINME MARD EINME

RETME MARD RETME

LIFNR MSEG LIFNR

MBLNR MSEG MBLNR

MJAHR MSEG MJAHR

ZEILE MSEG ZEILE

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
341

Hi

It is not advisable to fetch data from MSEG based on MATNR field of MARD

in real time we won't use like that

Better create view for the related tables like MARA,MARC,MARD etc

or MKPF and MSEG tablesand then fetch the data from them

as such MSEG will have lot of data and it takes time to fetch data from it using MBLNR, EBELN and EBELP fields

if you use MATNR it takes time and not advisable

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

Regards

Anji

2 REPLIES 2
Read only

Former Member
0 Likes
341

Hi Ravi,

Just a question : you wrote <b>mard~werks = s_werks</b>

Is s_werks a SELECT-OPTIONS ?

In this case, you have to you IN operator.

Mathieu

Read only

Former Member
0 Likes
342

Hi

It is not advisable to fetch data from MSEG based on MATNR field of MARD

in real time we won't use like that

Better create view for the related tables like MARA,MARC,MARD etc

or MKPF and MSEG tablesand then fetch the data from them

as such MSEG will have lot of data and it takes time to fetch data from it using MBLNR, EBELN and EBELP fields

if you use MATNR it takes time and not advisable

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

Regards

Anji