05-25-2022 6:19 AM
Hello All,
when I do ATC checks I am getting following issue.
I checked lot of websites I am unable to solve the issue.
Please help me to sort out of this one.
Thanks and Regards,
Vasundhara Lella
05-25-2022 6:48 AM
It looks like the ATC check expects you to use a Join instead of FOR ALL ENTRIES here. Surprised to see no WHERE conditions for deliveries.. will fetch data for all delivery types for all years, not sure if that is desired. In any case you can possibly check by changing the code OR await further responses for the exact solution..
Regards,
Vijay
05-25-2022 7:18 AM
The ATC message is clear:
SELECT * FROM ALL statement can be joined with SELECT statement at ... line ...
If you search the forum (only the answers less than 5 or 10 years, not the old answers), you will see that a join is to be preferred over FOR ALL ENTRIES.
A join means for example SELECT ... FROM likp INNER JOIN lips ...
05-25-2022 7:35 AM
Here I used only two tables(LIKP, LIPS). If I want to join more than 6 tables for all entries is suggestable to use. In that case which you suggest for all entries or joins. Please let me know.
05-25-2022 7:40 AM
Make a simple test, put a trace on a FOR ALL ENTRIES. You will see SAP doing by set of data an access to the database. Each time you have an access, you use a time.
So FOR ALL ENTRIES, if you have more than hundred entries, will consume a lot of time.
Then answer is simple, if you don't care about performance, do what ever you want. keep your code in an easy way of reading.
If you need some performance from your report, create a CDS view with all the JOIN you need.
05-25-2022 7:44 AM
05-25-2022 4:14 PM
I think the ATC check is simply telling you to use a join between LIKP and LIPS, instead of doing a FOR ALL ENTRIES.
05-25-2022 5:34 PM
I'd like to hear more from people who said "to join more than 6 tables for all entries is suggestable to use". A myth. Any SQL must be tuned. 10 joined tables can be perfectly fine and for all entries might be a mess. As rule-of-thumb, always avoid for all entries, there shouldn't be any "6 tables" rule.