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: 

Search for space

Former Member
0 Kudos
96

Hi All,

I need to search for a space in a string

For Eq: c_var = 'SDN SAP'

I just want to know which position is the space present in c_var

Search and find is not working out when i used for space

(I search for ' ')

Regards

Simin.R

2 REPLIES 2

Former Member
0 Kudos
63

hi Simin,

do this way ..

c_var = 'SDN SAP'

split c_var at 'space'  into var1 var2.

v_pos = strlen( var1 ) + 1.

Regards,

Santosh

Message was edited by:

Santosh Kumar Patha

former_member181962
Active Contributor
0 Kudos
63

Hi,

SEARCH will work for space too.

Check if the space you see is indeed a space.

see this example:

DATA: text TYPE string VALUE `Roll over Beethoven`,

pos TYPE i.

SEARCH text FOR '. .'.

SEARCH text FOR ` `.

IF sy-subrc = 0.

pos = sy-fdpos + 2.

SEARCH text FOR 'bth' STARTING AT pos

ABBREVIATED AND MARK.

ENDIF.

Regards,

Ravi