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

identify single quote in strings.

Former Member
0 Likes
2,703

i have req:: a field is there its a charactor field:::

my req is that the user should enter 1234... or abcd... but he should not

write ''' in the field examp

1> ab''12

2> ''''

3> 12''3

for all other special charactor i can able to control but for ' i could

not able to do any thing...

so how can i Do that

1 ACCEPTED SOLUTION
Read only

Former Member
1,719

Use the Quotes sysmbol that you see below the escape key in the key board.

if v_staring ca `'`.

endif.

i have req:: a field is there its a charactor field:::

my req is that the user should enter 1234... or abcd... but he should not

write ''' in the field examp

1> ab''12

2> ''''

3> 12''3

for all other special charactor i can able to control but for ' i could

not able to do any thing...

so how can i Do that

9 REPLIES 9
Read only

Former Member
0 Likes
1,719

Hi,

You can use the string comparison pattersn like

CP or CS or CA for this

regards,

Anji

Read only

0 Likes
1,719

Hi Anji/ Navaneeth,

I tried that way...its saying ' text literal ' ' ' is longer than 255 characters'.

Regards,

Sujatha.

Read only

0 Likes
1,719

Hi,

I thin u shud write :

Write : 'Text Literal ''''(4 quotes) is longer than 255 characters'.

Hope this shud solve ur issue.

Regards,

Himanshu

Read only

Former Member
0 Likes
1,719

hi,

declare variable:

constants: c_quote type c value ''''.

then check string using ca, cs.

regards,

Navneeth.K

Read only

Former Member
0 Likes
1,719

Hi Sujatha,

Use CA string operation to check for the characters in a string.

DATA V_STRING TYPE STRING.

IF V_STRING CA '"''.

WRITE:/ 'STRING CONTAINS SINGLE QUOTES'.

ENDIF.

Thanks,

Vinay

Read only

Former Member
0 Likes
1,719

Hi Sujatha,

just put this code and check

data: v_str type string.

constants: c_quote type c value ''''.

concatenate 'Navneeth' c_quote 'SAP' into v_str.

if v_str ca c_quote.

write 'Successfull'.

endif.

hope it solves your problem

regards,

Navneeth.K

Read only

Former Member
1,720

Use the Quotes sysmbol that you see below the escape key in the key board.

if v_staring ca `'`.

endif.

Read only

Former Member
0 Likes
1,719

Hi Sujatha,

Did the above code sample solve your purpose.

regards,

Navneeth.K

Read only

0 Likes
1,719

Hi,

Ya,Ravikanth's post has solved my issue.

Anyway thanks to u all for ur responses.

Regards,

Sujatha.