Skip to content

Formatting Error with Common Table Expression #390

Closed

Description

@freakadunse

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

Activity

  1. self-assigned this
    on Dec 20, 2024
  2. jmgrassau commented on Dec 20, 2024

    @jmgrassau
    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

  3. jmgrassau commented on Dec 23, 2024

    @jmgrassau
    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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions