LOAD-OF-PROGRAM.
This event keyword defines an event block whose event is triggered by the ABAP-runtime environment when an executable program, a module pool, a function group or a sub-routine pool is loaded in the internal session.
When a program is called using SUBMIT or using a transaction code, then - at every call - a new internal session is opened and the event block is executed once at every call. You can initialize global data objects of the program here. The event block must be executed completely; otherwise, a runtime error will occur.Therefore, no statements are allowed to be executed that leave the event block without returning.
At the first call of an external Procedure (sub-program or function module), the framework program of the called procedure is loaded into the internal session of the caller, thus triggering the event LOAD-OF-PROGRAM. The event block is executed before the called procedure. At any further call of a procedure of the same framework program by a caller of the same internal session, the event LOAD-OF-PROGRAM is triggered no longer.
The event LOAD-Of-PROGRAM should mainly be used to initialize global data when calling external procedures or Transactions. If you call executable programs with SUBMIT, we recommend that you use the event INITIALIZATION, as the Starting values for parameter and selection criteria are set after LOAD-OF-PROGRAM (see program flow after SUBMIT).