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 options using standard datatype?

Former Member
0 Likes
4,216

Hi guys,

Can I use select optionswithout a database field?

See, my requirement is that the user should enter minimum and maximum value of numeric type.I don't want to declare two parameters for this. Can I use the select options. if yes, how?

Select-options p_num for n.

after for, the type we are mentioning must refer some field from database table only or can it be a normal datatype like c,n etc?

Thanks a lot!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,589

Hi,


Yes,  We can use a select options without db table.


DATA: n(5) TYPE n.

SELECT-OPTIONS: s_num FOR n.

instead of n you can use any type( c, p, x etc).


4 REPLIES 4
Read only

Former Member
0 Likes
3,589

Hi Rose,

pls thry below logic

  data: num type n.
Select-options p_num for num .

Thanks & Regards,

Polu

Read only

Former Member
0 Likes
3,590

Hi,


Yes,  We can use a select options without db table.


DATA: n(5) TYPE n.

SELECT-OPTIONS: s_num FOR n.

instead of n you can use any type( c, p, x etc).


Read only

Former Member
0 Likes
3,589

Hi Rose,

Select-options always refers to an exiting dobj so you can use the following methods.


report test.

data lv_var TYPE  n.
data ls_struct TYPE vbak.
data lv_vkorg TYPE vbak-vkorg.

SELECT-OPTIONS:
   s_var for lv_var,
   s_vbeln for ls_struct-vbeln,
   s_vkorg for lv_vkorg.

Thanks

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,589

Read SELECT-OPTIONS documentation for FOR option : you have to use either an existing data object (e.g. any field defined in a DATA statement) or a ddic type reference. So if you define a field (before the statement) you are not required to use ddic reference.

Regards,

Raymond