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: 

What is the difference between intialization and at selection-screen output

Former Member
0 Kudos

Hi

What is the difference between intialization and at selection-screen output events of a report?

thank You

17 REPLIES 17

Former Member
0 Kudos

initialization:

only once this will be triggered,at the time of starting the program execution

at selection-screen output

whenever selection screen displayes this event will be called

INITIALIZATION events in your program, this will be fired first when running the program, before the selection screen, if there is one, is fired. If there is a selection screen, the the AT SELECTION-SCREEN OUTPUT event will be fired automatically before the screen is shown

also check this link,

Message was edited by: Srikanth Kidambi

Former Member
0 Kudos

INITIALIZATION

when ever we want to assign a value to a variable only once for 1 program run we assign in this event

AT SELECTION-SCREEN OUTPUT

-->to do validations on the data entered

--> To make one input field enabled or disabled

--> to assign F4 help for a field

0 Kudos

initialization is triggered before the selection sreeen.

at selection-screen output is a event to change the properties of selection screen at run time.

anversha_s
Active Contributor
0 Kudos

hi subash,

more specifically,

First event -

Initialization : triggered when the report is loaded in memory.

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

rgds

anver

pls mark helpful answers

Former Member
0 Kudos

Hi

WIth initialization you can assign some value

Any of the fields displayed inthe selection scree.

Selection-screen:At selection-screen output even - you can set various properties of the selection-screen fields.

ex:hiding and making some field invisiable, input disbled, ..etc

regs

rams

0 Kudos

Thank you all for ur answers...

But I dont think so that there is any diference because when I put a dubugger on either of the two INITIALIZATION or AT SELECTION-SCREEN OUTPUT then both the events behave exactly the same.

Even after the executing of the program when we press F3 to return back to the slection screen then also, both the events are again triggered before the Selection screen is displayed.

So it can be concluded that whatever you can do in INITIALIZATION can also be done in AT SELECTION-SCREEN OUTPUT andvice versa.

Correct me if I am wrong.

Thank You

0 Kudos

hi subhash,

you are correct,

both will serve the purpose of data declaration.

rgds

anver.

0 Kudos

hi again,

1 So it can be concluded that whatever you can do in INITIALIZATION can also be done in AT SELECTION-SCREEN OUTPUT andvice versa.

Not Exactly.

2. Just take an example

3. In a BUKRS field,

we put default value of '1000'

in the event

at selection-screen output

4. Now, WHENEVER THE USER PRESSES

ENTER KEY (MULTIPLE TIMES)

our code will get fired,

and replace the values

inputted by the user eg. 2000.

regards,

amit m.

0 Kudos

Hi Amit..

thank You for clearing my doubt a little...

but your second point is not completely valid as in my case the value given by the user is not replaced by the one we have written in the At SELECTION-SCEREEN OUTPUT.

Is that ur point is ?

Thank you

0 Kudos

INITIALIZATION will be executed only once before the selection screen is displayed whereas AT SELECTION-SCREEN OUTPUT will trigger every time the user presses ENTER

Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used) and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.

0 Kudos

Hi again,

1. My point is that

2. eg. BUKRS = '1000'

3. If we write this is:

INITIALIZATION EVENT : then it will work normal and fine

AT SELECTION-SCREEN OUTPUT :

If the user changes the value to '2000'

and presses ENTER key

then our code will get fired once again,

and the value of bukrs will be 1000 again.

(If we write some IF Condition with

flag / oncedone flag,

then it is ok)

regards,

amit m.

Former Member
0 Kudos

initialiation : here u can initialize the variables and internal tables.

If u want to set a variable counter as 0 initially u can set it here.

also u can give refresh Itab...clear itab free itab in initialization.While executing the program it will be activated first and it will initalize the variable and itab..

also u can set ranges here...also u can set select option ranges here...This will be executed only once for a program

At-selection srceen: this will be activated next...

this will be actiated as PBO of the selection screen.before displaying the selection screen this will be activated...here u can set the selection screen default things...like value setting and disable visible optyions.

Former Member
0 Kudos

Hi Subhash,

You can have a look at the documentation in this link-

It details all the Reporting Events.

http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm

Hope this helps!

Regards,

Saurabh

Former Member
0 Kudos

Hi subhash,

1. Initialization = ONLY ONCE

2. at selection-screen output

a) when the screen is showed first time

b) whenever we press ENTER and the screen is refreshed again

c)whenver any fcode gets fired (radiobutton,checkbox, listbox etc)

regards,

amit m.

former_member223537
Active Contributor
0 Kudos

Hi,

You need to build the code under AT SELECTION SCREEN OUTPUT inorder to handle all the fields. Program wont do automatically.

For eg. :

1. I select radio button 1, immediately AT SELECTION SCREEN OUTPUT is executed

2. I change the radio button selection from 1 to 2, immediately AT SELECTION SCREEN OUTPUT is executed.

So unitl i dont click on EXECUTE button, and keep on changing selection from one radio button to another, the event would be executed.

Best regards,

Prashant

0 Kudos

hi ,

actually AT SELECTION SCREEN OUTPUT is like the PBO of

a module pool program.

when ever an event is triggered, it will go to PAI in module pool and come backs to PBO.

like that AT SELECTION SCREEN OUTPUT can do manipulations depends upon the user actions.

but initilization is like the TOP include of the MODULE POOL Program.

triggered only once.

hope ur doubt cleared

rgds

anver

if hlped mark points

Former Member
0 Kudos

Initialization:

This event occurs before the standard selection screen is called. 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.

If you want to initialize input fields of the logical database, you need to find out the names of the

fields. To do this for the logical database SAPDB<ldb>, use Transaction SLDB or choose Tools->ABAP Workbench, followed by Development -> Programming environ. -> Logical databases. You can also display the technical information for the required field on the selection screen. To do this, call the F1 help for the required field and then choose Technical info. In the field Scrn Field of the following dialog box, you then see the name of the field used in the program.

Selection screen processing starts after the INITIALIZATION event with AT SELECTION SCREEN OUTPUT.

In the PBO of the selection screen, the AT SELECTION-SCREEN OUTPUT event is triggered. This event block allows you to modify the selection screen directly before it is displayed.

PARAMETERS: TEST1(10) MODIF ID SC1,

TEST2(10) MODIF ID SC2,

TEST3(10) MODIF ID SC1,

TEST4(10) MODIF ID SC2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INTENSIFIED = '1'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

IF SCREEN-GROUP1 = 'SC2'.

SCREEN-INTENSIFIED = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers