‎2007 Jun 19 4:34 PM
what happens if we write select statement in initialization event.
‎2007 Jun 19 4:40 PM
Data will be retrieved before even the selection screen is displayed to the user.
Sometimes it is required.
F.g if i want to default the Printer name paramter with defualt printer of a user then we need to select the data in initialization like below.
INITIALIZATION.
SELECT SINGLE spld INTO p_printer WHERE bname = sy-uname.
Now when the program is executed the selection screen parameter P_PRINTER will have the printer name.
Reward if its useful
Regards,
Sail
‎2007 Jun 19 4:40 PM
Data will be retrieved before even the selection screen is displayed to the user.
Sometimes it is required.
F.g if i want to default the Printer name paramter with defualt printer of a user then we need to select the data in initialization like below.
INITIALIZATION.
SELECT SINGLE spld INTO p_printer WHERE bname = sy-uname.
Now when the program is executed the selection screen parameter P_PRINTER will have the printer name.
Reward if its useful
Regards,
Sail
‎2007 Jun 19 4:40 PM
‎2007 Jun 19 4:40 PM
The Select would be executed without any problems....But your going to be able to filter by using Parameters or Select-Options -:) You will need to filter later....
Greetings,
Blag.
‎2007 Jun 19 5:10 PM
Hi,
It is not only the parameters default value
which are required/accessed/controlled
in initialization event.
In a program there are so many variables,
the values of these variables
can be set in intiailization event.
Such values sometimes cannot be hardcoded.
They may be requried to fetch from database
or do some calculations,
(which is not possible while declaration
data and parameters)
Sometimes, some variant can also be imported
for selection screen.
This event is invoked directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen.
This gives you the one-time opportunity to initialize the input fields of the selection screen, including those defined in the logical database linked with the program.
When run in background, values initialized in initialization event are considered.
For eg: if you want to initialize like this:
carrid-sign = 'I'.
carrid-option = 'EQ'.
carrid-low = 'AA'.
carrid-high = 'LH'.
APPEND carrid TO carrid.
You cannot achieve this by giving 'default' or 'value' at selection-screen.