on 2023 Jul 13 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
Request clarification before answering.
Hi Naga,
The message SELECT 694 gives a hint that the statement cannot be executed in the ABAP server, i. e. the statement is executed in the database. This hint is given as the execution time might be higher than expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Hi.
Isn't that the desired behavior? You run a Select on an internal table. This is pushes to the database and executed with database Operations.
The question is: why is that an ATC error? Doesn't want your Company those means to be used?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 17 | |
| 8 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.