Skip to content

BUG: Rules "Convert CHECK inside/outside loop..." #71

Closed

Description

@se38

Applying the ABAP Cleaner on old reports with SELECT / ENDSELECT unfortunatelly creates "unwanted" behaviours.

Important:
please handle SELECT / ENDSELECT as a loop, too in rule "Convert CHECK inside a loop to IF NOT..." otherwise the rule "Convert CHECK outside loop" takes over.

Example:

    SELECT * FROM mara
      WHERE matnr = '0815'
      INTO @DATA(mat_master).

      CHECK 4711 = 0815.
      WRITE / 'This is a loop, too.'.

    ENDSELECT.
    
    WRITE / 'This is the end'.

Will be converted to

    SELECT * FROM mara
      WHERE matnr = '0815'
      INTO @DATA(mat_master).

      IF 4711 <> 0815.
        RETURN.
      ENDIF.
      WRITE / 'This is a loop, too.'.

    ENDSELECT.
    
    WRITE / 'This is the end'.

Which is obviously not the same, because the RETURN immediatelly leaves the FORM/METHOD/Program and not only the loop -> the code after the ENDSELECT will not be executed.

Activity

  1. jmgrassau commented on Jul 5, 2023

    @jmgrassau
    Member

    Hi Uwe,

    uh oh, that's not good, of course – but shouldn't be too difficult to fix. Thanks a lot for reporting this!

    Kind regards,
    Jörg-Michael

  2. jmgrassau commented on Jul 5, 2023

    @jmgrassau
    Member

    Hi Uwe,

    okay, the issue is fixed now; I will create a new release later today, because this is really the kind of bug we don't want to have in ABAP cleaner!

    Kind regards,
    Jörg-Michael

  3. self-assigned this
    on Jul 5, 2023
  4. se38 commented on Jul 5, 2023

    @se38
    Author

    Great to hear, we owe you a beer or two. Hope to meet you in real life in the near future.
    Cheers, Uwe

  5. jmgrassau commented on Jul 5, 2023

    @jmgrassau
    Member

    Hi Uwe,

    very kind, thank you! Let me know if you are around Walldorf :-)

    Taking this as an exercise in how fast deployment works if needed – so, this issue should be fixed in version 1.5.0, which was just released!

    Kind regards,
    Jörg-Michael

  6. se38 commented on Jul 5, 2023

    @se38
    Author

    New release works perfect, thank you.

    If there's a SAP Insidetrack Walldorf or something similar I'll be there. Unfortunatelly I'm not invited to DKOM anymore ;-)
    You can follow me on Mastodon @se38@nrw.social (my Twitter account @se38 is inactive for reasons)

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