ABAP Forum
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Possible ADT SQL Console parser bug: misleading syntax errors for valid Open SQL statement

0 Likes
277

Hi everyone,

I believe I may have found a bug or limitation in the ADT SQL Console and would like to know whether anyone else has experienced similar behavior.

System:

  • SAP ECC (Oracle database, not HANA)
  • ADT SQL Console in Eclipse

Not working SQL ⛔

I have below Open SQL query which is 320 characters long (it matters 😉😞

select ltap~tanum,
       count(*) as count
from ltap as ltap
where ltap~lgnum = 'STN'
  and exists (
        select 1
          from ltap as l1
         where l1~lgnum = 'STN'
           and l1~tanum = ltap~tanum
           and l1~werks = 'DER6' )
group by ltap~tanum
having min( ltap~werks ) <> max( ltap~werks )

Here is a screenshot:

nemanjasimovicavnet_0-1787839002514.png

The strange thing is that the SQL Console sometimes reports syntax errors that do not seem related to the actual query, for example:

After "STN", there must be a space or equivalent character

 Working SQL ✅

Here is the almost same SQL but working, and it's less then 255 characters. I kicked out spaces and counter function:

select ltap~tanum
from ltap as ltap
where ltap~lgnum = 'STN'
and exists ( select 1 from ltap as l1
where l1~lgnum = 'STN'
and l1~tanum = ltap~tanum
and l1~werks = 'DER6' )
group by ltap~tanum
having min( ltap~werks ) <> max( ltap~werks )

Here is the screenshot:

nemanjasimovicavnet_1-1787839418023.png

 

To me it looks like an obvious bug. Not sure if this depends on the system or not, so less people experience it. But this bug is around for more than a year now. 😔😔😔 

Thanks for any hint! 💖

Regards.

Hi everyone,

I believe I may have found a bug or limitation in the ADT SQL Console and would like to know whether anyone else has experienced similar behavior.

System:

  • SAP ECC (Oracle database, not HANA)
  • ADT SQL Console in Eclipse

Not working SQL ⛔

I have below Open SQL query which is 320 characters long (it matters 😉😞

select ltap~tanum,
       count(*) as count
from ltap as ltap
where ltap~lgnum = 'STN'
  and exists (
        select 1
          from ltap as l1
         where l1~lgnum = 'STN'
           and l1~tanum = ltap~tanum
           and l1~werks = 'DER6' )
group by ltap~tanum
having min( ltap~werks ) <> max( ltap~werks )

Here is a screenshot:

nemanjasimovicavnet_0-1787839002514.png

The strange thing is that the SQL Console sometimes reports syntax errors that do not seem related to the actual query, for example:

After "STN", there must be a space or equivalent character

 Working SQL ✅

Here is the almost same SQL but working, and it's less then 255 characters. I kicked out spaces and counter function:

select ltap~tanum
from ltap as ltap
where ltap~lgnum = 'STN'
and exists ( select 1 from ltap as l1
where l1~lgnum = 'STN'
and l1~tanum = ltap~tanum
and l1~werks = 'DER6' )
group by ltap~tanum
having min( ltap~werks ) <> max( ltap~werks )

Here is the screenshot:

nemanjasimovicavnet_1-1787839418023.png

 

To me it looks like an obvious bug. Not sure if this depends on the system or not, so less people experience it. But this bug is around for more than a year now. 😔😔😔 

Thanks for any hint! 💖

Regards.

1 REPLY 1
Read only

sria
Explorer
0 Likes
35

Hi Nemanja, your comparison changes two things: statement length and the COUNT(*) projection. To isolate a length/line-handling issue, keep the complete original query, including COUNT(*), and insert real line breaks before FROM, WHERE, GROUP BY and HAVING so every physical line is short. Soft wrapping in the editor is not the same test. Then compare Check and Run, and run the same SELECT in a small ABAP report on the same backend.

If only the one-line console version fails, retain that minimal pair for SAP together with SAP_BASIS release/SP and Eclipse/ADT versions. That supports a console/backend handling defect without attributing it to Oracle prematurely. SAP documents the console as ABAP SQL, with its own syntax checking; it is not a native Oracle SQL console.

I have not verified a documented 255-character console limit or a specific correction, so I would treat that threshold as your reproduction clue rather than a general ABAP SQL restriction.

Reference: https://help.sap.com/docs/ABAP_PLATFORM_NEW/f2e545608079437ab165c105649b89db/c672ec1c94964bb8837075f...

Regards,
sai