2009 Oct 16 8:31 AM
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
2009 Oct 16 8:34 AM
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.
2009 Oct 16 8:37 AM
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
2009 Oct 16 8:41 AM
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
2009 Oct 16 8:49 AM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |