https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenwhere_logexp_itab.htmЦитата:
Notes
◾The same internal table can be specified after FOR ALL ENTRIES and after INTO. The content of the table is evaluated by FOR ALL ENTRIES and then overwritten by the INTO clause.
◾A comparison with a column of an internal table can also be performed using the WHERE condition of a subquery for the same data source.
◾With respect to rows occurring more than once in the results set, the addition FOR ALL ENTRIES has the same effect as when the addition DISTINCT is specified in the definition of the selection set. Unlike DISTINCT, the rows are not always deleted from the database system but instead are sometimes first deleted from the results set on the application server. The duplicate rows are then removed from the database system if the SELECT statement can be passed to the database system as a single SQL statement. The addition DISTINCT is supported here. If the SELECT statement needs to be distributed to multiple SQL statements before it is passed or if columns of the types STRING and RAWSTRING plus LCHR and LRAW are specified in the SELECT list, the rows are aggregated on the application server.
◾If duplicate rows are first removed from the application server, all rows specified by the WHERE condition (in some cases) are passed to an internal system table and then aggregated. The maximum size of this system table is restricted to that of normal internal tables. More specifically, the system table is always required if one of the additions PACKAGE SIZE or UP TO, OFFSET is used simultaneously. These then have no effect on the number of rows passed from the database server to the application server, but are only used when the rows are passed from the system table to the actual target area. If the maximum size of the internal system table is exceeded, a runtime error occurs.
◾The addition FOR ALL ENTRIES bypasses table buffering for tables with generic buffering if the condition after FOR ALL ENTRIES prevents a single generic area from being specified exactly.
In all other cases, table buffering is used and the addition FOR ALL ENTRIES can be a more efficient alternative to join expressions. ◾Before using an internal table itab after FOR ALL ENTRIES, always check that the internal table is not initial. In an initial internal tables, all rows are read from the database regardless of any further conditions specified after WHERE. This is not usually the required behavior.
◾If the full WHERE condition is ignored because the internal table itab is empty, the implicit WHERE condition for the current client or the client specified using USING CLIENT is not affected (if automatic client handling is switched on). This means that all data is only read from the current client. If automatic client handling is switched off using CLIENT SPECIFIED, no implicit WHERE condition exists for the client. Any WHERE condition specified explicitly for the client column is ignored with the full condition if the internal table itab is empty and the data from all clients is read.
◾If, in a strict mode of the syntax check, FOR ALL ENTRIES is specified together with columns of the types STRING and RAWSTRING plus LCHR and LRAW in the SELECT list, the syntax check is executed in strict mode from Release 7.52.