Application Development 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: 

select options to internal table

Former Member
0 Kudos

i have selected some values in the range say 100 to 200 using select options....is there any way to get these values in an internal table?

also does select option work with alpha numeric values

eg : if i want to select between a100 and b200?

1 ACCEPTED SOLUTION

former_member226519
Active Contributor
0 Kudos

what values do you want in an ITAB?

select * ... into table itab

will select the values according to the select-options

and the select-option is an internal table with fields

SIGN, OPTION, LOW, HIGH

8 REPLIES 8

Former Member
0 Kudos

No,

only doing it yourself with your own logic.

so first example

100,101,102,103,104 etc.

next example

a200,a201....,a998,a999,b000,b001......b199,b200

or if you want only values who exist in the corresponding databasetable read that table with the select-optoins and put those values in an internal table.

<edit: and i'm only talking about the use of BT here, not even exclusive or inclusive etc. so you get the potential treath? >

Regards,

Guido

Edited by: G. Bouman on Oct 16, 2008 10:13 AM

former_member226519
Active Contributor
0 Kudos

what values do you want in an ITAB?

select * ... into table itab

will select the values according to the select-options

and the select-option is an internal table with fields

SIGN, OPTION, LOW, HIGH

Former Member
0 Kudos

Hi,

Use can use like this

loop at seltab.

seltab-sign = 'I'

seltab-option = 'BT'

seltab-low = 1

seltab-high = 5.

endloop.

Thanks and Regards

Guru

Former Member
0 Kudos

Hello,

Select option is one type of internal table so if u want all the select-options to me moved to 2nd internal table create one structure for required fields.

First Loop the Select-option.

Move the value low and high to the internal table and append the internal table.

endloop.

Former Member
0 Kudos

i mean to say if i have 100 to 200.. i need 101 102 103 etc..continuosly till 200

0 Kudos

Hi..

suppose so_optn is the select option u are using..

U want to transfer it to tb_optn

U can do the same in the below way.

LOOP AT so_optn.

wa_optn-optn = so_optn-low.

APPEND wa_optn-optn TO tb_optn.

CLEAR wa_optn.

ENDLOOP.

here wa_optn is a work area of the same type as that of tb_optn.

revert back if more explanation is needed..

matt
Active Contributor
0 Kudos

>

> i mean to say if i have 100 to 200.. i need 101 102 103 etc..continuosly till 200

Select-options are really only useful for selecting data that matches the select-options from some other dataset. They don "expand out" into a set of values.

If you are always specifying a range in the selection screen, use two parameters - p_low, p_high.

You then will need to build your itab entry by entry. So

l_count = p_low.
WHILE l_count LE p_high.
  INSERT l_count INTO t_itab.
  ADD 1 to l_count.
ENDWHILE. 

For a100 to a200, you'd have to do some string slicing and concatenation to get the desired result.

0 Kudos

it is only possible with your own coding.

so user is filling select-options. when he is entering: A100 BT B200

do you want A100 to A999 and then B000 and so on or is it possible to have A999 and then AA00 and so on. the limitiation on the possiblities are your scope to program the list. But you have to program it with selfmade coding.

the next alphacharacter can be taken from a string filled with ABCDEFG.....YZ

the next numeric character can de calculated (add 1).

but when the user is filling the select-options he can also have more entries and also values who are not to be used, so you have to take that in account also.

so it is very tricky to do what you want. my advice is: DON'T TRY if the scope is to large.

Regards,

Guido