Skip to content

Multi statement, single line mishandling #413

Closed

Description

@matthewdjb

I'm dealing with legacy code where the coder has that habit of more than one statement.

So:

    READ TABLE lt_children WITH KEY agr_name = iv_agr_name
                                    child_agr = iv_child_agr TRANSPORTING NO FIELDS. " ASSIGNING <child>.
    IF sy-subrc EQ 0.    rv_assigned = 'X'. ENDIF.

Becomes

    IF line_exists( lt_children[ agr_name  = iv_agr_name
                                 child_agr = iv_child_agr ] ). " ASSIGNING <child>. rv_assigned = 'X'. ENDIF.

Thus, the code is syntactically incorrect.

The correct would be:

    IF line_exists( lt_children[ agr_name  = iv_agr_name
                                 child_agr = iv_child_agr ] ). " ASSIGNING <child>.
      rv_assigned = 'X'.
    ENDIF.

Activity

  1. self-assigned this
    on Jul 2, 2025
  2. jmgrassau commented on Jul 2, 2025

    @jmgrassau
    Member

    Hi Matthew,

    oh, that's not good … it will be fixed with the next release, where line breaks are enforced before the next statement, as well as before the ENDIF:

    Image

    Kind regards,
    Jörg-Michael

  3. jmgrassau commented on Jul 8, 2025

    @jmgrassau
    Member

    Hi Matthew,

    thanks a lot for reporting this issue – this should now be fixed with version 1.21.2!

    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