Skip to Content
avatar image
Former Member

LOAD-OF-PROGRAM && INITIALIZATION

Hi,

Kindly explain about the use of LOAD-OF-PROGRAM and INITIALIZATION events..

Regards,

Kalai

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

9 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 30, 2007 at 08:50 AM

    hI,

    Have a look at the below thread..

    diff-betw-loadofprogram-and-initialisation

    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9d7535c111d1829f0000e829fbfe/content.htm

    reward points if u find useful.

    Regards,

    Nagaraj

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 30, 2007 at 09:01 AM

    Hi

    It seems not so much difference. But INITIALIZATION block is peculiar to executables.

    LOAD-OF-PROGRAM: When an ABAP program is loaded in an internal session, the runtime environment triggers the LOAD-OF-PROGRAM event, and the corresponding event block is executed.

    INITIALIZATION: Only occurs in executable programs. The ABAP runtime environment triggers the INITIALIZATION event before the selection screen is processed, at which point the corresponding event block is processed.

    Regards

    Sastry

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2007 at 09:09 AM

    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.

    whereas INITIALIZATION is bassically used when u have to append some calculated values in your selection screen. this is the very first event triggered and after this is proccssed interpreter looks for at selection screen event.

    hope this clarified ur doubt.

    reward me if satisfied.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2007 at 08:44 AM

    Hi Kalaivani Pachiappan,

    LOAD-OF-PROGRAM will loads the program in to Application server and INITIALIZATION is used to initialize the values before program is going to execute.

    All the best.

    Reward if useful.

    Kishore

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2007 at 08:49 AM

    hi

    good

    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.

    thanks

    mrutyun^

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2007 at 08:50 AM

    here is an extract from the help...

    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.

    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9a2135c111d1829f0000e829fbfe/content.htm

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2007 at 08:52 AM

    Hi,

    The event LOAD-OF-PROGRAM is mainly used to initialize global data when calling external procedures or Transactions.

    INITIALIZATION is called after LOAD OF PROGRAM

    Regards,

    Sachin.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2007 at 09:00 AM

    Hi

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

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

    <u><b>INITIALIZATION</b></u>

    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.

    REWARD IF USEFULL

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2007 at 09:49 AM

    answered.

    Add comment
    10|10000 characters needed characters exceeded