2006 Jun 22 4:38 PM
Everything was OK till I added last table MBEW for field d~bklas. The field BKLAS does exist in MBEW. Syntax error:wrong table or alias "D"...anybody?...Thank-You!
SELECT amatnr awerks amaabc adismm
b~maktx
cmtart cmatkl c~zzsasi_dept
czzsasi_dept czz_sasi_sub_dept c~zzpos1
czzpos1 czzpos2 czzpos3 czzpos4 c~zzpos5
d~bklas
INTO CORRESPONDING FIELDS OF TABLE t_outdata
FROM marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr
INNER JOIN mara AS c
ON amatnr = cmatnr
WHERE a~werks IN s_werks
inner join mbew as d
on amatnr = dmatnr
where d~bwkey in s_werks.
2006 Jun 22 4:41 PM
SELECT amatnr awerks amaabc adismm
b~maktx
cmtart cmatkl c~zzsasi_dept
czzsasi_dept czz_sasi_sub_dept c~zzpos1
czzpos1 czzpos2 czzpos3 czzpos4 c~zzpos5
d~bklas
INTO CORRESPONDING FIELDS OF TABLE t_outdata
FROM marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr
INNER JOIN mara AS c
ON amatnr = cmatnr
<b>inner join mbew as d
ON amatnr = dmatnr</b>
WHERE a~werks IN s_werks
where d~bwkey in s_werks.
2006 Jun 22 4:42 PM
Hi,
Check the where condition , it is written two times.
Laxman
2006 Jun 22 4:43 PM
Consolidate 2 WHERE statements in to one as mentioned.
Thanks,
2006 Jun 22 4:43 PM
Hi Tom,
Here is the modified query.
SELECT a~matnr a~werks a~maabc a~dismm
b~maktx
c~mtart c~matkl c~zzsasi_dept
c~zzsasi_dept c~zz_sasi_sub_dept c~zzpos1
c~zzpos1 c~zzpos2 c~zzpos3 c~zzpos4 c~zzpos5
d~bklas
INTO CORRESPONDING FIELDS OF TABLE t_outdata
FROM marc AS a INNER JOIN makt AS b
ON a~matnr = b~matnr
INNER JOIN mara AS c
ON a~matnr = c~matnr
inner join mbew as d
on a~matnr = d~matnr
WHERE a~werks IN s_werks
AND d~bwkey in s_werks.
<b>Reward points if it helps.</b>
2006 Jun 22 4:43 PM
You problem is not with that field, you can't have a WHERE condition in your join logic, it must be a the end.
select a~matnr a~werks a~maabc a~dismm
b~maktx
c~mtart c~matkl
c~zzsasi_dept
c~zzsasi_dept c~zz_sasi_sub_dept c~zzpos1
c~zzpos1 c~zzpos2 c~zzpos3 c~zzpos4 c~zzpos5
d~bklas
into corresponding fields of table t_outdata
from marc as a
inner join makt as b
on a~matnr = b~matnr
<b> inner join mara as c
on a~matnr = c~matnr</b>
inner join mbew as d
on a~matnr = d~matnr
where <b> a~werks in s_werks</b>
and d~bwkey in s_werks.
Regards,
Rich Heilman
2006 Jun 22 4:48 PM
hi,
SELECT a~matnr ...
b~maktx ..
c~mtart ..
d~bklas ..
INTO CORRESPONDING FIELDS OF TABLE t_outdata
FROM marc AS a
INNER JOIN makt AS b
ON amatnr = bmatnr
INNER JOIN mara AS c
ON amatnr = cmatnr
inner join mbew as d
on amatnr = dmatnr.
WHERE a~werks IN s_werks
and d~bwkey in s_werks.
Also, check this....
SELECT pcarrid pconnid ffldate bbookid
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ( ( spfli AS p
INNER JOIN sflight AS f ON pcarrid = fcarrid AND
pconnid = fconnid )
INNER JOIN sbook AS b ON bcarrid = fcarrid AND
bconnid = fconnid AND
bfldate = ffldate )
WHERE p~cityfrom = 'FRANKFURT' AND
p~cityto = 'NEW YORK' AND
fseatsmax > fseatsocc.
Regards,
Richa.
2006 Jun 22 4:56 PM
Hi,
Try this way..
SELECT a~matnr a~werks a~maabc a~dismm
b~maktx
c~mtart c~matkl c~zzsasi_dept
c~zzsasi_dept c~zz_sasi_sub_dept c~zzpos1
c~zzpos1 c~zzpos2 c~zzpos3 c~zzpos4 c~zzpos5
d~bklas
INTO CORRESPONDING FIELDS OF TABLE t_outdata
FROM marc AS a
INNER JOIN makt AS b
ON a~matnr = b~matnr
INNER JOIN mara AS c
ON a~matnr = c~matnr
INNER JOIN mbew AS d
ON d~matnr = c~matnr
WHERE a~werks IN s_werks
INNER JOIN mbew AS d
ON a~matnr = d~matnr
WHERE d~bwkey IN s_werks.
Regards
vijay
2006 Jun 22 5:14 PM
You are selection zzsasi_dept twice. That's not your error, but you might want to look into it.
Rob
2006 Jun 22 5:36 PM
hi tom,
SELECT amatnr awerks amaabc adismm
b~maktx
cmtart cmatkl c~zzsasi_dept
czzsasi_dept czz_sasi_sub_dept c~zzpos1
czzpos1 czzpos2 czzpos3 czzpos4 c~zzpos5
d~bklas
INTO CORRESPONDING FIELDS OF TABLE t_outdata
FROM marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr
INNER JOIN mara AS c
ON amatnr = cmatnr
inner join mbew as d
on amatnr = dmatnr
WHERE a~werks IN s_werks and
d~bwkey in s_werks.
hope this helps.
reward if helpful.
regards,
keerthi.
2006 Jun 22 5:40 PM
HI Tom
You have forgotten <b>ON</b> before mbew.
Regards,
Laxmi
2006 Jun 22 5:44 PM
Your correct code is as follows
SELECT a~matnr a~werks a~maabc a~dismm
b~maktx c~mtart c~matkl c~zzsasi_dept
c~zz_sasi_sub_dept c~zzpos1 c~zzpos2
c~zzpos3 c~zzpos4 c~zzpos5 d~bklas
INTO CORRESPONDING FIELDS OF TABLE t_outdata
FROM marc AS a INNER JOIN makt AS b ON a~matnr = b~matnr
INNER JOIN mara AS c ON a~matnr = c~matnr
INNER JOIN mbew AS d ON a~matnr = d~matnr
WHERE a~werks IN s_werks
AND d~bwkey IN s_werks.