<?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: Replace all space with ~ in xstring format. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019712#M1168066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried below construct ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ......IN BYTE MODE ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tushar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jan 2009 15:00:00 GMT</pubDate>
    <dc:creator>tushar_shukla</dc:creator>
    <dc:date>2009-01-21T15:00:00Z</dc:date>
    <item>
      <title>Replace all space with ~ in xstring format.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019709#M1168063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am reading an XML file into a XSTRING variable and parsing the XSTRING to retrieve the data into Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What i want-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to replace all occurances of space in the file with some recognizable character ( say ~ ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This i need to do once the file is read into XSTRING variable, in this xstring variable i want to replace all spaces with other character's value.&lt;/P&gt;&lt;P&gt;Is it feasible to replace like this in XSTRING variable for space?&lt;/P&gt;&lt;P&gt;In XSTRING , a space is stored '0D0A'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and i know 'replace all occurrences' works for Char type data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to go about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help or clue is highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2009 05:21:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019709#M1168063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-20T05:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Replace all space with ~ in xstring format.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019710#M1168064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your idea works.&lt;/P&gt;&lt;P&gt;Just am not sure how you refer to the Hexadecimal Codes. I do by a 2 bytes character, for instance - A is coded like 41. Space for me is 20, not 0DA0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: x TYPE xstring,
      y TYPE  string.

x = '4156524148414D'. "AVRAHAM's literal hexadecimal coding
x = '4120562052204120482041204D'. "A V R A H A M
y = x.
REPLACE ALL OCCURRENCES OF '20' IN y WITH '78'. "requires a character type input paramater, can't pass XSTRING.
x = y.

CALL FUNCTION 'HR_RU_CONVERT_HEX_TO_STRING'
  EXPORTING
    xstring       = x
 IMPORTING
   CSTRING       = y.

WRITE: /, x, / ,y.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I pass the following string to the function: 'A V R A H A M'&lt;/P&gt;&lt;P&gt;and I print in the screen the following one: 'AxVxRxAxHxAxM'. 78 is 'x' hexadecimal code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Avraham&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Avraham Kahana on Jan 21, 2009 4:44 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 14:43:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019710#M1168064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T14:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Replace all space with ~ in xstring format.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019711#M1168065</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;Convert the XSTRING ti String and replace the space woth '~' and then convert to xstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check these FM &lt;/P&gt;&lt;P&gt;HR_KR_STRING_TO_XSTRING&lt;/P&gt;&lt;P&gt;HR_KR_XSTRING_TO_STRING&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 14:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019711#M1168065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T14:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Replace all space with ~ in xstring format.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019712#M1168066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried below construct ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ......IN BYTE MODE ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tushar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 15:00:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-space-with-in-xstring-format/m-p/5019712#M1168066</guid>
      <dc:creator>tushar_shukla</dc:creator>
      <dc:date>2009-01-21T15:00:00Z</dc:date>
    </item>
  </channel>
</rss>

