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

Special character

SG141
Active Participant
0 Likes
586

How to check for Trade mark and Registered Trade mark symbols in a String?

How to check for Trade mark and Registered Trade mark symbols in a String?

2 REPLIES 2
Read only

Former Member
0 Likes
551

declare data type x with the code...

search string for the data values...

trademark = data: tmark(1) type x value '99',

reg trademark = data: rtmark(1) type x value 'AE'.

Since you can't do this in a UNICODE-enabled program, you have the option of turning off the Unicode check in Attributes, or finding another way to declar the hex values.

reference: http://www.ascii-code.com/

Read only

Clemenss
Active Contributor
551

Hi Kartik,

I don't have problems, just paste the characters into editor

FORM trademark .
  CONSTANTS:
    lc_tm TYPE char01 VALUE 'u2122',
    lc_r  TYPE char01 VALUE '®'.
  DATA:
    lv_test TYPE string VALUE  'this is ABAP u2122 registerd by SAP ® '.
  IF lv_test CA lc_tm .
    WRITE: / 'found', lc_tm, 'at position', sy-fdpos, 'in:', lv_test.
  ENDIF.
  IF lv_test CA lc_r .
    WRITE: / 'found', lc_r, 'at position', sy-fdpos, 'in:', lv_test.
  ENDIF.
ENDFORM.                    " TRADEMARK

I hope you are on unicode (who is not?)

Regards,

Clemens