Skip to content
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

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

Closed
se38 opened this issue Jul 5, 2023 · 5 comments
Closed

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

se38 opened this issue Jul 5, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@se38
Copy link

se38 commented Jul 5, 2023

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.

@jmgrassau jmgrassau added the bug Something isn't working label Jul 5, 2023
@jmgrassau
Copy link
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

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

@jmgrassau jmgrassau self-assigned this Jul 5, 2023
@se38
Copy link
Author

se38 commented Jul 5, 2023

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

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

@se38
Copy link
Author

se38 commented Jul 5, 2023

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
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants