Skip to Content
author's profile photo Former Member
Former Member

Difference between Load - of - program & Initialization ?

Hi Friends,

What is the "Difference between Load - of - program & Initialization "

Cheers 😉

R.Kripa.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2006 at 05:55 AM

    The corresponding event is triggered in an internal session immediately after a program with type 1, M, F, or S is loaded. The corresponding processing block is processed once per program and internal session.

    The processing block LOAD-OF-PROGRAM has approximately the same function in an ABAP program with type 1, M, F, or S as the constructor method of a class in ABAP Objects.

    Programs wiht type 1, M, F, or S can be loaded into an internal session in two ways:

    Program calls

    Whenever you call a program using SUBMIT or a transaction code, a new internal session is opened. The LOAD-OF-PROGRAM event is therefore called in each program call.

    External procedure calls

    The first time you call an external procedure (subroutine or function module), the main program of the procedure that you called is loaded into the internal session of the calling program. The eventLOAD-OF-PROGRAM is triggered and the corresponding processing block is executed before the procedure that you called. However, subsequent calls from the same calling program to a procedure in the same subroutine pool or function group do not trigger the LOAD-OF-PROGRAM event.

    so it's before the program is loaded in the memory for execution.

    Initialization:

    (For executable programs of type 1), the associated event is executed before the selection screen is displayed.

    The parameters (PARAMETERS) and selection criteria (SELECT-OPTIONS) defined in the program already contain default values (if specified). You can assign different values here and also change the database-specific selections.

    Example

    Define the last day of the previous month as the key date:

    PARAMETERS QUAL_DAY TYPE D DEFAULT SY-DATUM.

    INITIALIZATION.

    QUAL_DAY+6(2) = '01'.

    QUAL_DAY = QUAL_DAY - 1.

    Here, the default value of QUAL_DAY is the current date, e.g. 05.04.88 (QUAL_DAY = '19880405'). Two subseqent statements set the date first to the beginning of the month, e.g. 01.04.88 (QUAL_DAY = '19880401') and then, by subtracting one day, to the last day of the previous month, e.g. 31.03.88 (QUAL_DAY = '19880331').

    so load-of-program before program is loaded in the main memory is excuted and initialization is done before selection screen of the program is displayed..

    reward points if it helps

    regds

    gunjan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2006 at 06:28 AM

    Hi Gunjan Kumar,

    Thanks anyway .... but what will be the coding inside the event ????

    Cheers 😊

    R.Kripa.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi

      load-of-program is used internally from SAP to load the program in the main meory for execution and it's internal processing...there's a separate subroutine and system level program involved ..to get the program loaded taking into account all the OS level details....

      reward points if it helps

      regards

      gunjan

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2006 at 06:58 AM

    hey Gunjan Kumar,

    so do we not code "LOAD-OF-PROGRAM" while writing a program??

    is it automatically called / executed ???

    Cheers 😉

    R.Kripa.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      Yes you don't have to code 'LOAD-OF-PROGRAM' in program it is automatically called by system to load program memory area for variables.

      But you can write it in your program if you want to do some thing before the 'INITIALIZATION' event because 'LOAD-OF-PROGRAM' is called before the 'INITIALIZATION' event'..

      initialization.

      write:/ '2'.

      load-of-program.

      write:/ '1'.

      output will be

      1

      2

      Regards,

      Wasim Ahmed

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2006 at 07:33 AM

    Hi,

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

    The system always <b>automatically</b> processes this event when a program of type 1 (online report), type M (module pool), type F (function group) or S (subroutine pool) is loaded into an internal mode.

    <b>INITIALIZATION:</b>

    Before the selection screen the event will be triggered. We can this event only in Executable programs. i.e Report programs. This event is optional. whether we can use or not.

    - Selvapandian Arunachalam

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2014 at 10:10 AM

    LOAD-OF-PROGRAM

    First event to be called before any of the other ABAP code is processed.

    INITIALIZATION

    Called after the abap selection screen code has been processed (i.e. parameters, select-options etc) but before these are displayed to the user. So you can use it to initialize input fields of the selection screen or change the default values of these before the user gets to enter data into them.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.