Skip to content

Formatting Error with Common Table Expression #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
freakadunse opened this issue Dec 20, 2024 · 2 comments
Closed

Formatting Error with Common Table Expression #390

freakadunse opened this issue Dec 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@freakadunse
Copy link

Hi there,

i get the following error with automated cleaning:

ABAP cleaner has encountered a problem
Cannot invoke "com.sap.adt.abapcleaner.parser.Token.isAnyKeyword(String[])" because "token" is null

It seems like the following CTE is the culprit:

    with +cte as ( select guid_parent,
                   guid_stock,
                   matid,
                   batchid,
                   quan,
                   lgtyp,
                  case when quan = @iv_required_quantity
                  then 1
                  else 2 end as priority
                  from @gt_filtered_quants as quant
                  where quan >= @iv_required_quantity
                    and guid_parent not in @lt_excluding_hus
                  order by priority ascending )
  select single
      first_value( guid_parent )
      over( partition by priority order by priority ascending  )
    from +cte
    where guid_parent not in @lt_excluding_hus
    into @data(lv_determined_hu).  

Any idea what the error might be?

BR
Pascal

@jmgrassau jmgrassau added the bug Something isn't working label Dec 20, 2024
@jmgrassau jmgrassau self-assigned this Dec 20, 2024
@jmgrassau
Copy link
Member

Hi Pascal,

thanks for reporting this bug! Looks like the window expression FIRST_VALUE( ... ) OVER ( ... ) was not properly handled here by ABAP cleaner. This will be fixed with the next release!

Image

Kind regards,
Jörg-Michael

@jmgrassau
Copy link
Member

Hi Pascal,

thanks again for opening this issue! This bug should now be fixed in version 1.21.1, which was just released!

Kind regards,
Jörg-Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants