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 with pattern in interval

oliver_am
Active Participant
0 Likes
2,573

Hello,
Is it possible to use patterns in an interval in a select-options?

I need to select a field filtering only by the last 5 characters.

I can use CP in select-options and the character + or * but is not working with intervals.

You can test it in se16 in table KNA1 for example:

Tried also with * but not working.

How would you do it efficiently by code?

SAP_ABA 731.

Thanks!

6 REPLIES 6
Read only

FredericGirod
Active Contributor
0 Likes
2,093

? <-- replace 1 char

* <-- replace all char

if you do a *00070 to *00099, it should works

Read only

oliver_am
Active Participant
0 Likes
2,093

Like this?

SIGN I
OPTION BT "Tried also with CP
LOW *0070
HIGH *0099

Already tried before post, but is not working

Read only

FredericGirod
Active Contributor
2,093

Yep it does not work.

And certainly cannot work

Imagine you have the value 10070 20075 30099

even if you try to do a split interval you will have to do

10070 -> 10099

20070 -> 20099

30070 -> 30099

and to have the list of intervals, you have to do a full SELECT on the database to know the list of possible intervals

Read only

oliver_am
Active Participant
0 Likes
2,093

i konw...
so the unique solution is to select all the records of the table (thousands...) and the filter the data in my program... 😞

I'll suggest functional team not using intervals in this field

Read only

FredericGirod
Active Contributor
0 Likes
2,093

I already created a simple function to merge continuous value to recreate a "simplified" range, to prevent the max size of a RANGES

it replaces 0011 0012 0013 0015 to

I BT 0011 0013

I EQ 0015

it is not so complex, and simplify the next SELECT statement

Read only

RaymondGiuseppi
Active Contributor
2,093

Select-options allows either wildcard or range, not a mix of 'LIKE' and 'BETWEEN'. In recent versions you can use a function as operand such as RIGHT( expr,len ) but define a special range in your selection-screen.