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: 

SEARCH pattern

Former Member
0 Kudos

Hello Experts,

I have text parameter on selection screen. if the text entered as ad then it should give all possible strings which will containg "ad".

I am using SEARCH statement but it is not working with ad or ad or ad. It is giving me blank output.

I have all the data in the internal table and just want to display records which will have this kind of pattern.

Appreciate your help.

Thanks in advance

Saurabh

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi,

I donot think search is required here. Instead of parameters declare it as select option with no intervals and extension ( looks similar to parameter ). Then use a loop statement like.

loop at it where field in s_so1.

endloop.

BR

keshav

5 REPLIES 5

Former Member
0 Kudos

Hi,

Move the values from the internal to a range table and provide information like below.

ra_data type range of ty_data.

wa_data-sign = 'I'
wa_data-info = 'CP'
wa_data-low = wa_itab-pattern
append wa_data to ra_data.

Then use search statement in this range table.

SEARCH 'ad' IN ra_data.

Else try like below.

FIND ALL OCCURRENCES OF REGEX 'ad' 
  IN TABLE itab 
  RESULTS results.

Hope this works.

Former Member
0 Kudos

when you are at programming it anyway, let you be told that SEARCH is obsolete. Adopting to the modern times you should use FIND instead.

SharathSYM
Contributor
0 Kudos

Try this,


DATA result_tab TYPE match_result_tab.

FIND ALL OCCURRENCES OF REGEX '(ad)' IN TABLE t_table
RESULTS result_tab.

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi,

I donot think search is required here. Instead of parameters declare it as select option with no intervals and extension ( looks similar to parameter ). Then use a loop statement like.

loop at it where field in s_so1.

endloop.

BR

keshav

0 Kudos

nice solution, just dont forget to check if s_so1 is empty before doing so, since an empty select option states always correct.