Skip to Content
Jul 09, 2020 at 10:06 AM

ATC Check: Explicit SORT statement required



I have noticed that when we select data from second table(say ITAB2) based on first table(say ITAB1) using FOR ALL ENTRIES, without explicitly specifying the SORT statement on the first table (eg: SORT itab1 by key fields), the ATC check gives error that the two tables can be JOINED instead of individual selects. If I write an explicit SORT statement on ITAB1, the error goes away.

This happens if we define the ITAB1 as SORTED TABLE OF or apply the ORDER BY clause based on the primary key while fetching data.

Does it mean that ATC looks for an explicit SORT statement and does not consider that table is SORTED using a different technique?