Application Development 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: 

left outer join using For All Entries

Former Member
0 Kudos

how to implement left outer join using for all entries In REPORTS.

6 REPLIES 6

Former Member
0 Kudos

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.

0 Kudos

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

matt
Active Contributor
0 Kudos

>

> FOR ALL ENTRIES is used in place of JOINS for performance reasons

THIS IS ABSOLUTELY INCORRECT Check the Performance forum for details.

matt

Former Member
0 Kudos

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

0 Kudos

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...

Former Member
0 Kudos

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..