‎2007 Aug 06 2:04 PM
Hi,
i had written the code as follows:
loop at it_rkwa.
select ekorg ekgrp
from eine as a
inner join eine as b on ainfnr = binfnr
where
matnr = it_rkwa-matnr_rkwa
and lifnr = it_rkwa-lifnr_rkwa.
endif.
append it_rkwa.
clear it_rkwa.
endloop.
when i check it for syntax for consistency it throws me the following error:
"the column name 'EKORG ' has two meanings: ABAP/4 open SQL statement "
Can any body here tell me what could be the problem?
Thanks,
Ravi
‎2007 Aug 06 2:06 PM
You are doing an INNER JOIN on the same table
from eine as a
inner join eine as b
INNER JOINs are for joining different tables not the same table.
‎2007 Aug 06 2:07 PM
loop at it_rkwa.
select <b>aekorg aekgrp</b>
from eine as a
inner join eine as b on ainfnr = binfnr
where
matnr = it_rkwa-matnr_rkwa
and lifnr = it_rkwa-lifnr_rkwa.
endif.
append it_rkwa.
clear it_rkwa.
endloop.
Please modify the code in the high lighted part.
Regards,
Pavan
‎2007 Aug 06 2:07 PM
‎2007 Aug 06 2:08 PM
Re-write your code as below.
if not it_rkwa[] is initial.
select ekorg ekgrp
from eine
into corresponding fields of table it_rkwa2
for all entries in it_rkwa
where matnr = it_rkwa-matnr_rkwa
and lifnr = it_rkwa-lifnr_rkwa.
endif.Please mark points if the solution was useful.
Regards,
Manoj
‎2007 Aug 06 2:08 PM
‎2007 Aug 06 2:11 PM
Hi,
y r u joining the same table...??
We will generally get that error because when we are joining two tables and writing a condition on particular field which is PRESENT in both the tables then it will be giving that error. To avoid that we can use the Aliases i.e
select aekorg aekgrp ... .
if it helps dont forget the REWARD.
rgds
harris
‎2007 Aug 06 2:13 PM
Hi,
eine inner join eine is meaning less.use like this.
select ekorg ekgrp into wa from eine where where
matnr = it_rkwa-matnr_rkwa
and lifnr = it_rkwa-lifnr_rkwa.
endselect.
rgds,
bharat.