Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SELECT TABLE

Former Member
0 Likes
682

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

5 REPLIES 5
Read only

Former Member
0 Likes
638

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.

Read only

Former Member
0 Likes
638

Hi,

Better go for FOR ALL ENTRIES.

Regards,

Vishvesh

Read only

Former Member
0 Likes
638

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

Read only

Former Member
0 Likes
638

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

Read only

Former Member
0 Likes
638

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