<?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>Question Re: How to handle null value in string and xstring? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737254#M207146</link>
    <description>&lt;P&gt;Hi Ebrahim Hatem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply, I have tried all of the above solutions but nothing is working. In SAP GUI debugging window the hex value of # is showing as 0000 and in CString it shows as . I have tried all the above solution. Instead of this umlaut # if we have normal # then i am able to do any modification and for this normal # the SAP GUI will show the hex as 0023 which is correct. But this particular character is not normal #, only it looks like as #. Can you suggest me if it is null or anything other character. And this character is available in the table D345T and field is BLOCK(LCHR type).&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2018 05:32:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-10-26T05:32:51Z</dc:date>
    <item>
      <title>How to handle null value in string and xstring?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaq-p/737249</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;
  &lt;P&gt;I am facing problem with null values in string and it's hex code xstring. I have some data in one field with data type LCHR. This field contains data like :&lt;/P&gt;
  &lt;P&gt;"SAPMSDYP MBatch-Input ####%PC 60317081539#?"&lt;/P&gt;
  &lt;P&gt;I have one abap program. I am just appending this data to a string variable and then converting this string to xstring data. The length of the string is 53 and after conversion to xstring the length of xstring data is more then the string data. In string data wherever the "#" is there it is coming as "0000" in raw data(xstring). After this conversion i am just sending this data to my java program using http_client. At java side if the incoming data is having null value in-between data then this java program will reject this data. The main problem is i have to handle these null value in my abap program only.&lt;/P&gt;
  &lt;P&gt;At debugging time in variable details box also its hex value is showing as 0000 that is sap's default string to hex conversion. And if i move the mouse cursor on this variable then in hint box this single '#' is showing as  5 characters as CString.&lt;/P&gt;
  &lt;P&gt;For string to xstring conversion i am using the below code: CL_ABAP_CONV_OUT_CE&lt;U&gt;=&amp;gt;create(&lt;/U&gt;&lt;/P&gt;
  &lt;P&gt;encoding = 'UTF-8'&lt;/P&gt;
  &lt;P&gt;endian = 'L' ).&lt;/P&gt;
  &lt;P&gt;conv-&amp;gt;convert( EXPORTING data = text&lt;/P&gt;
  &lt;P&gt;IMPORTING buffer = buffer1 ).&lt;/P&gt;
  &lt;P&gt;Here i have to handle this null("#") value either in string data or in xstring data in ABAP program only. I don't know how to do this.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 08:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaq-p/737249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-10-10T08:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle null value in string and xstring?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737250#M207142</link>
      <description>&lt;P&gt;Why don't you handle the # sign with abap before sending it to your java application? You can build a construct with string functions.&lt;/P&gt;&lt;P&gt;So you don't have to deal on the java-side:-)&lt;/P&gt;&lt;P&gt;Here are some keywords to point you the correct documentation.&lt;/P&gt;&lt;P&gt;String Functions, count, find, and match&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Florian&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 09:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737250#M207142</guid>
      <dc:creator>Florian</dc:creator>
      <dc:date>2018-10-10T09:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle null value in string and xstring?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737251#M207143</link>
      <description>&lt;P&gt;Hi Florian,&lt;/P&gt;&lt;P&gt;I tried at ABAP side also but any of the string function is not able to modify / replace or change this character. I need the way where i can get its correct hex value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Shekhawat&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 12:19:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737251#M207143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-10-11T12:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle null value in string and xstring?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737252#M207144</link>
      <description>&lt;P&gt;Hallo &lt;A href="https://answers.sap.com/users/320448/ompalsingh.html"&gt;Ompal shekhawat&lt;/A&gt;, &lt;/P&gt;&lt;P&gt;I think you have to check your XSTRING and if you found this &lt;STRONG&gt;0x00&lt;/STRONG&gt;, then you can remove it. By the way you may get this ### if there is new line &lt;STRONG&gt;0x0a&lt;/STRONG&gt; or break line &lt;STRONG&gt;0x0D &lt;/STRONG&gt;and you can remove them from your XSTRING. &lt;/P&gt;&lt;P&gt;So, just these could help you&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Check if the string has 0x00 or 0x0a or 0x0D, then remove it.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, I would like you to read about these ASCII chart: &lt;/P&gt;&lt;H2&gt;common ascii codes to know&lt;/H2&gt;&lt;PRE&gt;&lt;CODE&gt;Char  Dec  Oct  Hex   WhatAreThey
---------------------------------------
(nul)   0 0000 0x00   Null 
(ht)    9 0011 0x09   Horizontal Tab
(nl)   10 0012 0x0a   New Line
(vt)   11 0013 0x0b   Vertical Tab
(cr)   13 0015 0x0d   Carriage Return
(sp)   32 0040 0x20   Space

Ref: &lt;A href="http://www.bluesock.org/~willg/dev/ascii.html" target="test_blank"&gt;http://www.bluesock.org/~willg/dev/ascii.html&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For String, you can check this class &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_ABAP_CHAR_UTILITIES=&amp;gt;NEWLINE&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/236311-abap1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Ebrahim Hatem &lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 13:07:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737252#M207144</guid>
      <dc:creator>former_member184158</dc:creator>
      <dc:date>2018-10-11T13:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle null value in string and xstring?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737253#M207145</link>
      <description>&lt;P&gt;You may have a look at the debugger to see the values unconverted. As Ebrahim suggest, I think this is the rootcause atm.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 15:46:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737253#M207145</guid>
      <dc:creator>Florian</dc:creator>
      <dc:date>2018-10-11T15:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle null value in string and xstring?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737254#M207146</link>
      <description>&lt;P&gt;Hi Ebrahim Hatem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply, I have tried all of the above solutions but nothing is working. In SAP GUI debugging window the hex value of # is showing as 0000 and in CString it shows as . I have tried all the above solution. Instead of this umlaut # if we have normal # then i am able to do any modification and for this normal # the SAP GUI will show the hex as 0023 which is correct. But this particular character is not normal #, only it looks like as #. Can you suggest me if it is null or anything other character. And this character is available in the table D345T and field is BLOCK(LCHR type).&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 05:32:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-handle-null-value-in-string-and-xstring/qaa-p/737254#M207146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-10-26T05:32:51Z</dc:date>
    </item>
  </channel>
</rss>

