cancel
Showing results for 
Search instead for 
Did you mean: 

FIND with MATCH OFFSET not working

Former Member
0 Kudos

Hi,

I have a statement:

FIND '/' IN <ls_data_package>-/bic/zbib_sysn MATCH OFFSET off2.

this works in all the case except for when <ls_data_package>-/bic/zbib_sysn = SSULTANA-VMC/.

(i.e. when /bic/zbib_sysn = USERID-VMC/, here SSULTANA is the user ID)

*In this case off2 = .

Value of sy-subrc is 0 after this statement is executed

Can some one please point out what I am doing wrong.

Thank you,

CD

Edited by: CSD . on Sep 26, 2008 9:53 PM

Accepted Solutions (1)

Accepted Solutions (1)

matt
Active Contributor
0 Kudos

>FIND with MATCH OFFSET not working

Most unlikely. More likely is that it isn't doing what you think it should be doing. Or you're using it incorrectly!

I can't really follow what your problem is. I assume you mean that you are getting off2 with value 0, when /bic/zbib_sysn contains USERID-VMC/

Can you be a little clearer in what the issue is?

DATA: off2 TYPE i.
FIND '/' IN 'this string /' MATCH OFFSET off2.
WRITE: / sy-subrc, off2.

This little program returns 0 and 12

matt

Former Member
0 Kudos

Edited

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

i think U r doing in correct way .. .

sy-subrc is 0 bcoz itsfound that pattern ...

and wats the value of off2 ?

u can also mention FIRST OCCURENCE or ALL OCCURENCES ... read docmentation of FIND

Edited by: ganesh prasad on Sep 29, 2008 10:30 AM

Former Member
0 Kudos

off2 is of type i

value of off2 for this particular case of string becomes *

I also tried FIRST OCCURENCE or ALL OCCURENCES but no luck..

any other tips friends

Former Member
0 Kudos

hI,

wats the type of <ls_data_package>-/bic/zbib_sysn

I tried the same giving <ls_data_package>-/bic/zbib_sysn as char ... its working fine ...

Edited by: ganesh prasad on Sep 30, 2008 12:48 PM

Former Member
0 Kudos

Hi,

Check whether you have defined the type of field off2 correctly or not.

declare as : off2 type i.

and as you are using Field symbols, also check in debug mode whether the value is being populated in the field or not.

Regards,

Jyothi