2006 Sep 25 11:17 AM
Hi friends,
i want the correct syntax of the following query
SELECT ABEDAT AEBELN Bmatkl BWERKS BMATNR BTXZ01 ARESWK BMENGE B~EBELP
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM EKKO AS A INNER JOIN EKPO AS B ON AEBELN = BEBELN
WHERE a~reswk IN SUP_PLNT
and A~BEDAT IN STO_DATE
AND B~MATKL IN mat_grp
AND B~MATNR IN MAT_CODE
AND A~BSART = 'KRUB'.
thanks & regards
vallamuthu.M
2006 Sep 25 11:22 AM
The code looks to be fine..are you getting any error ??
Secondly, you specified the topic for Outer join and ur code is for inner join ..can you please give the exact issue.
2006 Sep 25 11:22 AM
The code looks to be fine..are you getting any error ??
Secondly, you specified the topic for Outer join and ur code is for inner join ..can you please give the exact issue.
2006 Sep 25 11:25 AM
HI,
SORRY, THE BELOW QUERY IS THE CORRECT QUERY PLEASE HELP ME.
SELECT ABEDAT AEBELN Bmatkl BWERKS BMATNR BTXZ01 ARESWK BMENGE B~EBELP
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM EKKO LEFT OUTER JOIN EKPO ON AEBELN = BEBELN
WHERE a~reswk IN SUP_PLNT
and A~BEDAT IN STO_DATE
AND B~MATKL IN mat_grp
AND B~MATNR IN MAT_CODE
AND A~BSART = 'KRUB'.
2006 Sep 25 11:28 AM
U cannot use filters for fields from the right table..In your case EKPO.
So if you <b>take out the filters for maktl and matnr</b> it should work...surely you can apply the same filter later on to the internal table.
2006 Sep 25 11:33 AM
Hi,
Just change the bold code and check.
SELECT ABEDAT AEBELN Bmatkl BWERKS BMATNR BTXZ01 ARESWK BMENGE B~EBELP
INTO CORRESPONDING FIELDS OF TABLE ITAB
<b>FROM EKKO as A LEFT OUTER JOIN EKPO as B</b> ON AEBELN = BEBELN
WHERE a~reswk IN SUP_PLNT
and A~BEDAT IN STO_DATE
AND B~MATKL IN mat_grp
AND B~MATNR IN MAT_CODE
AND A~BSART = 'KRUB'.
Hope this helps.