<?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  OCCURRENCES in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051380#M1174164</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose var_a is haveing data which have data along with '-' and has to be replaced by space &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: temp(1) type c value '-'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE temp WITH space INTO var_a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now see the content of variable var_a all the '-' will be replaced by space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bikas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Jan 2009 11:17:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-09T11:17:31Z</dc:date>
    <item>
      <title>REPLACE  ALL  OCCURRENCES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051378#M1174162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;How can I replace ' - ' with SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I m using &lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF '-' IN VALUE WITH ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is removing '-' but not getting space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I have space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anshul.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 11:09:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051378#M1174162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-09T11:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: REPLACE  ALL  OCCURRENCES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051379#M1174163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt; use TRANSLATE &amp;lt;field&amp;gt; using '- '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 11:16:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051379#M1174163</guid>
      <dc:creator>andrea_galluccio2</dc:creator>
      <dc:date>2009-01-09T11:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: REPLACE  ALL  OCCURRENCES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051380#M1174164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose var_a is haveing data which have data along with '-' and has to be replaced by space &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: temp(1) type c value '-'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE temp WITH space INTO var_a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now see the content of variable var_a all the '-' will be replaced by space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bikas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 11:17:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051380#M1174164</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-09T11:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: REPLACE  ALL  OCCURRENCES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051381#M1174165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI &lt;/P&gt;&lt;P&gt;Use:&lt;/P&gt;&lt;P&gt;TRANSLATE wa_var USING '- '.&lt;/P&gt;&lt;P&gt;This should work for u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 11:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051381#M1174165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-09T11:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: REPLACE  ALL  OCCURRENCES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051382#M1174166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The below code will work for your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:w_txt TYPE char50 VALUE 'Hi How-are-you?'.
 
DO."Repeat until ',' is thr
  IF w_txt CA '-'. "Checking for '-'.
    w_txt+sy-fdpos(1) = space. "Replacing the '-' with space
  ELSE.
    EXIT. "Come out when thr is no '-'.
  ENDIF.
ENDDO.
 
WRITE:/ w_txt.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i/p is:   Hi How-are-you?&lt;/P&gt;&lt;P&gt;o/p is : Hi How are you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope thi helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj Kumar P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manoj Kumar on Jan 9, 2009 12:23 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 11:23:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051382#M1174166</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-09T11:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: REPLACE  ALL  OCCURRENCES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051383#M1174167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data:val(10) value 'hh-m-kk'.&lt;/P&gt;&lt;P&gt;TRANSLATE val USING '- '.&lt;/P&gt;&lt;P&gt;write val.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 11:23:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051383#M1174167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-09T11:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: REPLACE  ALL  OCCURRENCES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051384#M1174168</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;In this case you would have to replace it by applying the logic.&lt;/P&gt;&lt;P&gt;first find '-' and then replace it with ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this code,this is working surely:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: g_string TYPE string VALUE 'abc-def-ghi-jkl-',
g_newstring TYPE string,
g_text(1) TYPE c VALUE '-',
g_cnt TYPE i,
g_char(1) TYPE c,
g_int TYPE sy-index,
g_flag(1) TYPE c.


g_cnt = STRLEN( g_string ).
DO g_cnt TIMES.
  IF g_char IS INITIAL.
    g_char = g_string+0(1).
  ELSE.
    g_int = sy-index - 1.
    g_char = g_string+g_int(1).
  ENDIF.
  IF g_char = '-'.
    g_flag = 'X'.
    CONCATENATE ' ' g_newstring INTO g_newstring.
  ELSE.
    IF g_flag = 'X'.
      CONCATENATE g_newstring g_char INTO g_newstring separated by space.
      clear g_flag.
    ELSE.
      CONCATENATE g_newstring g_char INTO g_newstring.

    ENDIF.
  ENDIF.

ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Neha Shukla on Jan 9, 2009 5:28 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 11:25:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051384#M1174168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-09T11:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: REPLACE  ALL  OCCURRENCES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051385#M1174169</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;data: var(20) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0 ,&lt;/P&gt;&lt;P&gt;      var(20) type c,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;var = 'HAO-how-are-you'.&lt;/P&gt;&lt;P&gt;write:/ var.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split var at '-' into TABLE itab.&lt;/P&gt;&lt;P&gt;CLEAR VAR.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  IF SY-TABIX EQ 1.&lt;/P&gt;&lt;P&gt;   CONCATENATE ITAB-VAR VAR   INTO VAR SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;  CONCATENATE VAR ITAB-VAR  INTO VAR SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;WRITE:/ VAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Venkatesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 12:08:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-all-occurrences/m-p/5051385#M1174169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-09T12:08:42Z</dc:date>
    </item>
  </channel>
</rss>

