cancel
Showing results for 
Search instead for 
Did you mean: 

SEARCH command

Former Member
0 Kudos

hi folks,

I have this simple one... but could not find the right answer

data: w_caseno(11) type c.

w_caseno = ' 023.456.7890 '.

SEARCH w_caseno for ' . '.

when I checked this, it gave the value as '4'.

the code did not work. also I cannot change the field to string data type. It should take the character type too. Is'nt it?

Any thoughts??

Thanks

SK

How can I correct this?

Thanks,

SK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello

you got value 4 in which field SY-subrc or SY-FDPOS .

if SY-FDPOS is 4 then i.e the offset where it finds the '.' .

if sy-subrc is 4 then your search was unsuccesful.

try like:

data : w_str type string.

w_str = w_caseno.

SEARCH w_str for ' . '.

& Check sy-subrc should be 0 & SY-FDPOS shold be 4 (the offset from starting where it finds the '.')

reward points if helpful

Former Member
0 Kudos

Thanks, I figured the problem out.

SK

Answers (0)