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

Initialization Event

Former Member
0 Likes
1,569

Hi All,

I am new to ABAP.Just heard about this site.....

My question is:

As we can assign default values to select-options in the selection screen itself by using default keyword.

But same thing we can do in initialization event....then

What is the difference in both techniques????

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,324

suppose you have material number, plant number, material group etc in the selection screen u can set default values to only them using default keyword but with initialisation u can set default values to any variables within the ABAP program and also those in the selection screen.

regards,

srinivas

<b>*reward points if helpful*</b>

8 REPLIES 8
Read only

Former Member
0 Likes
1,324

Hi,

It is used to perform authorization checks for TCODES

It is also used to do a one time selection from database tables.

Read only

Former Member
0 Likes
1,324

Hi Kiran,

In the selection screen you can initialize only those fields defined in the selection screen.

In the Initialization event you can do for other varaibles declared in the program

Regards

Arun

Read only

Former Member
0 Likes
1,324

U can do the same in selection screen also.

But initialization is to assign the initial values.

if u want to give the list of values for select-options as Default u can do here and if u want to give some default values for some variables u can do here.

u can define Ranges in Initialization event.

This is not only for Parameters Default option.

Reward Points if helpfull.

Read only

Former Member
0 Likes
1,325

suppose you have material number, plant number, material group etc in the selection screen u can set default values to only them using default keyword but with initialisation u can set default values to any variables within the ABAP program and also those in the selection screen.

regards,

srinivas

<b>*reward points if helpful*</b>

Read only

Former Member
0 Likes
1,324

HI

DEFAULT IS A KEYWORD

INITILIZATION IS A EVENT

BY USEING DEFAULT YOU CAN ENTER ONLY ONE VALUE

BY USEING INITIALIZATION YOU CAN ENTER HOW MANY VALUES YOU WANT

EX: SELECT-OPTIONS MATNR FOR MARA-MATNR DEFAULT '1000'.

ON SELECTION SCREEN YOU BY DEFAULT IT HAD ONLY ONE VALUE

EX:SELECT-OPTIOS MATNR FOR MARA-MATNR .

INITIALIZATION.

MATNR-LOW =

MATNR-HIGH =

MATNR-SIGN =

MATNR-OPTION =

APPEND MATNR.

INITIALIZATION.

MATNR-LOW =

MATNR-HIGH =

MATNR-SIGN =

MATNR-OPTION =

APPEND MATNR.

INITIALIZATION.

MATNR-LOW =

MATNR-HIGH =

MATNR-SIGN =

MATNR-OPTION =

APPEND MATNR.

LIKE THIS YOU CAN ENTER ANY NUMBER OF VALUES

REWARD IF USE FUL

Read only

Former Member
0 Likes
1,324

by giving default values..you can just assign some constants but cannot assign any variables

In INITIALIZATION event you can assign variable to them

INITIALIZATION.
 select single f1 into v_f1 where ...

  p_matnr = v_f1.

Read only

Former Member
0 Likes
1,324

Hi Kiran,

In initialization Event you can do calculation also. E.g. Suppose you want to print current data & the +30 days this calculation can do given in Initilization not as defalult value.

INITILIZATION.

s_date-low = sy-datum.

s_date-high = sy-datum + 30.

s_date-sign = 'I'.

s_date-options = 'BT'.

APPEND s_date.

Reward points if helpful answer.

Ashvender

Read only

Former Member
0 Likes
1,324

hi kiran

you can very well use the default values in select options like

... DEFAULT val1 [TO val2] [OPTION opt] [SIGN sgn]

in initialization event you just declare the variables saying that those variables are been used in the program..but the variables used in select-options goin to be dispalyed in the output screen....

Reward if useful kiran...!!