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: 

Certain pattern in select option / range

Former Member
0 Kudos

For a certain field COMM1, I have to check if it contains a certain pattern 40050/####

where # = numeric characters.

For example:

COMM1 = AB40050/1234CD is valid,

COMM2 = 40050/12ABCD is not valid, since C and D are not numeric characters.

Is this possible via a range ?

Thanks for your feedback

5 REPLIES 5

Former Member
0 Kudos

Hello Kris,

Use the wildcard characters in SELECT statement

e.g.:

SELECT ............ WHERE comm1 LIKE '%40050/%' AND comm1 NOT IN (<f 1>, ......, <f n>).

Regards

Indu

ThomasZloch
Active Contributor
0 Kudos

Don't think this is possible in just one go. You'll probably have to select the '40050/++++' pattern first and loop through the result set, using the known CO or CN '0123456789' operation on the relevant part to toss out unwanted results.

I'm curious if somebody has a better idea.

Thomas

b_deterd2
Active Contributor
0 Kudos

Hi,

You could try checking the pattern through regex (regulatory expressions).

The abap statement is FIND REGEX followed by the expression. It is a bit complicated but once you understand it it's quit helpful for validating input.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/866072ca-0b01-0010-54b1-9c0...

regards,

Bert

Former Member
0 Kudos

Thanks, but as I understood from the presentation REGEX is only available as of release 7.0 ?

Guess i will need to proceed as Thomas suggested, will let u know the outcome...

cheers

Former Member
0 Kudos

Wrote my own function module to check patterns in a string...