How to remediate: Missing FOR ALL ENTRIES guard
FOR ALL ENTRIES IN without an initial-table check returns the full table when the driver table is empty.
Is this issue in your codebase?
A1 scans all 30 rules across your custom ABAP — results in minutes.
What changes in S/4HANA
Performance impact is amplified on S/4HANA column-store tables.
Before and after: ABAP code example
* ECC: no guard — full table scan when lt_orders is empty
SELECT * FROM ekpo
INTO TABLE @DATA(lt_items)
FOR ALL ENTRIES IN @lt_orders
WHERE ebeln = @lt_orders-ebeln. * S/4HANA: guard prevents full table scan
IF lt_orders IS NOT INITIAL.
SELECT ebeln, ebelp, matnr, menge, netpr
FROM i_purchaseorderitem
INTO TABLE @DATA(lt_items)
FOR ALL ENTRIES IN @lt_orders
WHERE purchaseorder = @lt_orders-ebeln.
ENDIF. Effort estimate and common pitfalls
Effort estimate
Estimate is per affected object. Total effort scales with the number of occurrences in your codebase. Use the A1 scan to get an object-level count before estimating the full project.
Common pitfalls
- ! Forgetting to update all occurrences in the same program
- ! Not running ATC after the change to confirm the finding is resolved
Related rules to check
SELECT * usage
SELECT * reads all columns including new S/4HANA columns, causing unexpected results and performance issues.
Native SQL (EXEC SQL)
EXEC SQL and ADBC bypass ABAP SQL layer and break on S/4HANA HANA database.
Direct pool/cluster table access
Direct reads from BSEG, KONV, STXL and other pool/cluster tables. These tables are dissolved in S/4HANA.
Find every instance of this issue in your codebase
The A1 scanner checks all 30 compatibility rules — including Missing FOR ALL ENTRIES guard — across your custom ABAP objects and produces a prioritised remediation backlog.
Scan your codebase for this issue free →SAP, S/4HANA and ABAP are trademarks of SAP SE. s4ready.ai is an independent solution and is not affiliated with, endorsed by, or sponsored by SAP SE.