04-22-2008 6:08 AM
Hi,
I have to join 4 tables with the single key.
Can i write my select querry like this.........
SELECT amatnr algort awerks aspmon amagbb awagbb aazubb aaagbb
bmaktx cekgrp dmbwbest dwbwbest
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ( ( ( s031 AS a
INNER JOIN makt AS b ON bmatnr = amatnr )
INNER JOIN marc AS c ON cmatnr = bmatnr )
INNER JOIN s032 AS d ON dwerks = cwerks ) WHERE a~matnr IN s_matnr.
Thanks in advance,
Regards,
kk.
04-22-2008 7:09 AM
Remove into corresponding fields addition in select statement...no problem with your code you can use ..
04-22-2008 7:09 AM
Remove into corresponding fields addition in select statement...no problem with your code you can use ..
04-22-2008 9:24 AM
you must decide whether it is a performance issue, run it, measure runtime (even counting is a measurement), if it is o.k., then it is no issue.
Depending on table sizes, I guess it will be an issue.
The 'into-corresponding' is peanuts, it is completely o.k.
The indexes are an issue.
FROM ( ( ( s031 AS a
INNER JOIN makt AS b ON b~matnr = a~matnr )
INNER JOIN marc AS c ON c~matnr = b~matnr )
INNER JOIN s032 AS d ON d~werks = c~werks ) WHERE a~matnr IN s_matnr.
makt has the language in the key, I guess you could specify it.
Maybe you also know the werks?
Make sure that the index with 'matnr' exists for s031, not only in the dictonary but on the database,
check SE11 and 'Indexes'.
I assume that it is much better to start with S032, then join S031, then MAKT, then MARC, use all
field from the key which are identical in the on-condition.
Siegfried