<?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: Unicode X string problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399301#M193082</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;Prior to unicode allowed in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Until now, there was a check in these statements to see if field f is character-type, where normally X fields, X strings, and flat structures were also seen as character-type. This is no longer meaningful in a Unicode program because, on the one hand, the types X and XSTRING are no longer regarded as character-type, and, on the other hand, bit-by-bit access to character-type fields or structures is no longer platform-independent. In a Unicode program, field f must therefore be of type X or XSTRING for these operations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jun 2006 15:27:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-29T15:27:49Z</dc:date>
    <item>
      <title>Unicode X string problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399300#M193081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are migrating to a Unicode system. When the unicode flag is switched on I get an error which says that P_1STCHAR must be byte type field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAP unicode help just confirms the error message without giving any suggestions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF P_1STCHAR Z HEX_FF is the line with the problem. Z is a relational operator for bit masks. This line is basically saying does P_1STCHAR contain a ZERO at the bit position specified in HEX_FF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a non unicode system P_1STCHAR can be a character type field (which it is in this case) but in a unicode system it must be a byte type field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I fix this code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM CHECK_NULL CHANGING P_1STCHAR  TYPE C
                         P_NULLFLAG TYPE C.
* New form...                                              
  DATA: HEX_FF(1) TYPE X  VALUE 'FF'.

* If every bit position in P_1STCHAR is 0 then we have
* a NULL insert issue.  Change the P_1STCHAR to X and
* mark the corresponding P_NULLFLAG with X.
  IF P_1STCHAR Z HEX_FF.  &amp;lt;&amp;lt;&amp;lt;&amp;lt; THIS IS PROBLEM LINE!!!
    WRITE  IND-ON TO: P_1STCHAR,
                      P_NULLFLAG.
  ELSE.
    CLEAR P_NULLFLAG.
  ENDIF.
ENDFORM.                    " CHECK_NULL
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 15:21:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399300#M193081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T15:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode X string problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399301#M193082</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;Prior to unicode allowed in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Until now, there was a check in these statements to see if field f is character-type, where normally X fields, X strings, and flat structures were also seen as character-type. This is no longer meaningful in a Unicode program because, on the one hand, the types X and XSTRING are no longer regarded as character-type, and, on the other hand, bit-by-bit access to character-type fields or structures is no longer platform-independent. In a Unicode program, field f must therefore be of type X or XSTRING for these operations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 15:27:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399301#M193082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T15:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode X string problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399302#M193083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Manoj, Do you have any suggestions on how I could restructure the code so that it will check for a null entry in P_1STCHAR? So that the code will still have the same functionality as before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 15:34:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399302#M193083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T15:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode X string problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399303#M193084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the code calling the null form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  APPEND_ZU131
*    Routine appends record in HOLDZU131 internal table.
*&amp;amp;---------------------------------------------------------------------*
FORM APPEND_ZU131 USING DATA_1
                        DATA_2.
*                       DATA_3                              
*                       DATA_4.                             

* FORM_NAME = 'APPEND_ZU131'.                               
* INCLUDE ZUINSTRT.                                         

* zu131-rec_number = zu131-rec_number + 1.                  
* zu131-data_1     = data_1.                                
* zu131-data_2     = data_2.                                
  ZU131N-REC_NUMBER = ZU131N-REC_NUMBER + 1.                
  ZU131N-DATA_1     = DATA_1.                               
  ZU131N-DATA_2     = DATA_2.                               
* ZU131-DATA_3     = DATA_3.                                
* ZU131-DATA_4     = DATA_4.                                

* Deal with 1st char.                                       
* If NULL (x'00'), save it and then change it.              
  PERFORM CHECK_NULL CHANGING:                              
     ZU131N-DATA_1+0(1)  ZU131N-FIRSTNULL1,                 
     ZU131N-DATA_2+0(1)  ZU131N-FIRSTNULL2.                 

* HOLDZU131 = ZU131.                                        
* APPEND HOLDZU131.                                         
* append zu131 to holdzu131.                     
  APPEND ZU131N TO HOLDZU131.                    

* Append does not set SY-SUBRC !                            
* IF SY-SUBRC NE 0.                                         
*   FORM_NAME = 'APPEND_ZU131'.                             
*   INCLUDE ZUINFAIL.                                       
*   RAISE INSERT_FAILED.                                    
* ENDIF.                                                    
* FORM_NAME = 'APPEND_ZU131'.                               
* INCLUDE ZUINENDD.                                         

ENDFORM.                               " APPEND_ZU131
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 15:40:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399303#M193084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T15:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode X string problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399304#M193085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Convert P_1STCHAR to hex and using in If statement might work.&lt;/P&gt;&lt;P&gt;Try this code in Form ..endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: uccp type syhex02,&lt;/P&gt;&lt;P&gt;      hex_ff type syhex02 value 'FFFF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get hex of P_1STCHAR&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call method cl_abap_conv_out_ce=&amp;gt;uccp&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    char = p_1stchar&lt;/P&gt;&lt;P&gt;  receiving&lt;/P&gt;&lt;P&gt;    uccp = uccp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if uccp z hex_ff.&lt;/P&gt;&lt;P&gt;  write  ind-on to: p_1stchar,&lt;/P&gt;&lt;P&gt;                    p_nullflag.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;  clear p_nullflag.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 16:18:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399304#M193085</guid>
      <dc:creator>sridhar_k1</dc:creator>
      <dc:date>2006-06-29T16:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode X string problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399305#M193086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, points awarded. Can't actually test it yet though. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 16:51:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399305#M193086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T16:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode X string problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399306#M193087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Small change to my previous post:&lt;/P&gt;&lt;P&gt;Use field symbols to convert char to hex instead of method CL_ABAP_CONV_OUT_CE=&amp;gt;UCCP, because sap may not have a unicode codepoint for every possible bit sequence, use the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: v_hex(2) type x,
      hex_ff type syhex02 value 'FFFF'.
field-symbols: &amp;lt;fs&amp;gt; type any.

assign p_1stchar to &amp;lt;fs&amp;gt; casting type x.
v_hex = &amp;lt;fs&amp;gt;

if v_hex Z hex_ff.
  write  ind-on to: p_1stchar,
                    p_nullflag.
else.
  clear p_nullflag.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 21:04:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-x-string-problem/m-p/1399306#M193087</guid>
      <dc:creator>sridhar_k1</dc:creator>
      <dc:date>2006-06-29T21:04:32Z</dc:date>
    </item>
  </channel>
</rss>

