on 07-13-2023 1:53 PM
Hello All,
I wrote a select statement over internal table, and when performed the ATC check, I got the error as 'The SELECT command is executed on the database.'(SELECT 694). Any inputs on why this error is coming up?
No pragma to suppress the error.
Following is the code that was written:
select a, count ( a )
as lv_count
from @lt_internaltable as lt
group by a
into table @data(lt_Tab2).
Thanks and Regards,
Naga
The message is a syntax warning which is independent from ATC. ATC displays syntax warnings. When you deal with internal data which is on the application server, it is probably better not to push it in the database first and then process it there. This is what's happening here. There are aggregation techniques in ABAP that can be used, e.g. LOOP AT ... GROUP BY..., SORT, ...
You have to decide whether you want to save development time and leave it like it is (then use the pragma ##ITAB_DB_SELECT or an ATC exemption) or rethink the code which may take some time. But maybe it is not critical at all for performance because it is executed only once.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The SELECT on an internal table is very useful für JOIN statements, and it replaces the FOR ALL ENTRIES CLAUSE. It is in general faster and much more flexible. If a list is needed for data on the database, you have to push down the information. But if you don't, it is better to not use it, but of cause it depends on the individual case.
Code stability and simplicity are other criteria. From my personal perspective, there is never a general good or bad. You can suppress the warning, but in general it tells you that this can be optimized.
User | Count |
---|---|
75 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.