ABAP PERFORM Statement Syntax with example

In ABAP programming PERFORM statement is used for calling a subroutine ( Piece of reusable functional code defined with FORM statement ). We can call the subroutine defined in the current executing program or from an external program. A subroutine will be enclosed in a FORM and ENDFORM statements. Values are passing to subroutine by USING & CHANGING additions. See an Example Program.

Syntax and variants of this statement are

  • PERFORM subroutine_name .
    It calls the specified subroutine from the currently executing program
  • PERFORM subroutine_name(external_program_name).
    It calls the specified subroutine from the an external program
  • PERFORM subroutine_name IN PROGRAM external_program_name.
    Same as previous, but we can specify both dynamically
  • PERFORM index_no OF subroutine_name1 subroutine_name2 subroutine_name3
    Subroutine names are there in the statement, and we can call it with the order number like 1 ,2 etc
  • PERFORM subroutine_name ON COMMIT
    Subroutine will be called only after COMMIT statement

Additions used with PERFORM statement

  • USING
  • CHANGING
  • TABLES
  • IF FOUND
  • LEVEL ( Only with COMMIT )

Main runtime errors occuring with ABAP PERFORM

  • PERFORMANCE_PARAMETER_MISSING
  • PERFORM_PARAMETER_COUNT
  • PERFORM_TOO_MANY_PARAMETERS
  • PERFORM_CONFLICT_TYPE
  • PERFORM_CONFLICT_GENERIC_TYPE
  • PERFORM_BASE_WRONG_ALIGNMENT
  • PERFORM_PARAMETER_TOO_SHORT
  • PERFORM_TABLE_REQUIRED
  • PERFORM_BASE_LITL
  • PERFORM_NOT_FOUND
  • PERFORM_INDEX_0
  • PERFORM_INDEX_NEGATIVE
  • PERFORM_INDEX_TOO_LARGE

Here is sample program with source code

ABAP PERFORM Statement example