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
- IF FOUND
- LEVEL ( Only with COMMIT )
Main runtime errors occuring with ABAP PERFORM