SAP PERFORM - Obsolete ABAP Statements

Get Example source ABAP code based on a different SAP table
  



PERFORM subr(prog)

Short Reference
• PERFORM subr(prog) ABAP_STATEMENT_OBS
• IF FOUND PERFORM - obsolete

ABAP Syntax(Obsolete)PERFORM subr(prog) [IF FOUND] [ parameter_list].

What does it do? A variant of the external subroutine call that is not allowed in classes. The statement PERFORM calls the statically declared subroutine subr of a program prog. The existence of the specified program and subroutine is not check by the syntax check. Only the extended program check registers any nonexistent programs or subroutines as errors by default. If the addition IF FOUND is specified, the extended program check also skips the check. If the specified subroutine or program does not exist at runtime, a handleable exception of the class CX_SY_DYN_CALL_ILLEGAL_FORM or CX_SY_PROGRAM_NOT_FOUND is raised by default. If the addition IF FOUND is specified, the statement PERFORM is skipped.

Latest notes:In this variant, the program name prog is specified directly in parentheses. Since parentheses in operand positions indicate a dynamic specification in all other cases, this form of the name is obsolete. Specify it with the addition IN PROGRAM instead.
External calls of subroutines are obsolete in any case. Instead of subroutines, methods and function modules can be used as explicit functional interfaces of a program.
Furthermore, external calls of subroutines are critical, since it cannot usually be statically determined to which program groups the framework program is assigned.
To call a subroutine in a program in a different package, the declaration of the subroutine must be shared between a declaration part and an implementation part using FORM - DEFINITION, IMPLEMENTATION; the declaration part must always be public in the package interface.

Return to menu