2007 May 08 8:29 AM
I need to join MARA and MSEG as inner join on mara-matnr = mseg-matnr.
However matnr is not a key field in mseg.The query is shown below.
from mkpf AS a
inner join mseg as b
on amandt = bmandt
and amblnr = bmblnr
and amjahr = bmjahr
inner join mara as c
on cmatnr = bmatnr
Is this query alright, specially cmatnr = bmatnr. Thanks.
2007 May 08 8:42 AM
Yeah you can filter out even if it not a key field....
Regards,
Jayant..
2007 May 08 8:30 AM
2007 May 08 8:33 AM
2007 May 08 8:30 AM
2007 May 08 8:32 AM
Hi SV,
Refer this code :
SELECT amatnr amEINS AMTART DMAKTx bwerks clgort
c~labst INTO CORRESPONDING FIELDS OF TABLE IT_MATERIAL
FROM mara AS a
INNER JOIN MAKT AS D on amatnr = dmatnr
inner join marc AS b
ON amatnr = bmatnr
inner join MARD as c
ON BMATNR = CMATNR AND BWERKS = CWERKS
where AMATNR IN S_MATNR and bwerks in s_werks.
Reward points if helpful.
Regards,
Hemant
2007 May 08 8:36 AM
It will work fine ...
for joins, it is not must to be a key field, but recommended...
2007 May 08 8:42 AM
Yeah you can filter out even if it not a key field....
Regards,
Jayant..