Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Exact difference between load-of-program and Initialisation

Former Member
0 Kudos

HI i want to know the Exact differece Between load-of-program and Initialisation

and tell me the specific use of Initialisation

Thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

LOAD-OF-PROGRAM

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).

INITIALIZATION

INITIALIZATION.

This event keyword defines an event block whose event is triggered by the ABAP runtime environment during the flow of an executable program, directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen. This gives you the one-time opportunity to initialize the input fields of the selection screen, including those defined in the logical database linked with the program.

When an executable program defines a standard selection screen, it is called again by the ABAP runtime environment after execution, which triggers the INITIALIZATION event again. In this case, initializing parameters or selection criteria of the selection screen has no effect, because they are automatically supplied with the preceding user inputs from the selection screen during the selection screen event AT SELECTION-SCREEN OUTPUT. To explicitly initialize the selection screen for each call, you must use the event AT SELECTION-SCREEN OUTPUT.

****************

LOAD-OF-PROGRAM->

The event LOAD-OF-PROGRAM is triggered each time a program is called. If a corresponding event block is defined in the framework program, it is executed once before the first other processing block is executed.

An interesting remark at this point is that each execution of an executable program actually has a SUBMIT statement as its source. When you enter the program name in a transaction like SE38 or SA38 and choose Execute, a SUBMIT statement occurs in the transaction. Technically speaking, therefore, executable programs have the attribute of being able to be called using SUBMIT, although their principal characteristic from a user’s point of view is that they are started in the foreground

INITIALIZATION->

This event occurs before the standard selection screen is called. During this event block, the input fields of the standard selection screen can only be initialized once after the program has been started. If an executable program declares a standard selection screen the same program will be automatically called again by the system once the selection screen has been executed (see SUBMIT). This triggers the INITIALIZATION event again. It is important to note however that the initialization of parameters or selection criteria will not have an effect because at this point the value of the AT SELECTION-SCREEN OUTPUT is assigned using the previous user inputs. Only the remaining global fields which were set during INITIALIZATION are initialized during each program run.

3 REPLIES 3

Former Member
0 Kudos

Hi

LOAD-OF-PROGRAM

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).

INITIALIZATION

INITIALIZATION.

This event keyword defines an event block whose event is triggered by the ABAP runtime environment during the flow of an executable program, directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen. This gives you the one-time opportunity to initialize the input fields of the selection screen, including those defined in the logical database linked with the program.

When an executable program defines a standard selection screen, it is called again by the ABAP runtime environment after execution, which triggers the INITIALIZATION event again. In this case, initializing parameters or selection criteria of the selection screen has no effect, because they are automatically supplied with the preceding user inputs from the selection screen during the selection screen event AT SELECTION-SCREEN OUTPUT. To explicitly initialize the selection screen for each call, you must use the event AT SELECTION-SCREEN OUTPUT.

****************

LOAD-OF-PROGRAM->

The event LOAD-OF-PROGRAM is triggered each time a program is called. If a corresponding event block is defined in the framework program, it is executed once before the first other processing block is executed.

An interesting remark at this point is that each execution of an executable program actually has a SUBMIT statement as its source. When you enter the program name in a transaction like SE38 or SA38 and choose Execute, a SUBMIT statement occurs in the transaction. Technically speaking, therefore, executable programs have the attribute of being able to be called using SUBMIT, although their principal characteristic from a user’s point of view is that they are started in the foreground

INITIALIZATION->

This event occurs before the standard selection screen is called. During this event block, the input fields of the standard selection screen can only be initialized once after the program has been started. If an executable program declares a standard selection screen the same program will be automatically called again by the system once the selection screen has been executed (see SUBMIT). This triggers the INITIALIZATION event again. It is important to note however that the initialization of parameters or selection criteria will not have an effect because at this point the value of the AT SELECTION-SCREEN OUTPUT is assigned using the previous user inputs. Only the remaining global fields which were set during INITIALIZATION are initialized during each program run.

Former Member
0 Kudos

HI,

LOAD-OF-PROGRAM->

The event LOAD-OF-PROGRAM is triggered each time a program is called. If a corresponding event block is defined in the framework program, it is executed once before the first other processing block is executed.

An interesting remark at this point is that each execution of an executable program actually has a SUBMIT statement as its source. When you enter the program name in a transaction like SE38 or SA38 and choose Execute, a SUBMIT statement occurs in the transaction. Technically speaking, therefore, executable programs have the attribute of being able to be called using SUBMIT, although their principal characteristic from a user’s point of view is that they are started in the foreground

INITIALIZATION->

This event occurs before the standard selection screen is called. During this event block, the input fields of the standard selection screen can only be initialized once after the program has been started. If an executable program declares a standard selection screen the same program will be automatically called again by the system once the selection screen has been executed (see SUBMIT). This triggers the INITIALIZATION event again. It is important to note however that the initialization of parameters or selection criteria will not have an effect because at this point the value of the AT SELECTION-SCREEN OUTPUT is assigned using the previous user inputs. Only the remaining global fields which were

Regards

Sudheer

Former Member
0 Kudos

HI,

<b>LOAD-OF-PROGRAM:</b>

Directly after an executable program, a module pool, a function group or a subroutine pool has been loaded, a special processing block can be executed exactly once. This processing block is defined as an event block using the event keyword LOAD-OF-PROGRAM. The processing block for LOAD-OF-PROGRAM has the same function for ABAP programs as a constructor has for classes.

<b>INITIALIZATION:</b>

The runtime environment creates the INITIALIZATION event and calls the corresponding event block (if it has been defined in the ABAP program).

rgds,

bharat.