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 - join or for all entries

Former Member
0 Likes
1,516

HI,

what is the better way to get information out of a Table with a join combination of a second table(with same keyfields).

example: Table EDIDC / EDID4, keyfield = docnum.

lt_edidc contains a lot of IDoc numbers and I need the IDoc Data for all entries in lt_edidc.

should i use:

select ... from lt_edid4 ... for all entries in lt_edidc

or

select with join lt_edidc and lt_edid4 ?

Thanks,

Gordon

HI,

what is the better way to get information out of a Table with a join combination of a second table(with same keyfields).

example: Table EDIDC / EDID4, keyfield = docnum.

lt_edidc contains a lot of IDoc numbers and I need the IDoc Data for all entries in lt_edidc.

should i use:

select ... from lt_edid4 ... for all entries in lt_edidc

or

select with join lt_edidc and lt_edid4 ?

Thanks,

Gordon

9 REPLIES 9
Read only

Former Member
0 Likes
1,338

HI,

Use a join better performance and also using for all entires can lead to problems if the internal table is empty and is not caught before executing the select statement.

Regards

Carl

Read only

Former Member
0 Likes
1,338

Hi,

Its depends on situation whcih is better performancewise.

If you have matching keyfields in both of the table you can go for JOIN if the records are not huge in that tables.

but if the data is huge better use For all entries in itab.In this case you should have matching fields in both the tables.

When you are using all entries make sure that there are no duplicates records in that internal tables and you have used the condition for second select

if itab1 is not initial.

endif.

Read only

Former Member
0 Likes
1,338

Performance wise " for all entries."

Rhea.

Read only

Former Member
0 Likes
1,338

Hi,

For all entries is better than joining.

You can just compare the performance in 'Tips & Tricks' of SE30.

Better idea, write in both the ways and check it out.

Regards,

R.Nagarajan.

Read only

Former Member
0 Likes
1,338

I think FOR ALL ENTRIES is better in this case.

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,338

I would go for the JOIN... JOIN conditions will be based on key fields, so this should be ok.

(everyone who is telling that FOR ALL ENTRIES is better performance wise, are simply wrong)

Read only

0 Likes
1,338

ohh,

EDIDC and EDID4 are not allowed for join statements because of pool / cluster tables.

I think i have to use for all entries.

Read only

0 Likes
1,338

hi

for all entries it should be follows some prerequisites.

so for all entries is better performance than using innerjoins

r

Read only

ThomasZloch
Active Contributor
1,338

Hi folks, EDID4 is a cluster table, so a join does not work here. One of the very few cases where "for all entries" is the way to go.

Cheers

Thomas