<?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: Replacing a special character in a string with another string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079586#M730358</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;try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURENCES OF ''' in var1 WITH '&amp;amp;apos&amp;amp;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where,&lt;/P&gt;&lt;P&gt;var1 is the variable that contains the string..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Nov 2007 08:53:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-16T08:53:28Z</dc:date>
    <item>
      <title>Replacing a special character in a string with another string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079582#M730354</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;I need to replace a special character in a string with another string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say there is a string -  "abc's def's are alphabets" &lt;/P&gt;&lt;P&gt;and i need to replace all the ' (apostrophe) with &amp;amp;apos&amp;amp; ..which should look like as below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; "abc&amp;amp;apos&amp;amp;s def&amp;amp;apos&amp;amp;s are alphabets" .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly let me know how this requirement can be met.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sukumari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 08:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079582#M730354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T08:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing a special character in a string with another string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079583#M730355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;der is a command called&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURENCES OF &lt;/P&gt;&lt;P&gt;use it ur pupose..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF ''' IN: &lt;/P&gt;&lt;P&gt;        text1 WITH '&amp;amp;apos&amp;amp;'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will help..&lt;/P&gt;&lt;P&gt;Reward if it does&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Prashant H Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 08:50:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079583#M730355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T08:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing a special character in a string with another string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079584#M730356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;REPLACE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax Forms &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pattern-based replacement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF] &lt;/P&gt;&lt;P&gt;pattern &lt;/P&gt;&lt;P&gt;          IN [section_of] dobj WITH new &lt;/P&gt;&lt;P&gt;          [IN {BYTE|CHARACTER} MODE] &lt;/P&gt;&lt;P&gt;          [{RESPECTING|IGNORING} CASE] &lt;/P&gt;&lt;P&gt;          [REPLACEMENT COUNT rcnt] &lt;/P&gt;&lt;P&gt;          { {[REPLACEMENT OFFSET roff] &lt;/P&gt;&lt;P&gt;             [REPLACEMENT LENGTH rlen]} &lt;/P&gt;&lt;P&gt;          | [RESULTS result_tab|result_wa] }. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Position-based replacement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new &lt;/P&gt;&lt;P&gt;                  [IN {BYTE|CHARACTER} MODE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Meaning &lt;/P&gt;&lt;P&gt;0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj. &lt;/P&gt;&lt;P&gt;2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right. &lt;/P&gt;&lt;P&gt;4 The subsequence in sub_string was not found in dobj in the pattern-based search. &lt;/P&gt;&lt;P&gt;8 The data objects sub_string and new contain double-byte characters that cannot be interpreted. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;These forms of the statement REPLACE replace the following obsolete form: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE sub_string WITH &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;REPLACE sub_string WITH new INTO dobj &lt;/P&gt;&lt;P&gt;        [IN {BYTE|CHARACTER} MODE] &lt;/P&gt;&lt;P&gt;        [LENGTH len]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... IN {BYTE|CHARACTER} MODE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... LENGTH len &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System Fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Meaning &lt;/P&gt;&lt;P&gt;0 The subsequence in sub_string was replaced in the target field dobj with the content of new. &lt;/P&gt;&lt;P&gt;4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... IN {BYTE|CHARACTER} MODE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... LENGTH len &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:   text1      TYPE string       VALUE 'I know you know', &lt;/P&gt;&lt;P&gt;        text2(18)  TYPE c LENGTH 18  VALUE 'I know you know', &lt;/P&gt;&lt;P&gt;        sub_string TYPE string       VALUE 'know', &lt;/P&gt;&lt;P&gt;        new        TYPE string       VALUE 'should know that'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE sub_string WITH new INTO text1. &lt;/P&gt;&lt;P&gt;REPLACE sub_string WITH new INTO text2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 08:51:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079584#M730356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T08:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing a special character in a string with another string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079585#M730357</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;PRE&gt;&lt;CODE&gt;REPLACE ALL OCCURRENCES OF '''' IN string WITH '&amp;amp;apos&amp;amp;'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgs &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 08:51:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079585#M730357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T08:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing a special character in a string with another string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079586#M730358</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;try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURENCES OF ''' in var1 WITH '&amp;amp;apos&amp;amp;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where,&lt;/P&gt;&lt;P&gt;var1 is the variable that contains the string..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 08:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079586#M730358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T08:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing a special character in a string with another string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079587#M730359</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;     You can use &amp;lt;b&amp;gt;Replace&amp;lt;/b&amp;gt; stmt for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 09:06:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-a-special-character-in-a-string-with-another-string/m-p/3079587#M730359</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T09:06:13Z</dc:date>
    </item>
  </channel>
</rss>

