‎2007 Aug 07 10:31 AM
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
‎2007 Aug 07 10:36 AM
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
‎2007 Aug 07 10:34 AM
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
‎2007 Aug 07 10:36 AM
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