2007 Jul 03 1:45 PM
Hi
I have three tables that i want link. I want to return values from table ISEG even if data does not exist in MSEG and MKPF.
Currently no data are returned when data in mkpf does not exists. I've joined mseg and mkpf with a inner join.
SELECT a~matnr a~werks SUM( a~menge ) SUM( a~buchm ) SUM( b~menge )
INTO TABLE wa_outtab
FROM iseg AS a
LEFT OUTER JOIN mseg AS b
ON b~matnr = a~matnr
INNER JOIN mkpf AS c
ON c~mblnr = b~mblnr AND
c~mjahr = b~mjahr AND
c~bldat >= idate-low AND
c~bldat <= idate-high
WHERE
a~iblnr IN iblnr
GROUP BY a~matnr a~werks .
2007 Jul 03 1:51 PM
Hi
Your statement will do an LEFT OUTER JOIN between iseg and mseg then it will do the INNER JOIN between the above result set and mkpf table.
that is why you are not able to get values when there is no data exists in mkpf.
try to rearrange the tables as below:
mseg INNER JOIN mkpf RIGHT OUTER JOIN iseg.
or split the join.
Thanks
Srini
2007 Jul 03 1:51 PM
Hi
Your statement will do an LEFT OUTER JOIN between iseg and mseg then it will do the INNER JOIN between the above result set and mkpf table.
that is why you are not able to get values when there is no data exists in mkpf.
try to rearrange the tables as below:
mseg INNER JOIN mkpf RIGHT OUTER JOIN iseg.
or split the join.
Thanks
Srini