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

select option

Former Member
0 Likes
560

Hello,

I want to use a default value in select-option.

I am getting the default value from the table , storing it in a variable and using this variable in the select-option.

but this is not working.

please let me know how to handle this.

Thanks.

Ramya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
543

hi,

You have to populate default values for a select-option in Initialization event.

check this code.

tables : mara.

types : begin of ty_mara,

matnr type mara-matnr,

end of ty_mara.

data: t_mara type table of ty_mara,

wa_mara like line of t_mara.

select-options : s_matnr for mara-matnr.

Initialization.

select matnr

from mara

into table t_mara.

if sy-subrc eq 0.

s_matnr-sign = 'I'.

s_matnr-option = 'EQ'.

loop at t_mara.

s_matnr-low = t_mara-matnr.

append s_matnr.

endloop.

endif.

Regards

Sailaja.

5 REPLIES 5
Read only

Former Member
0 Likes
543

Hi Ramya,

Just post the coding you are using then we can have a look!

Regards,

John.

Read only

venkatakalyan_karanam
Active Contributor
0 Likes
543

Hi Ramya

Please give the select statement so that i can say whether its correct select statement and also whether its working or not.I can help you if you give the statement.

Regards

Kalyan

Read only

Former Member
0 Likes
544

hi,

You have to populate default values for a select-option in Initialization event.

check this code.

tables : mara.

types : begin of ty_mara,

matnr type mara-matnr,

end of ty_mara.

data: t_mara type table of ty_mara,

wa_mara like line of t_mara.

select-options : s_matnr for mara-matnr.

Initialization.

select matnr

from mara

into table t_mara.

if sy-subrc eq 0.

s_matnr-sign = 'I'.

s_matnr-option = 'EQ'.

loop at t_mara.

s_matnr-low = t_mara-matnr.

append s_matnr.

endloop.

endif.

Regards

Sailaja.

Read only

Former Member
0 Likes
543

Try this logic

tables: spfli.

select-options: p_carrid for spfli-carrid.

initialization.

p_carrid-low = 'aa'.

p_carrid-high = 'bb'.

append p_carrid.

If usefull rewards points helpfull.....

Read only

Former Member
0 Likes
543

Hi,

You have to write a select statement in the initialization event and get the value and pass the value to the selection screen parameters.

Thanks,

Sriram Ponna.