Application Development 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: 

String Relational Operators

Former Member
0 Kudos

Hi,

I have one string as 'ABCD#XYZ'

I want to find out the index of # from this string.

How can i do that.

Please help me.

Regards,

Deepak.

1 ACCEPTED SOLUTION

former_member181995
Active Contributor
0 Kudos

Keyword FIND/Search?

SY-FDPOS??

6 REPLIES 6

former_member181995
Active Contributor
0 Kudos

Keyword FIND/Search?

SY-FDPOS??

Former Member
0 Kudos

Hi,

SEARCH STRING FOR '#'.

WRITE: SY-FDPOS

Regards,

Surinder

milusai
Participant
0 Kudos

data : var(10) TYPE c VALUE 'ABCD#XYZ'.

SEARCH var for '#'.

if sy-subrc = 0.

WRITE 😕 sy-fdpos.

endif.

Edited by: Milind Mungaji on Sep 23, 2008 1:28 PM

Former Member
0 Kudos

Hi,

Please use below code

data:fff type string value 'AB#CDXYZ'.

if fff ca '#'.

write: / sy-fdpos .

endif.

it count starts with ZERO position

Regards

jana

Former Member
0 Kudos

Hi,

Try like this.....


data : var3(10) TYPE c VALUE 'ABCD#XYZ'.
SEARCH var3 for '#'.
if sy-subrc = 0.
WRITE 😕 sy-fdpos.
endif.

OR


Data : var3(15) type c.
Data : len type i.
var3 = 'ABC#GOEFGH'.
FIND '#' IN var3 match offset len.
write : / len.

Hope it will helps

former_member705122
Active Contributor
0 Kudos

Search forum,

Link: