2006 Dec 28 10:52 AM
It is defined that initialization event is used to set the default values before execution of report. However it can be done by direct giving initial value (e.g. a = b). Then why do we use INITIALIZATION event?
It is defined that initialization event is used to set the default values before execution of report. However it can be done by direct giving initial value (e.g. a = b). Then why do we use INITIALIZATION event?
2006 Dec 28 10:56 AM
it is not mendatory depend upon u ...
Initialisation -> This event is used when ever you initialize any variable or a field in your program.
this indicates the start of program .It is similar to Load of program .
this is the first event executed as the program is executed .
2006 Dec 28 10:58 AM
Hi
This is the event which fires first, even before your selection screen pops up...
So any variables/ranges etc which need to be initialized should be populated in <b>Initialization </b>section... its a good programming practice to initialize all variables, workareas etc in Initialization section, and use them wherever required in the program flow.
Regards,
Raj
2006 Dec 28 11:00 AM
Think that you have to select some data from any table like mara for the current date.In initialization event you can select that data from table and you can enter that data on the selection screen on execution.
2006 Dec 28 11:00 AM
Hi Dinesh Singh,
If u r giving any value in Initialization , then it will execute when the event gets triggered, But when u give any value (e.g a = b) it will come defaultly.no execution required.
Reward me if it helps,
BALU.
2006 Dec 28 11:02 AM
Hi,
With INITIALIZATION, we not only give the initial values but we can give the values to the screen fields, gui elements based on any conditions as per the requirement.
regards
Rakesh
2006 Dec 28 11:13 AM
The event which gets triggered is INITIALAIZATION even before your selection screen pops up. So, if U need any variables to be initialized on selection screen as soon as it is shown, the variables are declared in the initialization part. It is very much useful as such.
Say, if u have a date field u can initialize as sy-datum.
for Orders u can give a range of values and initialize them for the selection screen.
As such initialization is very much useful in programming.
2006 Dec 28 11:28 AM
Good ideas made me to get the answered for this dount in my mind...
2006 Dec 28 11:31 AM
ex-
REPORT ...
PARAMETERS: pa_date LIKE sy-datum DEFAULT sy-datum.
INITIALIZATION. " Default values for selection screen
pa_date = pa_date - 7.
START-OF-SELECTION. " Start of data processing
WRITE pa_date.INITIALIZATION is an event that you can use if you need to set a large number of default values. This
event block allows you to set default values that can only be determined at runtime. In the above
example, the date 'A week ago' is calculated and placed in data object pa_date. The ABAP runtime
system then sends a selection screen to the presentation server containing the calculated value as a
default. The value can, of course, still be changed.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |