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

why should we select all key fields when using for all entries

Former Member
0 Likes
3,416

Hi,

Why should we select all key fields in our select query when using for all entries statement?

I read about for all entries but this point was not clear in any post.

Please explain me

Regards,

Subhashini

Hi,

Why should we select all key fields in our select query when using for all entries statement?

I read about for all entries but this point was not clear in any post.

Please explain me

Regards,

Subhashini

4 REPLIES 4
Read only

Former Member
0 Likes
1,396

there is no restriction that we should use all key fields while using for all entries.Like any other select statement ,using all key fields will increase the performance of the select statement.

Read only

0 Likes
1,396

Hi,

We can increase the performance by using key fields in where condition but why should we select all key fields.

I mean how duplicate entries will not get deleted when we use this?

Regards,

Subhashini

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,396

Dear Subhasini,

It is because FOR ALL ENTRIES deletes the duplicate entries before populating the target internal table.

Please do an F1 on FOR ALL ENTRIES & read the SAP documentation.

I mean how duplicate entries will not get deleted when we use this?

Quite simple, if you select all key fields then each entry will be unique & there will not be any duplicate entries to delete !!

BR,

Suhas

Edited by: Suhas Saha on Oct 16, 2009 9:41 AM

Read only

Former Member
0 Likes
1,396

Hi Subhasini,

as suhas has already explained... FAE (for all entries) will delete the duplicate entries...

from the help itself:

> The result set of the SELECT statement is the union of the individual selections for each line of the internal table. Duplicate lines

>are automatically eliminated from the result set.

so.. is the need of including all the key elements for no duplication