Application Development 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: 

Initialization Event.

Former Member
0 Kudos

what is the use of Initialization event and what we need to declare in Initialization event.

Plz answer quickly with an example,urgently needed?Points will be awarded undoubedly.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Initialization is nothing but when the program starts to run the INITIALIZATION event 'll be called first... i.e, before start of selection this event 'll be called..... In initialization event u can initialize the variable values.

for eg:

SELECT-OPTIONS: A1 FOR MARA-MATNR.

INITIALIZATION.

A1-LOW = '100'.

A1-HIGH = '1000'.

APPEND A1.

Thanks,

Arunprasad.P

Reward if useful.

4 REPLIES 4

Former Member
0 Kudos

Hi,

Initialization is nothing but when the program starts to run the INITIALIZATION event 'll be called first... i.e, before start of selection this event 'll be called..... In initialization event u can initialize the variable values.

for eg:

SELECT-OPTIONS: A1 FOR MARA-MATNR.

INITIALIZATION.

A1-LOW = '100'.

A1-HIGH = '1000'.

APPEND A1.

Thanks,

Arunprasad.P

Reward if useful.

venkat_o
Active Contributor
0 Kudos

Hi ajaya moharana, INITIALIZATION:It is triggered before the standard selection screen is displayed. You can use it, for example, to initialize the input fields of the standard selection screen. This is the only possible way to change the default values of parameters or selection criteria defined in logical databases. To change a selection criterion, you must fill at least the components <seltab>-SIGN, <seltab>-OPTION, and <seltab>-LOW of the selection table <seltab>, otherwise it remains undefined. To fill normal selection screen fields u can use You can use AT SELECTION-SCREEN OUTPUT event as well. Ex:

PARAMETERS DATUM TYPE SY-DATUM DEFAULT SY-DATUM.

INITIALIZATION.
datum = sy-datum.
I hope that it helps u . Regards, Venkat.O

Former Member
0 Kudos

Hi,

In many cases you need to calculate the value and then put it in selection criteria. For example, say, you are accepting date from user and you need to fill in the default value for lower range as sy-datum ? 30 days and sy-datum for higher range. In this case you are calculating lower range and then filling the criteria. This can be done in INITIALIZATION event. Piece of code to do the above task would look like the following:

Tables: Sflight.

Select-options: fldate1 for sflight-fldate.

INITIALIZATION.

Data: date1 like SY-DATUM.

Date1 = sy-datum ? 30.

Fldate1-low = date1.

Fldate1-high = sy-datum.

Append fldate1.

Here appending is required because fldate1 is int? table

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

Pls. reward if useful....

Former Member
0 Kudos

Hi,

To initalise the values to the selection screen parameters.

Selection-screen : p_matnr like matnr.

initialization.

P_matnr = '10290'.

when you execute the report the parameter value will be automatically 10290

is assigned.

otherwise you can do manipulations too.

Selection-screen : p_date like sy-datum.

initialization.

P_matnr = sy-datum - 10.

This will dynamically validates the sytem date by difference with

10 to the parameter.

Regards,

Madhavi