‎2007 May 16 4:53 PM
Hi,
Can anybody please list out the exact differences between the events 'LOAD-OF-PROGRAM', 'INITIALIZATION' and 'AT SELECTION-SCREEN OUTPUT'.
Thanks in advance,
Sujit.
‎2007 May 16 4:57 PM
Hi,
LOAD-OF-PROGRAM:
The system always automatically 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.
INITIALIZATION:
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.
AT SELECTION-SCREEN OUTPUT:
This event is executed at PBO of the selection screen every time the user presses ENTER - in contrast to INITIALIZATION. Therefore, this event is not suitable for setting selection screen default values. Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used) and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.
Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of selection screen fields.
Regards,
Ferry Lianto
‎2007 May 16 4:57 PM
Load-of-program :
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.
INITIALIZATION
Filling default values to selection-screen
'AT SELECTION-SCREEN OUTPUT'.
It is dynamic validation for selection-screen :
We use Screen Internal Table
Reward Points if it is useful
Thanks
Seshu
‎2007 May 16 9:41 PM
Hi,
<u><b>LOAD-OF-PROGRAM:</b></u> 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.
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.
<u><b>INITIALIZATION:</b></u>
This event occurs before the standard selection screen is called. You can use it, for example, to initialize the input fields of the standard selection screen. This is the only possible way to change the default values of parameters or selection criteria defined in logical databases. To change a selection criterion, you must fill at least the components <seltab>-SIGN, <seltab>-OPTION, and <seltab>-LOW of the selection table <seltab>, otherwise it remains undefined.
If you want to initialize input fields of the logical database, you need to find out the names of the fields. To do this for the logical database SAPDB<ldb>, use Transaction SLDB or choose Tools
ABAP Workbench, followed by Development Programming environ. Logical databases. You
can also display the technical information for the required field on the selection screen. To do
this, call the F1 help for the required field and then choose Technical info. In the field Scrn Field
of the following dialog box, you then see the name of the field used in the program.
<u><b>AT SELECTION-SCREEN OUTPUT</b></u>
event is triggered. This event block allows you to modify the selection screen directly before it is displayed.