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

how to find pattern in string

varunchaturvedi
Product and Topic Expert
Product and Topic Expert
0 Likes
1,292

DATA: v_flight TYPE C LENGTH 17 VALUE '#*AA-0017-JFK-SFO',
v_pattern TYPE C LENGTH 2 VALUE '##*'. "* represents 0 or more characters
SEARCH v_flight FOR v_pattern.
WRITE :/ sy-subrc.
IF sy-subrc = 0.
WRITE:/ 'Carrier id pattern contains flight details.'.
ELSE.
WRITE:/ 'Carrier id pattern does not contain flight details.'.

ENDIF.

I want to find pattern # in first string but this not work. how can i find?

3 REPLIES 3
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,137

SEARCH FOR is obsolete since long.

Use FIND. Read the documentation.

Read only

matt
Active Contributor
0 Likes
1,137

"not work". Very specific.

Perhaps a little more detail would help get some answers?

Read only

varunchaturvedi
Product and Topic Expert
Product and Topic Expert
0 Likes
1,137

output is shown below .