‎2007 Aug 08 9:23 AM
i have six tables ekko, ekpo,ekkn,eskl,eskl,lfa1
and i user for inner join first three table taking ebeln
and another three table how should i write the select statement
points will awarded,help
‎2007 Aug 08 9:31 AM
first chk ekko, ekpo,ekkn,eskl,eskl,lfa1
following table primary key .
afer using inner join syntax.
exaple
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.
try this.
‎2007 Aug 08 9:35 AM
‎2007 Aug 08 9:47 AM
Hi Suresh,
It is not at all advisable to use inner joins on 6 tables.this will create a lot of performance problems.
You better go for 'for all entries' .
join ekko and ekkn first on ebeln.(these being the header tables)
then you can go with for all entries using entries from above.
Hope that helps.
Reward points if useful.
Harmeet
‎2007 Aug 08 10:12 AM
Hi,
the following link has the relationship betwen the various tables in MM module.. this link will be able to help you find the link between the tables u specified
http://www.erpgenie.com/abap/tables_mm.htm
Regards,
Aparna
‎2007 Aug 08 10:13 AM
check this:
First do inner join on ekko and ekpo.
on ekkoebeln = ekpoebeln into itab
secondly, select * from ekkn .....use for all entries in itab
where ebeln = itab-ebeln and ebelp = itab-ebelp.
third, select * from eskn....for all entries in itab
where zekkn = itab-zekkn (eskn-zekkn = ekkn-zekkn)
fourt, select * from eskl........for all entries in itab
where packno = itab-packno (eskl-packno = eskn-packno)
fifth, select * from lfa1........for all entries in itab
where lifnr = itab-lifnr (lfa1-lifnr = ekko-lifnr)
reward if useful
anju