Skip to content

Latest commit

 

History

History
95 lines (65 loc) · 2.62 KB

AlignFormDeclarationRule.md

File metadata and controls

95 lines (65 loc) · 2.62 KB

<-- previous rule | overview | next rule -->

Align FORM declarations

Aligns obsolete subroutine declarations with FORM.

Options

  • Continue after FORM name for up to [3] parameters
  • Continue after TABLES / USING / CHANGING / RAISING
  • Align TYPEs
  • Add empty line after multi-line FORM declaration
  • Remove empty line after one-line FORM declaration

Examples

FORM any_subroutine USING iv_any_value TYPE string.

  " any subroutine implementation
ENDFORM.


FORM other_subroutine USING iv_any_value TYPE i iv_other_value TYPE string CHANGING cv_third_value TYPE i.
  " other subroutine implementation
ENDFORM.


FORM third_subr_with_a_long_name TABLES it_any_table STRUCTURE ty_s_any_struc
  it_other_table TYPE STANDARD TABLE it_third_table it_fourth_table TYPE ty_tt_any
  CHANGING ct_table TYPE ty_tt_table cs_struc TYPE LINE OF ty_tt_any cs_other_struc LIKE cs_any
    cs_third_struc LIKE LINE OF ct_table.
  " third subroutine implementation
ENDFORM.


FORM fourth_subroutine
  USING
    VALUE(iv_any) TYPE string
    iv_other TYPE REF TO object
  RAISING
    cx_any_exception RESUMABLE(cx_other_exception) cx_third_exception.
  " fourth subroutine implementation
ENDFORM.

Resulting code:

FORM any_subroutine USING iv_any_value TYPE string.
  " any subroutine implementation
ENDFORM.


FORM other_subroutine USING    iv_any_value   TYPE i
                               iv_other_value TYPE string
                      CHANGING cv_third_value TYPE i.

  " other subroutine implementation
ENDFORM.


FORM third_subr_with_a_long_name
  TABLES   it_any_table    STRUCTURE ty_s_any_struc
           it_other_table  TYPE STANDARD TABLE
           it_third_table
           it_fourth_table TYPE ty_tt_any
  CHANGING ct_table        TYPE ty_tt_table
           cs_struc        TYPE LINE OF ty_tt_any
           cs_other_struc  LIKE cs_any
           cs_third_struc  LIKE LINE OF ct_table.

  " third subroutine implementation
ENDFORM.


FORM fourth_subroutine
  USING   VALUE(iv_any) TYPE string
          iv_other      TYPE REF TO object
  RAISING cx_any_exception
          RESUMABLE(cx_other_exception)
          cx_third_exception.

  " fourth subroutine implementation
ENDFORM.

Related code