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

Events

Former Member
0 Likes
1,657

what is the use of initialization and at-selection screen?why cant we define the things in at selection event instead of defining in initialization ? what happens?

what is the use of initialization and at-selection screen?why cant we define the things in at selection event instead of defining in initialization ? what happens?

16 REPLIES 16
Read only

bpawanchand
Active Contributor
0 Likes
1,638

Hi

IINITIALIZATION

IS THE event we initialize the data objects that are used localy in the program or selection-screen elements

AT SELECTION_SCREEN

we validate the selection screen elements in this event

Regards

Pavan

Read only

Former Member
0 Likes
1,638

Hi ,

Initialization event is used for to initialize the selection screen values.

At selection screen event is used to validates the selection screen values.

Regards,

kv.

Read only

Former Member
0 Likes
1,638

Hi Gopal,

Initialization event is used to assign default values to the fields in the selection scree.

At selection Screen is used for the validation of the selection screen elements. We can only validate ifields in At selection screen event, at field level, block level and screen level.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

0 Likes
1,638

if we define that default values in start of selection what happens? it accepts r shows any msg

Read only

0 Likes
1,638

Hi

Well if you define even in the START-OF-SELECTION then also they are initialized but before executing the START-OF-SELECTION event if at all we need to initialize then use INITIALIZATIOn

Regards

Pavan

Read only

Former Member
0 Likes
1,638

hii

initialization event is used when you want to initialize some fields with values.it is actualy work when you press f8.after initialization event at selection screen event trigger.it is used for displaying that result or fields on the screen.so if you want to write some logic to display at selection screen ..you can write it in initialization event.

regards

twinkal

Read only

Former Member
0 Likes
1,638

Hi Gopal,

INITIALIZATION :it is executed before your selection is displayed and triggered only once, it is generally used to specify default values on your selection screen which are based on some calculation.

and AT SELECTION-SCREEN OUTPUT: its aPBO event of your selection screen and triggered every time user press enter, its generally used if tou want to MODIFY SCREEN based on some input .

and other are AT SELECTION SCREEN of field, AT SELECTION SCREEN on block and

AT SELECTION SCREEN events, this are mainly for validation, all this are PAI event of your selection screen.

With luck,

Pritam.

With luck,

Pritam.

Edited by: Pritam Ghosh on Jul 9, 2008 1:51 PM

Edited by: Pritam Ghosh on Jul 9, 2008 1:52 PM

Read only

Former Member
0 Likes
1,638

hi,

Initialization Event is used to initialize ie if our default values are based on some calculations then we can use the INITIALIZATION Event.

At SELECTION-SCREEN is a selcetion screen event. This event is used to check the global validations on the selection screen elements.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
1,638

Hi!

Both INITIALIZATION and AT SELECTION-SCREEN OUTPUT

are triggered before selection screen is displayed,but when in Initialization is triggered only once and AT selection-screen output event is triggered multiple times.

If you specify default value in AT SELECTION-SCREEN OUTPUT then that value can be changed but if you press enter

then that value becomes old default value, while INITIALIZATION

default value can be changed, and by pressing enter INITIALIZATION will not be triggered

Check out this sample code.


REPORT z_sdn.

PARAMETERS:
  p_num TYPE i.


INITIALIZATION.
  p_num = 3.

AT SELECTION-SCREEN OUTPUT.
  p_num = 4.


START-OF-SELECTION.
  WRITE: p_num.

Regards

Abhijeet Kulshreshtha

Edited by: Abhijeet Kulshreshtha on Jul 9, 2008 1:53 PM

Read only

0 Likes
1,638

thanks for ur answer i got it

Read only

Former Member
0 Likes
1,638

Hi Gopal ,

Sap have provided different event to control your program flow. every event have it own task.

Initialization.

Normally this Event User to initialize the select option and parameter with some values.

Means this event is used to initialize the variable with some values.

it trigger when you start executing the program or press F8.

At-Selection-Screen

Normally This event is used to validate user Input. It trigger once user input some data in screen and press enter. At that time if we want to put some validation we can do better.

I hope now it is clear to you.

good Luck

Swati Namdev

Edited by: Swati Namdev on Jul 9, 2008 5:26 PM

Read only

Former Member
0 Likes
1,638

Hi,

Initialization means

Initialization : triggered when the report is loaded in memory.

Automatically place values in the selection screen.

At selection-screen output : triggered when the selection screen is loaded in memory before being displayed.

At selection-screen / <field> : before leaving the selection screen.

For Validations.

hope this helps you.

Thanks & Regards,

Y.R.Prem Kumar

Read only

Former Member
0 Likes
1,638

Hi,

Initialization event is triggered befor the screen comes.

And if you want to change any default values of the screen elements you can do it in Initialization event.

i.e If you want to do any calculations before screen is displayed then write it in Initialization event.

At selection-screen event is for validating the user inputs.

Initialization event is triggered only once when you execute the program.

But At selection-screen event is triggered more than one time.

When any error occured on the screen at selection-screen event is triggered, and the process is stoped there .

if you currect the error and when the program is executed again At selection-screen is triggered.

Regards,

Rajitha.

Read only

0 Likes
1,638

adding to what rajitha was saying ...

INITIALISATION is used to initialise the selection screen field values..so that we can have adefault value.

AT selection screen output is used to validate the selection screen field values and gives the option to change the fields dynamically

Read only

Former Member
0 Likes
1,638

hi,

Initialisation triggers before selection screen is displayed.

with initialisation user can provide input values to the selection screen.

select-options : vendor for lfa1-lifnr.

initalization.

vendor-sign = 'I'

vendor-option = 'BT'

vendor-low = 500

vendor-high = 1500

Append vendor.

At -selection screen :when user enters the values in the selection screen and clicks on execution button.

this events gets triggered. basically for checking the the values entered by the user for the fields of the selection screen.

data validity checking.Is for validations in ABAP reports.

Read only

Former Member
0 Likes
1,638

Hi Gopal Krishna.

INITIALIZATION: This is an event which is triggered before the standard selection calling.

Use: Initialization is always used to provide an initial constant value to the variable only once after starting of the program.

Here, we can change the standard values passed to the parameters or variables of the program.

AT SELECTION-SCREEN:

This is an event when the selection screen which is automatically called between INITIALIZATION and START-OF-SELECTION.

This literaly means when we select the line for which it triggers this event and directs to the event START-OF-SELECTION which goes the processing of records.

This statement (AT LINE-SELECTION) is very vital as triggering the lists depends upon this statement.

Another system field related to this event is SY-LINNO.

If we put INITIALIZATION in AT SELECTION-SCREEN Event it really does not make a difference as the events are executed or triggered in the predefined order.

Good Luck.

Harsh