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

About Event 'INITIALIZATION'

kammaje_cis
SAP Mentor
SAP Mentor
0 Likes
2,110

Hi, I am using event Initialization to assign default values to the selection screen date fields.

When I go to SE38 and execute the program, it is showing those default values, but when I use the Transaction code directly, these default values are not getting assigned.

I debugged and found that INITIALIZATION is not getting triggered when I use the TCode, but gets triggered when I execute from the SE38 editor.

Here is the code.

Selection screen fields are declared in a separate INCLUDE.

In the main program,

INITIALIZATION.

p_begda = sy-datum - 1.

Please let me know your views.

Thanks

Krishna

8 REPLIES 8
Read only

Former Member
0 Likes
1,311

try to set the initial value in the declaration?

parameters: p_begda type .... value gv_date.

initialization.

gv_date = sy-datum - 1.

regards,

lavanya

Read only

Former Member
0 Likes
1,311

Hi,

Your code is good, check the tcode once again, I tried with below code by running the tcode for the below report, it is working fine.

REPORT ztest_initi.

PARAMETERS: p_date TYPE d.

INITIALIZATION.

p_date = sy-datum - 1.

Thanks,

Ravi

Read only

prasanth_kasturi
Active Contributor
0 Likes
1,311

Hi

I tried putting selection screen and initilization in different includes but I am getting values on the selection screen.

think there is no prob in this

try default edition of parameters otherwise

regards

prasanth

Read only

Former Member
0 Likes
1,311

Hi,

I tried with the below code using tcode for the program . It is working fine i am getting the date.

PARAMETERS:

p_date TYPE d.

INITIALIZATION.

p_date = sy-datum - 1.

Read only

Former Member
0 Likes
1,311

Hi Krishna

Initialization event is used when you execute your report first of all the initialization event will trigger where you can check the authorisation of hte report etc......

&**********Reward point if helpful***********&

Read only

1,311

Thanks everyone for the response.

I solved the problem myself.

Soln: The problem was that, the Tcode was declared as 'Program and Screen'. I changed it to 'Program and Selection Screen'. Now the initialization is getting triggered.

Thanks

Krishna

Read only

Former Member
0 Likes
1,311

Hi ,

I think you want to show default values to your parameters on the selection screen.

So, why dont use the DEFAULT addtion with the parameter .

Read only

Former Member
0 Likes
1,311

Hi,

While creating T code in start object tab select radio button "program & selection screen".

& in next screen under GUI support tab check box SAPGUI gor HTML & SAPGUI for windows. i hope ur prlbm is solved..