‎2009 Oct 20 9:32 AM
Hi all,
DATA: text TYPE string,
IF text CO = ' @#$%^&*()_+-=<>?:"{}|[]\; '.
ELSE.
Message error
ENDIF.I want to include ' in the IF condition, Please Suggest.
regards,
Mukundan.R
‎2009 Oct 20 9:33 AM
‎2009 Oct 20 9:33 AM
‎2009 Oct 20 10:45 AM
‎2009 Oct 20 9:36 AM
Hi,
Use the escape character `` to represent apostrophe
IF text CO = ' @#$%^&*()_+-=?:"{}|[]\;`` '.
ELSE.
Message error
ENDIF.
Vikranth
‎2009 Oct 20 9:36 AM
‎2009 Oct 20 9:47 AM
Check this
DATA: text type string value ''''.
IF text CO ' @#$%^&*()_+-=?:"{}|[]\; '' '.
ELSE.
Message error.
ENDIF.
write:/ text.
‎2009 Oct 20 9:50 AM
Remove '=' sign.
IF text CO '@#$%^&*()_+-=?:"{}|[]\;'.
if text co `'`.
endif.
else.
endif.
‎2009 Oct 20 9:53 AM
Hello,
I think the error may be because you are using '=' with CO operator.
And just FYI, for apostrophe(') you have to use an escape character which is an apostrohe(') itself as suggested by Thomas.
BTW i removed '=' from your code & it compiled
DATA: V_TEXT TYPE STRING.
IF V_TEXT CO ' @#$%^&*()_+-=?:"{}|[]\; '.
ELSE.
* MESSAGE ERROR
ENDIF.BR,
Suhas