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

Hi, why initialization is always triggered?

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Likes
1,537

I was told that initialization is only executed once, but when I did a program to test, I found that's not true. if I output nothing in start-of-selection, then the program return to selection screen, and the initialization is executed again.

now I don't want the initialization to be executed again, how can I do that?

I was told that initialization is only executed once, but when I did a program to test, I found that's not true. if I output nothing in start-of-selection, then the program return to selection screen, and the initialization is executed again.

now I don't want the initialization to be executed again, how can I do that?

6 REPLIES 6
Read only

former_member404244
Active Contributor
0 Likes
1,192

Hi,

Initilization event is used to set default values only.so don't bother whther it s triggered second time.

Regards

Nagaraj

Read only

former_member183804
Active Contributor
0 Likes
1,192

Hello Peter,

INITALIZATION is called only once. per internal mode of course. Your case seems to target the login/user session. In this case you may use set/get Parameter.

Regards,

Klaus

Read only

Former Member
0 Likes
1,192

I did not get your query completely but what I can make out is that for sure Initialization is executed only once but as you said you are writing anything to output and hence it displays the selection-screen again on completion of the run and that time it does execute initialization event but that is for run 2 and not the first run as that is already complete.

Regards

Anurag

Read only

Former Member
0 Likes
1,192

initialization is an event which gets triggered as many times as selection screen gets triggered....So, when u return to selection screen then initialization gets triggered....If u want other way write ur code in At selection screen.

Read only

Former Member
0 Likes
1,192

Hi Peter ,

The event is trigger each time the selction -screen is displayed .

Yes when you come back to the selection screen after diaplying some thing the event is triggered but i do not think i makes any chnages to the already existing values in the selection screen,

Regards

Arun

Read only

Former Member
0 Likes
1,192

Initialization event is used to design the screen, before the program is executed.

It is not possible to control its execution in exe programs.

Where as 'Process before output' is also very similar to 'initialization' event in report.

Here the code we generate should repeat every time for the action happened on screen. If we need to write a select statement in PBO event, we need to see that, it should be executed only once. Otherwise it executes for every action in PAI.

PBO.

if itab is initial.

select * from mara into table itab.

endif.

then PAI follows.

Hope It helps.

Cheers.