2011 Jun 07 12:56 PM
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
2011 Jun 07 3:26 PM
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
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
2011 Jun 07 1:29 PM
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.
2011 Jun 07 1:36 PM
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.
2011 Jun 07 2:31 PM
Try this,
DATA result_tab TYPE match_result_tab.
FIND ALL OCCURRENCES OF REGEX '(ad)' IN TABLE t_table
RESULTS result_tab.
2011 Jun 07 3:26 PM
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
2011 Jun 07 3:45 PM
nice solution, just dont forget to check if s_so1 is empty before doing so, since an empty select option states always correct.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |