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

SQL Console executes and fails to execute identical query

NemanjaSimovic
Active Participant
623

Hi,

In SQL Console in ADT something strange is happening. If I run SQL Console from Project's right-click it doesn't work, like you can see on the right side of split window below. But if I run from any of these options it's fine, as long as my SQL query do not exceed 255 characters.
NemanjaSimovic_1-1781108088909.png

NemanjaSimovic_0-1781107894617.png

This is strange indeed. I reported already, but probably in a wrong group.

If anybody has any idea I would appreciate, as I'm using SQL Console a lot. It's a great tool. If it would not have a row limitation it would be even better. 😁

Here is where I have reported same issue earlier: https://community.sap.com/t5/technology-q-a/bug-in-sql-console-in-adt-3-58-1-editor-swallows-cr-and-...

Regards,
Nemanja

4 REPLIES 4
Read only

NemanjaSimovic
Active Participant
0 Likes
431

Hi 

It's ridiculous to have this bug so long. 😔

With count() = error

NemanjaSimovic_0-1782131091739.png

Without count() = OK

NemanjaSimovic_1-1782131344727.png

Regards,
Nemanja

Read only

0 Likes
426

What happens if you add some grouping in your second (working) query?
I'm not sure, but my instincts ask me to add any grouping in the SELECT that you can have in the HAVING (not sure why, maybe a reminiscence of a previous life)

I can be wrong, just wondering. I'm usually wrong, I will not be surprised if I am this time too, just trying to help.

Read only

394

Hi @VXLozano ,

Thanks for taking an interest. The thing is not about the query itself but the bug which parses the SQL from SQL Console. ADT team created a bug two or three updates ago, and they are not fixing it. 

Here is the same query just differently formatted. One is fine and another is erroneous:

Fine

SELECT vbfa~vbelv,vbfa~posnv
FROM vbfa
JOIN likp ON likp~vbeln = vbfa~vbeln
WHERE likp~erdat >= '20260101'
  AND likp~wadat_ist = '00000000'
  AND vbfa~vbtyp_n = 'J'
GROUP BY vbfa~vbelv, vbfa~posnv
HAVING MIN( vbfa~vbeln ) <> MAX( vbfa~vbeln )

Erroneous

SELECT 
  vbfa~vbelv
  ,vbfa~posnv
FROM vbfa
JOIN likp ON likp~vbeln = vbfa~vbeln
WHERE likp~erdat >= '20260101'
  AND likp~wadat_ist = '00000000'
  AND vbfa~vbtyp_n = 'J'
GROUP BY vbfa~vbelv, vbfa~posnv
HAVING MIN( vbfa~vbeln ) <> MAX( vbfa~vbeln )

Error that is reported do not have any sense:

NemanjaSimovic_0-1782204302548.png

Difference

Only difference is format. I placed columns in separate lines in SELECT clause.

Conclusion = Bug

So, parser is failing here. 🙃 I'm just surprised that ADT team haven't fixed it for so long as the tool is pretty good, regarding SAP environment, and it's probably widely used.

Regards,
Nemanja

Read only

0 Likes
363

The ADT team is too busy launching features for the VS Code thing. It seems hype is more important than effectiveness these times. And it's sad, but I guess it is 😞