‎2007 May 02 9:14 AM
Hi Friends,
Can i use At Selection-screen output in place of Initialization
for Initializing the default values on the selection-screen.
regds,
Vijay.
‎2007 May 02 9:17 AM
HI Vijay,
Initialization is for initializing value to the selection screen params..
At selection-screen is for Validation..
What is your requirement?
regards,
nazeer
‎2007 May 02 9:19 AM
I thinnk that if these two are diferent events in the report programming than you have to declare them seperately..... intializing at At selection screen event ...will do the same things anyways....
Regards,
Jayant
‎2007 May 02 9:19 AM
No you cannot do that
INITIALIZATION will trigger even before selection-screen is displayed , so the vales are updated and then displayed on selection screen
AT SELECTION-SCREEN will trigger after the selection screen is displayed , so you cannot have your default values if u write it here
‎2007 May 02 9:20 AM
Hi Vijay
<b>INITIALIZATION </b>
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.
In the PBO of the selection screen, the
<b>AT SELECTION-SCREEN OUTPUT</b>
event is triggered. This event block allows you to modify the selection screen directly before it is displayed.
Regards Rk
‎2007 May 02 9:21 AM
Hi,
For giving default values use directly default for parameters by giving value.
If you want ti manipulate the value of screen field, u have to do the processing in INITIALIZATION EVENT
AT SELECTION SCREEN OUTPUT is generally used if you want some filed to be displayed with some actions like marking a radiobutton or checkbox.
Thanks
Sandeep
‎2007 May 02 9:22 AM
Hi,
To set default value you can add 'DEFAULT' statement in Selection_Screen like this:
PARAMETERS: P_WERKS LIKE PA0001-WERKS OBLIGATORY DEFAULT 'IKPR'.
Or in INITIALIZATION event like this:
SELECTION-SCREEN BEGIN OF BLOCK BLC01 WITH FRAME TITLE TEXT-S10.
SELECT-OPTIONS: P_SPL FOR SY-DATUM.
SELECTION-SCREEN END OF BLOCK BLC01.
INITIALIZATION.
CONCATENATE SY-DATUM(4) SY-DATUM+4(2) '25' INTO P_SPL-HIGH.
CONCATENATE SY-DATUM(4) SY-DATUM+4(2) '01' INTO P_SPL-LOW.
P_SPL-LOW = P_SPL-LOW - 1.
CONCATENATE P_SPL-LOW(4) P_SPL-LOW+4(2) '26' INTO P_SPL-LOW.
APPEND P_SPL.
Regards,
‎2007 May 02 9:22 AM
Hi,
You can use the AT SELECTION SCREEN OUTPUT event to give the default values for the fields,this event also triggerd before the selection screen appear.
http://help.sap.com/saphelp_nw04/helpdata/en/79/34a234d9b511d1950e0000e8353423/content.htm
Regards
Sudheer
‎2007 May 02 9:23 AM
Initialization : it is used for declaration of data.
based on the data for validating selection screen we use' At selection screen '.
reward if useful
‎2007 May 02 9:28 AM
No: generally.
but yes, if u want to initalize value after some data is entered in select-options...
‎2007 May 02 10:20 AM
Hi,
'Initialization' is called only once i.e whenever user calls the program via transaction code.
AT SELECTION-SCREEN OUTPUT is called just before ever a selection screen is displayed.
for eg.
parameters: p_inp type i.
Initialization.
p_inp = p_inp + 1.
" value will be 1
At selection-screen output.
p_inp = p_inp + 2.
"value will be prev + 2.
When the user presses F8 the value displayed in selection screen will be 3.
Each and every time the user gives an 'ENTER' the value jumps by 2.
So you need to be very careful while initializing values in AT SELECTION-SCREEN OUTPUT. If you want to initialize selection variables only one time use INITIALIZATION.
If you want initialization or defaulting happening before selection screen is displayed go in for AT SELECTION-SCREEN.
eg.
Parameters: p_inp type i,
p_uzeit type t.
At selection-screen.
get time p_uzeit. "time field is updated every time enter or any user action is
done on the selection screen.
regards,
S. Chandra Mouli.