question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parser error for SELECT statements with CASE

See original GitHub issue

Updated to 2.32.8

Statement does not exist in ABAPv740sp08(or a parser error), “SELECT” (parser_error)

      SELECT mwskz AS tax_code,
             CASE shkzg
               WHEN 'H' THEN ABS( fwste )
               WHEN 'S' THEN ABS( fwste ) * -1
             END AS tax_amount_dc,
             CASE shkzg
               WHEN 'H' THEN ABS( hwste )
               WHEN 'S' THEN ABS( hwste ) * -1
             END AS tax_amount_lc,
             CASE shkzg
               WHEN 'H' THEN ABS( fwbas )
               WHEN 'S' THEN ABS( fwbas ) * -1
             END AS tax_base_amount_dc,
             CASE shkzg
               WHEN 'H' THEN ABS( hwbas )
               WHEN 'S' THEN ABS( hwbas ) * -1
             END AS tax_base_amount_lc
        FROM bset
        WHERE bukrs = @is_doc_key-company_code
          AND gjahr = @is_doc_key-fiscal_year
          AND belnr = @is_doc_key-document_number
        ORDER BY tax_code
        INTO CORRESPONDING FIELDS OF TABLE @lt_document_tax_data.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
fabianlupacommented, Nov 16, 2021

That works, thanks!

1reaction
fabianlupacommented, Nov 14, 2021

I cannot narrow down the version all that much, the system with the example is on 740sp20. I cannot recall if that feature worked on sp05 but according to the blog you linked it looks like it did.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CASE statement in SQL throwing a parsing issue
When I run the below SQL and it says error parsing the query. I tried my best to figure out the error but...
Read more >
Parser can not parse the correct code:{ select case ... end ...
In any case, the PL/SQL compiler resolves this collision adequately, but the parser does not. Is this some kind of problem with parsing?...
Read more >
SELECT Command - Amazon Simple Storage Service
The SELECT list names the columns, functions, and expressions that you want the query to return. The list represents the output of the...
Read more >
A warning occurred while parsing SQL expressions of ... - IBM
In some cases, the SQL parsing is successful, but one or more base tables or base views were not imported into the metadata...
Read more >
Parser bug in INSERT .. SELECT .. ON CONFLICT clause
When the INSERT statement to which the UPSERT is attached takes its values from a SELECT statement, there is a potential parsing ambiguity....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found