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

FIND doesn't find my pattern

dominik_klaffke
Participant
0 Likes
734

Hi all,

I'm using function

FIND `##` IN l_text MATCH OFFSET l_off.

to search the pattern '##' in string l_text. But the function fails and returns sy-subrc = 4. The pattern '##' is definitely included in l_text. What am I doing wrong?

Regards,

Dominik

Hi all,

I'm using function

FIND `##` IN l_text MATCH OFFSET l_off.

to search the pattern '##' in string l_text. But the function fails and returns sy-subrc = 4. The pattern '##' is definitely included in l_text. What am I doing wrong?

Regards,

Dominik

6 REPLIES 6
Read only

Former Member
0 Likes
703

Hi Dominik,

Try with SEARCH.

Regards,

George

Read only

0 Likes
703

data l_text(20).

data d1 type i.

l_text = 'amit##tyagi'.

FIND '##' IN l_text MATCH OFFSET d1.

if sy-subrc = 0.

write d1.

else.

write ' not found'.

endif.

Read only

former_member582701
Contributor
0 Likes
703

try sentence SEARCH.

SEARCH i_text FOR '###'

Read only

Former Member
0 Likes
703

The had ## you see in not ##. it must be an end of line character.

Read only

0 Likes
703

Hi,

I tried

FIND `##` IN l_text MATCH OFFSET l_off IN CHARACTER MODE.

It doesn't work.

I'm sure it's an end-of-line-character. But how can I find 2 end-of-line-characters in a text if the solution above doesn't work?

Best regards,

Dominik

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
703

HI,

My try with addition IN CHARACTER MODE.

Regards,

Sesh