Skip to content

AbapCleaner does change the below block to use @FINAL(...) instead of @DATA(...) which is not syntaxtically correct #508

Closed

Description

@prokopp80

Before:
SELECT werks FROM t001k AS b INNER JOIN t001w AS p ON bbwkey = pbwkey UP TO 1 ROWS INTO @DaTa(lv_werks).
ENDSELECT.

After:
SELECT werks FROM t001k AS b INNER JOIN t001w AS p ON bbwkey = pbwkey UP TO 1 ROWS INTO @Final(lv_werks).
ENDSELECT.

the latter one is not correct.

Activity

  1. changed the title [-]AbapCleaner does change the below block to @FINAL(...) which is not syntaxtically correct[/-] [+]AbapCleaner does change the below block to use @FINAL(...) instead of @DATA(...) which is not syntaxtically correct[/+] on May 4, 2026
  2. jmgrassau commented on Sep 11, 2026

    @jmgrassau
    Member

    Hi prokopp80,

    thanks a lot for reporting this bug. The issue here is that FINAL is a rather new keyword (introduced with ABAP release 7.57), and if it is used, the SELECT statement has to follow the "strict mode" rules of that release. This one doesn't, because for that, UP TO 1 ROWS would need to be positioned after the INTO clause.

    Strict mode rules are no trivial topic, and unfortunately, some of them cannot be checked by ABAP cleaner due to missing backend access. However, I tried to cover some important cases, so with the next release, "Use FINAL for immutable variables" will identify your example as non-strict (and refrain from introducing FINAL into it), while it will still use FINAL in the modified code:

    Image

    Kind regards,
    Jörg-Michael

  3. jmgrassau commented on Oct 30, 2026

    @jmgrassau
    Member

    Hi prokopp80,

    thanks again for reporting this – this bug should now be fixed with version 1.29.2, which was released today!

    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

No one assigned

    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