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

Search for space

Former Member
0 Likes
455

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

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
Read only

Former Member
0 Likes
422

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

Read only

Former Member
0 Likes
422

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