‎2008 Nov 05 1:56 PM
Hello,
If i have multiple options in select options field then how should i sort these values?
Consider values are numeric and need to be sorted in ascending order.Help me with code.
‎2008 Nov 05 1:59 PM
Any specific reason why you want to sort the select options ?
regards,
Advait
‎2008 Nov 05 2:08 PM
I have to sort all values and take in to account the lowest one.
‎2008 Nov 05 2:10 PM
Hello Nilam,
if you want to sort teh select options then do it in this way.
SELECT-OPTIONS; S_MATNR FOR MARA-MATNR.
START-OF-SELCTION.
SORT S_MATNR BY LOW.
I hope I could understand your requirement.
Thanks,
Chidanand
‎2008 Nov 05 2:24 PM
Hi Nilam
Select options is also an internal table with structure sign,low, high etc...
as for itab you say sort table itab by f1 f2...
In the same way for so_matnr also sort table so_matnr by low(fied in select option's standard structure)
‎2008 Nov 05 6:51 PM
HI Nilam ,
Select otion is as internal table which consist sign ,option , low , high ...filed ...
here is not the seris of data ...you could no do that ...
you can do one thing ....
select all you data in an internal table ...using
Select f1 from database table into table itab
where f1 in s_f1 .
sort itab .
now put .....all ur itab data in range ...
range are like select option , except it does not creat selection screen .
range : r1 .
loop at itab .
r1-low = itab-f1.
append r1.
endloop.
now you have ur range (just like select option ) with sorted data.
thanks and regards...
Priyank Dixit
‎2008 Nov 05 7:00 PM
I don't think you've thought this question through.
What do you want if you have multiple overlapping ranges?
What do you want if you have NE?
What do you want if you have exclusions?
What do you want if you have patterns?
The proper way to do this is to SELECT the data using this SELECT-OPTION and then sort the selected set.
Rob