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
665

what happens if we write select statement in initialization event.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
642

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

4 REPLIES 4
Read only

Former Member
0 Likes
643

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

Read only

Former Member
0 Likes
642

Hi,

Nothing will happen..

Thanks

Naren

Read only

Former Member
0 Likes
642

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.

Read only

Former Member
0 Likes
642

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.