<?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 First Character with Space in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959098#M1694769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; fieldname&lt;SPAN class="L0S55"&gt;(&lt;SPAN class="L0S32"&gt;1&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;will work too if the field is not Type string.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;Regards Nico&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2012 09:09:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-09-19T09:09:47Z</dc:date>
    <item>
      <title>Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959094#M1694765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In BW I have a record coming in and wtihin the address field the first character contains a ! or #. This is causing the DSO not to activate due to invalid characters of ! or # as the first character.&amp;nbsp; I am trying to replace these characters with a space.&amp;nbsp; Any ideas?&amp;nbsp; Listed below I am trying to to determine if the source field contains a ! as the first character.&amp;nbsp; If this is true then I am replacing ! with a space in the REPLACE statement.&amp;nbsp; Still no luck so asking around for suggestions.&amp;nbsp; Thanks.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;DATA: VADDRESS LIKE SOURCE_FIELDS-ADDRESS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;IF SOURCE_FIELDS-ADDRESS CP '!'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;VADDRESS = SOURCE_FIELDS-ADDRESS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;REPLACE '!' WITH ' ' INTO VADDRESS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;RESULT = VADDRESS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;ELSE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;RESULT = SOURCE_FIELDS-ADDRESS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;ENDIF.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 03:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959094#M1694765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T03:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959095#M1694766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use &lt;STRONG&gt;&lt;SPAN class="L0S52" style="color: #ff0000;"&gt; REPLACE FIRST OCCURRENCE&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if u got invalid character error then you can use &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;T.CODE RSKC &lt;SPAN style="color: #000000;"&gt;you pass &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;@! $~{}_-|[]`\# and execute after that u active your &lt;/SPAN&gt;DSO&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 05:04:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959095#M1694766</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T05:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959096#M1694767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mary,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE FIRST OCCURRENCE OF '!' SOURCE_FIELDS-ADDRESS WITH ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONDENSE SOURCE_FIELDS-ADDRESS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope its useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 05:15:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959096#M1694767</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T05:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959097#M1694768</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 to use &lt;A href="http://help.sap.com/abapdocu_702/en/abaptranslate.htm#!ABAP_ADDITION_2@2@"&gt;TRANSLATE&lt;/A&gt; command.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;vaddress = &lt;SPAN class="L0S33"&gt;'!jake#jason'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;TRANSLATE vaddress &lt;SPAN class="L0S52"&gt;USING &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'! # '&lt;/SPAN&gt;.&lt;BR /&gt; &lt;BR /&gt; WRITE:/ vaddress.&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jake&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 08:19:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959097#M1694768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T08:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959098#M1694769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; fieldname&lt;SPAN class="L0S55"&gt;(&lt;SPAN class="L0S32"&gt;1&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;will work too if the field is not Type string.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;Regards Nico&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 09:09:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959098#M1694769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T09:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959099#M1694770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mary Jo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You mentioned that the first character may contain a ! or a #. The pound character may not be an actual pound character but SAP's representation of a non-printing character, e.g., a tab. We've seen this issue when a user copies-and-pastes text from another document and unintentionally brings along non-printing characters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We corrected the issue by running any field that may contain non-printing characters (in your case, the address field) through a subroutine to remove any invalid characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your scenario, you could construct a string of valid characters, then check if vaddress begins with anything other than this set of valid characters (IF vaddress(1) NOT CO valid_characters) and clear vaddress(1) if non-valid characters are found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Amy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 13:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959099#M1694770</guid>
      <dc:creator>amy_king</dc:creator>
      <dc:date>2012-09-19T13:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959100#M1694771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can get the list of allowed characters in the table RSALLOWEDCHAR.&lt;/P&gt;&lt;P&gt;(Table managed by the transaction RSKC reported by Krupa)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, you can remove / replace illegal characters in the string or char fields with simple ABAP statements, but beware of the risk of generating duplicate keys!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;P class="almost_half_cell" id="gt-res-content"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 13:58:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959100#M1694771</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2012-09-19T13:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959101#M1694772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for responding.&amp;nbsp; One thing to note not every field will begin with the character ! so I my intent was to search the character string for a ! and then if found do the REPLACE statement.&amp;nbsp; With the below code even though it doesn't say REPLACE FIRST OCCURRENCE it is still only replacing the first find.&amp;nbsp; But for some reason the string search is not recognizing the ! as a character so it doesn't find it.&amp;nbsp; My code works if I switch it to a 1 for the search.&amp;nbsp; See below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SOURCE_FIELDS-ADDRESS CA '1'&lt;/P&gt;&lt;P&gt;VADDR = SOURCE_FIELDS-ADDRESS.&lt;/P&gt;&lt;P&gt;REPLACE '1' WITH ' ' INTO VADDR1.&lt;/P&gt;&lt;P&gt;RESULT = VADDR1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the results from the test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source field:&amp;nbsp; 115 WEST COLLEGE DRIVE1&lt;/P&gt;&lt;P&gt;Result:&amp;nbsp;&amp;nbsp; 15 WEST COLLEGE DRIVE1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 14:55:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959101#M1694772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T14:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959102#M1694773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for responding.&amp;nbsp; I tried you suggestion and it appears to only work if the ! is contained within the string but not as the first character.&amp;nbsp; One thing to note is not every field will have a ! as the first character so that is why I am applying the search string statement first and if an ! is found then apply the TRANSLATE option.&amp;nbsp; Plus it appears to replace every character of ! where my intent is to just replace the first character.&amp;nbsp;&amp;nbsp; Below is my code and the results.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;CODE&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;IF SOURCE_FIELDS-CANDIDATECITY CA '!'.&lt;/P&gt;&lt;P&gt;VADDR2 = SOURCE_FIELDS-CANDIDATECITY.&lt;/P&gt;&lt;P&gt;TRANSLATE VADDR2 USING '! '.&lt;/P&gt;&lt;P&gt;WRITE:/ VADDR2.&lt;/P&gt;&lt;P&gt;RESULT = VADDR2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEST&lt;/P&gt;&lt;P&gt;Source:&amp;nbsp; 115! WEST! COLLEGE&lt;/P&gt;&lt;P&gt;Result: 115&amp;nbsp; WEST&amp;nbsp; COLLEGE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 15:14:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959102#M1694773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T15:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959103#M1694774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for responding.&amp;nbsp; That seemed to almost work.&amp;nbsp; The catch is not all records will have the ! as the first character so I wanted to apply the search string to find an ! point.&amp;nbsp; The code is not recognizing ! as a character for the search.&amp;nbsp; See below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;IF SOURCE_FIELDS-ADDR1&amp;nbsp; CA '!'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ** Here if I switch to a 1 it works.**&lt;/P&gt;&lt;P&gt;VADDR1 = SOURCE_FIELDS-ADDR1&lt;/P&gt;&lt;P&gt;VADDR1(1) = ' '.&lt;/P&gt;&lt;P&gt;RESULT = VADDR2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEST&lt;/P&gt;&lt;P&gt;Source:&amp;nbsp; 115&lt;/P&gt;&lt;P&gt;Result:&amp;nbsp; 15&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 15:48:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959103#M1694774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T15:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959104#M1694775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We too had a problem with strange characters in files coming from external sources( I believe it was an excel SS file that sometimes had some really odd characters)&amp;nbsp; We found just the FM to call to fix them.&amp;nbsp; Have a look at function module SCP_REPLACE_STRANGE_CHARS.&amp;nbsp; It does exactly what its name says.&amp;nbsp; Check out the Function Module Documentation for all the gory details. (It is one of the few SAP FMs that actually has some English documentation!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 17:50:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959104#M1694775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T17:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959105#M1694776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for responding.&amp;nbsp; I tried what you suggested and it appears that the search does not take into account if the first character has a ! in the field.&amp;nbsp; If I move the ! to the end of the field it acknowledges it and then replaces the first character with a space.&amp;nbsp; Below are the results of my test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source:&amp;nbsp; MARSHALL!&lt;/P&gt;&lt;P&gt;Result:&amp;nbsp;&amp;nbsp; ARSHALL!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I had !MARSHALL it does recognize it at the beginning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 18:06:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959105#M1694776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T18:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959106#M1694777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SOURCE_FIELDS-ADDR1(1) = '!'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 18:56:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959106#M1694777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T18:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959107#M1694778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please be certain that the character "!" is really hex 0021 and not something else.&amp;nbsp; Your description of the behavior seems to point to that character being something else, but is only displaying the "!".&amp;nbsp; You can see this in the debugger.&amp;nbsp; Also you might try simply replacing it with "!" by typing over the character in debugger.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 19:13:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959107#M1694778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-19T19:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959108#M1694779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FORM replace_invalid_first_with_space changing cv_text type clike.&lt;/P&gt;&lt;P&gt;&amp;nbsp; STATICS:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_invalid TYPE STRING.&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF lv_invalid is initial.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; concatenate &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '!' &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cl_abap_char_utilities=&amp;gt;horizontal_tab "control characters visible as #&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cl_abap_char_utilities=&amp;gt;cr_lf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cl_abap_char_utilities=&amp;gt;new_line&lt;/P&gt;&lt;P&gt;* add more invalid characters&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO lv_invalid.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF strlen( cv_text ) &amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF lv_invalid CA cv_text(1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cv_text(1) = space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 22:25:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959108#M1694779</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2012-09-19T22:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Replace First Character with Space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959109#M1694780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The fix was created a FORM globally that replaces any hexidecimal characters 00-1F, which are not valid and also replacing the ! and # in the first field of the character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;FORM&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0063a4; font-size: 9pt;"&gt;*$*$ begin of 2nd part global - insert your code only below this line&amp;nbsp; *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;FORM &lt;SPAN style="background: yellow;"&gt;format_for_bw&lt;/SPAN&gt; USING i_replace TYPE string&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; CHANGING c_text_field TYPE c.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; DATA:&amp;nbsp; l_field_length TYPE i,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_index TYPE sy-index.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; FIELD-SYMBOLS &amp;lt;l_char&amp;gt; TYPE X.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0063a4; font-size: 9pt;"&gt;*Hexadecimal character OO-1F are not valid in BW and therefore need to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0063a4; font-size: 9pt;"&gt;*be replaced.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; l_field_length = STRLEN( c_text_field ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; DO l_field_length TIMES.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0063a4; font-size: 9pt;"&gt;*Retrieve the character's hex value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_index = sy-index - 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assign c_text_field+l_index(1) to &amp;lt;l_char&amp;gt; casting.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0063a4; font-size: 9pt;"&gt;*If the hex value is between 00 and 1F, replace with space&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF &amp;lt;l_char&amp;gt; &amp;lt;= '1F'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c_text_field+l_index(1) = i_replace.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; ENDDO.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0063a4; font-size: 9pt;"&gt;* Need to check the source field for any characters BW cannot handle&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0063a4; font-size: 9pt;"&gt;* ! as the first character, # in any position&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; IF c_text_field(1) = '!'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SHIFT c_text_field LEFT DELETING LEADING '!'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; ELSEIF c_text_field(1) = '#'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SHIFT c_text_field LEFT DELETING LEADING '#'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp; ENDIF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;ENDFORM.&lt;/SPAN&gt;﻿&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next for each text field that would have the potental of invalid characters apply the code below, which calls the FORM for cleanup of the characters.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;RESULT = SOURCE_FIELDS-LASTNAME.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PERFORM &lt;SPAN style="background: yellow;"&gt;format_for_bw&lt;/SPAN&gt; USING SPACE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHANGING RESULT.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 16:23:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-first-character-with-space/m-p/8959109#M1694780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-09T16:23:12Z</dc:date>
    </item>
  </channel>
</rss>

