02-05-2010 9:15 AM
how to implement left outer join using for all entries In REPORTS.
02-05-2010 9:34 AM
Hi
FOR ALL ENTRIES is used in place of JOINS for performance reasons
As far as I know ther is no separate option in for all entries for left outer join.
If you want to achieve left outer join resulset, then you will have to specify the
where conditions in FOR ALL ENTRIES so that it will give you that resultset.
02-05-2010 9:43 AM
let me ellaborate
in table1 ,there are 2 enties ,X ,Y
in table2, there are 3 entries corresponding to X.no entry for Y.
if i use
select * from table2 for all entries in table1 into table itab
i get only 3 rows in the ITAB.but i want entry Y with null values in other field.I mean 4 rows.
How can we do this.
Plz explain.
Edited by: raghunandan mj on Feb 5, 2010 11:04 AM
02-05-2010 10:09 AM
>
> FOR ALL ENTRIES is used in place of JOINS for performance reasons
THIS IS ABSOLUTELY INCORRECT Check the Performance forum for details.
matt
02-05-2010 10:14 AM
Hi,
You cannot use For all Entries for the left outer joins as
they can be used in place of Inner Joins that is so as to
avoid Multiple number of inner joins we can use for all entries.
Hope it helps
Regards
Mansi
02-05-2010 10:57 AM
hi Mansi,
this is how i populate
SELECT VGBEL LFIMG POSNR VBELN FROM LIPS INTO TABLE IT_delv FOR ALL ENTRIES IN IT_VBAP WHERE VGBEL = IT_VBAP-VBELN.
LOOP AT IT_delv INTO WA_delv.
WA_FINAL-VBELN_1 = WA_DELV-VBELN_1.
WA_FINAL-LFDAT = WA_DELV-LFDAT.
WA_FINAL-LFIMG = WA_DELV-LFIMG.
WA_FINAL-POSNR2 = WA_DELV-POSNR2..
APPEND WA_FINAL TO IT_FINAL.
CLEAR: WA_FINAL , WA_delv.
ENDLOOP.
LOOP AT IT_FINAL INTO WA_FINAL.
READ TABLE IT_vbap INTO WA_vbap WITH KEY VGBEL = WA_FINAL-VBELN.
WA_FINAL-VBELN = WA_VBAP-VBELN.
WA_FINAL-MATNR = WA_VBAP-MATNR.
WA_FINAL-KWMENG = WA_VBAP-KWMENG.
WA_FINAL-NETWR = WA_VBAP-NETWR.
MODIFY IT_FINAL FROM WA_FINAL.
ENDLOOP.
My question is , it_vbap has 5 five records A,B,C,D,E.
in it_delv ,there are 20 record corrresponding to A,B,D of IT_VBAP.
in final table i wont get info of recors B,E. I want those info also in final table ..how can i do that...
02-05-2010 10:17 AM
performance is a different case... it not correct to say which one is the best in every situation...
check this thread for details...
and any ways...
please be clear with your requirements... if you are using joins then why for all entries are needed??
and i guess you want to use a tables content to compare during join of another two tables.. in that case.. you can create a range table for that particular field and pass the value from your internal table to this range table...
and while writing the join you can use like : vblen in GT_VBELN --> this being a range table..
but 1 more constraint is this range table should not contain more than 5K records..