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

Instruction Search

Former Member
0 Likes
918

Hi experts,

I need to find in a string the point number... For exemple if var = 1.300.000, I have to find two points. So I used the Keywords "SEARCH" :

SEARCH var FOR '.'.

data pos type i.

clear pos.

IF sy-subrc = 0.

pos = sy-fdpos.

SEARCH var FOR '.' STARTING at pos.

IF sy-subrc = 0.

flag_errore = 'X'.

ELSE.

move var to valore.

ENDIF.

ENDIF.

but wheh I execute SEARCH var FOR '.'. I have sy-subrc = 4... Maybe I make an error when I use this istruction?

1 ACCEPTED SOLUTION
Read only

venkatesan_nagiah
Active Participant
0 Likes
450

SEARCH is obsolute, use FIND instead

example

DATA: result_tab TYPE match_result_tab.

FIND ALL OCCURRENCES OF REGEX `((ab)|(ba))`

IN 'abba'

RESULTS result_tab. l

venkat

Hi experts,

I need to find in a string the point number... For exemple if var = 1.300.000, I have to find two points. So I used the Keywords "SEARCH" :

SEARCH var FOR '.'.

data pos type i.

clear pos.

IF sy-subrc = 0.

pos = sy-fdpos.

SEARCH var FOR '.' STARTING at pos.

IF sy-subrc = 0.

flag_errore = 'X'.

ELSE.

move var to valore.

ENDIF.

ENDIF.

but wheh I execute SEARCH var FOR '.'. I have sy-subrc = 4... Maybe I make an error when I use this istruction?

2 REPLIES 2
Read only

venkatesan_nagiah
Active Participant
0 Likes
451

SEARCH is obsolute, use FIND instead

example

DATA: result_tab TYPE match_result_tab.

FIND ALL OCCURRENCES OF REGEX `((ab)|(ba))`

IN 'abba'

RESULTS result_tab. l

venkat

Read only

0 Likes
450

TKS!