Entering content frame

External Procedure Calls Locate the document in its SAP Library structure

In an external procedure call, the called unit is not part of the calling program. This means that, at runtime, an extra program has to be loaded into the internal session of the calling program. You can use external calls for procedures and subscreens.

The additional loaded program is an instance with its own global data area. When you call an external subroutine, the calling program and the loaded program form a single program group, unless the loaded program is a function group. Function groups always form their own program group. Furthermore, when you call methods externally, the loaded class forms its own program group. Within a program group, interface work areas and the screens of the calling program are shared. Classes cannot contain interface work areas.


This graphic is explained in the accompanying text



All procedures, that is, subroutines, function modules, and methods, can be called externally from any ABAP program.

        You are recommended not to use external calls for subroutines, in particular if the subroutines share interface work areas with the calling program and call their own screens. The program group into which the main program of a subroutine is loaded depends on the sequence of the calls. The sequence is often not statically defined, but changes depending on user actions or the contents of fields. For this reason, it may not be clear which interface work areas and screens will be used by an externally-called subroutine.

        Function modules are intended for external procedure calls.

        Accessing an externally-visible method of a global class counts as an external procedure call.

At the first call of an external sub-screen or a function module, the framework program of the called procedure is loaded to the internal session of the calling program.  In doing so, the event LOAD-OF-PROGRAM is triggered and the associated processing block is executed before the called procedure is executed. At every further call of a procedure of the same framework program by a caller of the same internal session, the event LOAD-OF-PROGRAM is no longer triggered.

Subscreen screens

You can call a subscreen screen externally by specifying an ABAP program other than the current program when calling in the screen flow logic. This program is treated in the same way as in an external subroutine call. In other words, it is loaded into the program group of the calling program, or, if it is a function group, as its own program group in the same internal session as the calling ABAP program.

For this reason, you should not use external subscreens that do not belong to a function group, since the same problems can occur with interface work areas and screen calls as can occur with external subroutines.


Leaving content frame