<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: find double byte char in string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596360#M267858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be a little late but here you go anyway:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this out:&lt;/P&gt;&lt;P&gt;The path for the entire structure to get the sample code is:&lt;/P&gt;&lt;P&gt;Program HTWCTXM0 &amp;gt; Include PCTXMTWS &amp;gt; etc etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out include PCTXMTWS&lt;/P&gt;&lt;P&gt;There is a Form called get_addr&lt;/P&gt;&lt;P&gt;Inside this Form there's a FM HR_TW_ADDRESS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM gets the IT0006 address details and somewhere down the liine runs a check to see if the "Full Address" has every character in double byte. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "TW" part of it is Taiwan, (the address data needs to be in double byte chinese, so this FM runs the check on it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this FM it calls a form called chk_fulltyp.&lt;/P&gt;&lt;P&gt;In here it loops through each character of the given string and checks if the character is a double byte:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The section of code that does this:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; WHEN 2.
        dft_cnt = 0.
        tot_len = strlen( org_str ).
        while dft_cnt &amp;lt; tot_len.
          char = org_str+dft_cnt(1).
          point = cl_abap_conv_out_ce=&amp;gt;uccp( char ).
          if point &amp;lt;= last_ascii_zf.
            retcode = '1'.
            IF TYPE EQ 'A'.
              RAISE CONTAIN_NO_FULL_TYPE.
            ENDIF.
            dft_cnt = tot_len.              " FOR EXIT WHILE
          endif.
          dft_cnt = dft_cnt + 1.
        endwhile.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could debug the variable "point" and see the double byte equivalent value for the current character in the string...&lt;/P&gt;&lt;P&gt;...and progress from there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know fully what cl_abap_conv_out_ce=&amp;gt;uccp does but it seems to return the double byte equivalent value. Please correct me if I am wrong on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2007 05:47:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-22T05:47:18Z</dc:date>
    <item>
      <title>find double byte char in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596357#M267855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a string with both english and chinese character. Is there any method to extract only chinese character (should be dobule-byte, right?) from the string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2006 04:57:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596357#M267855</guid>
      <dc:creator>former_member220801</dc:creator>
      <dc:date>2006-10-10T04:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: find double byte char in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596358#M267856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/79/c55479b3dc11d5993800508b6b8b11/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/79/c55479b3dc11d5993800508b6b8b11/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i guess you need to use CHARLEN and findout&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2006 10:47:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596358#M267856</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-10-10T10:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: find double byte char in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596359#M267857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have read the char one by one and find the charlen...buth both chinese and english char return charlen = 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2006 04:51:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596359#M267857</guid>
      <dc:creator>former_member220801</dc:creator>
      <dc:date>2006-10-11T04:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: find double byte char in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596360#M267858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be a little late but here you go anyway:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this out:&lt;/P&gt;&lt;P&gt;The path for the entire structure to get the sample code is:&lt;/P&gt;&lt;P&gt;Program HTWCTXM0 &amp;gt; Include PCTXMTWS &amp;gt; etc etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out include PCTXMTWS&lt;/P&gt;&lt;P&gt;There is a Form called get_addr&lt;/P&gt;&lt;P&gt;Inside this Form there's a FM HR_TW_ADDRESS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM gets the IT0006 address details and somewhere down the liine runs a check to see if the "Full Address" has every character in double byte. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "TW" part of it is Taiwan, (the address data needs to be in double byte chinese, so this FM runs the check on it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this FM it calls a form called chk_fulltyp.&lt;/P&gt;&lt;P&gt;In here it loops through each character of the given string and checks if the character is a double byte:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The section of code that does this:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; WHEN 2.
        dft_cnt = 0.
        tot_len = strlen( org_str ).
        while dft_cnt &amp;lt; tot_len.
          char = org_str+dft_cnt(1).
          point = cl_abap_conv_out_ce=&amp;gt;uccp( char ).
          if point &amp;lt;= last_ascii_zf.
            retcode = '1'.
            IF TYPE EQ 'A'.
              RAISE CONTAIN_NO_FULL_TYPE.
            ENDIF.
            dft_cnt = tot_len.              " FOR EXIT WHILE
          endif.
          dft_cnt = dft_cnt + 1.
        endwhile.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could debug the variable "point" and see the double byte equivalent value for the current character in the string...&lt;/P&gt;&lt;P&gt;...and progress from there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know fully what cl_abap_conv_out_ce=&amp;gt;uccp does but it seems to return the double byte equivalent value. Please correct me if I am wrong on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 05:47:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-double-byte-char-in-string/m-p/1596360#M267858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T05:47:18Z</dc:date>
    </item>
  </channel>
</rss>

