‎2007 Apr 13 9:19 PM
what is difference between DEFAULT and INITIALIZATION?
give simple example
‎2007 Apr 13 9:30 PM
Hi,
Initialization is the section where the initialization of internal tables, variables, select-option fields, parameters etc takes place.
True, that you can default the values too for parameters/select-option fields in selection-screen.
This event is invoked 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 run in background, values initialized in initialization event are considered.
For eg: if you want to initialize like this:
carrid-sign = 'I'.
carrid-option = 'EQ'.
carrid-low = 'AA'.
carrid-high = 'LH'.
APPEND carrid TO carrid.
You cannot achieve this by giving 'default' or 'value' at selection-screen.
Regards,
Ferry Lianto
‎2007 Apr 13 9:39 PM
hi
DEFAULT is used to set default values for the screen fields.
But INITIALIZATION is used to initialize the selection screen apart from setting default values
to the input fields..Confused?? Well,Suppose You want to display current date - 7 in the
selection screen input field..You cannot do so direcly using default alone..You need to do the
validation on the INITIALIZATION event.
something like sy-datum = sy-datum - 7
Cheers,
Hakim
‎2007 Apr 14 4:49 AM
Hi,
Using default u can set the default value without any Conditions. But if u want to have default value based upon some conditions then u can use INITIALIZATION event. There is one more way of having default values and that is using SAP MEMORY
‎2007 Apr 14 5:26 AM
hi,
This event is triggered when you execute your program for the first time i.e., before selection screen is displayed.
eg : 1
initialization.
if p_date is initial.
p_date = sy-datum + 7.
endif.
select-option : fldate1 for sflight-fldate.
eg2 : INITIALIZATION.
Data : date1 like sy-datum.
date1 = sy-datum - 30.
fldate1-low = date1.
fldate1-high = sy-datum.
append fldate1.
Default :
If you want to display DEFAULT VALUES for the selection criteria before your screen is displayed
eg : select-option : s_matnr for mara-matnr defaut '000098' to '76809067'.
hope this helps you.
sri