Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Event INITIALIZATION

former_member463678
Participant
0 Likes
3,078

Hi,

I have a doubt that how many times the event INITIALIZATION

triggers in a program. Why?

Thanks in advance.

Zakir.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,940

Hi

Just only one time: before loading the selection-screen

Max

11 REPLIES 11
Read only

Former Member
0 Likes
1,941

Hi

Just only one time: before loading the selection-screen

Max

Read only

Former Member
0 Likes
1,940

hi

when u press f8 or execute INITIALIZATION event will trigger.

but after tht it will not trigger in prog.so only once time it will trigger whn u press f8.

correct me if m wrong.

Read only

Former Member
0 Likes
1,940

Hi,

You can use any number of times.

Example:

parameters: p_text(20).

initialization.

p_text = 'Hello'.

initialization.

initialization.

initialization.

p_text = 'Hi'.

initialization.

initialization.

Note: p_text contains only 'Hi'.

Read only

0 Likes
1,940

Hi, of course u may have many initalization events in your program, but they are triggered for the first time i..e before selection screen.

Read only

0 Likes
1,940

Hi, of course u may have many initalization events in your program, but they are triggered for the first time i..e before selection screen.

The driver program will scan for all events and executes all the initialization events on the order they have declared

Its poor practice to split same events , however they are valid .

Read only

Former Member
0 Likes
1,940

It triggers only once except the case highleted in NOTE below :

INITIALIZATION.

Effect

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.

Note

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.

do reward if helpful

Read only

Former Member
0 Likes
1,940

Hi

INITIALIZATION is triggered only once in report.

Initialization : triggered when the report is loaded in memory.

Read only

Former Member
0 Likes
1,940

Hi,

Initialization event is triggered only once before the selection screen comes. The selection parameter values given by default in the data declaration are overide by the values in the initialization event.

Reward.

Read only

Former Member
0 Likes
1,940

Hi,

Initialization event triggers only once before the selection screen. Using the event initialization we are giving default values to the selection screen feilds.

Thanks

Sarada

Read only

Former Member
0 Likes
1,940

Hi,

It triggers only one time. This event is triggered when you execute your program for the first time i.e., before selection screen is displayed.

Regards,

Bhaskar

Read only

prasanth_kasturi
Active Contributor
0 Likes
1,940

the event is triggered once when you execute the program.

but if your prog has a selection screen the event is triggered again when you press back button

but if you change the values on selection screen other than you define in initialization they are kept the same as screen fields have seperate memory.

ex : you initialized s_kunnr for 1000 to 1003

but while executin tou changed to 1 to 100

ater execution when you press back button selection-screen reappears but you will not have the default values you have 1 to 100

regards

prasanth