With the PERFORM statement, you can call subroutines which are coded in the same ABAP program (internal calls), or subroutines which are coded in other ABAP programs (external calls).
You can also specify the name of the subroutine dynamically at runtime, and call subroutines from a list.
PERFORM subr [USING p1 p2... ]
[CHANGING p1 p2... ].
Internal Subroutine Calls
To call a subroutine defined in the same program, you need only specify its name in the PERFORM statement:
The internal subroutine can access all of the global data of the calling program.
Specifying Subroutines Dynamically
You can specify the name of a subroutine and, in the case of external calls, the name of the program in which it occurs, dynamically as follows:
PERFORM (fsubr)[IN PROGRAM (fprog)][USING p1 p2... ]
[CHANGING p1 p2... ]
[IF FOUND].
The names of the subroutine and the external program are the contents of the fields fsubr and fprog respectively. By using the option IF FOUND, you can prevent a runtime error from being triggered if no subroutine with the name fsubr is found. If you omit the parentheses, this variant of the PERFORM statement behaves like the static variant.