<?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 Problem with replace function in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092332#M1182016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I use replace function in an internal table for eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My internal table contain following entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;line&lt;/U&gt;&lt;/P&gt;&lt;P&gt; my name is xyz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I want to replace this xyz with priya..how to do that??? Can I use a place holder in internal table and feed data later to it? for eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;line&lt;/U&gt;&lt;/P&gt;&lt;P&gt; my name is &amp;amp;&lt;/P&gt;&lt;P&gt;and later add 'priya' in this place holder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2009 10:34:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-03T10:34:12Z</dc:date>
    <item>
      <title>Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092332#M1182016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I use replace function in an internal table for eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My internal table contain following entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;line&lt;/U&gt;&lt;/P&gt;&lt;P&gt; my name is xyz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I want to replace this xyz with priya..how to do that??? Can I use a place holder in internal table and feed data later to it? for eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;line&lt;/U&gt;&lt;/P&gt;&lt;P&gt; my name is &amp;amp;&lt;/P&gt;&lt;P&gt;and later add 'priya' in this place holder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 10:34:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092332#M1182016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T10:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092333#M1182017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the REPLACE stmt for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPLACE ALL OCCURRENCES OF '&amp;amp;' IN v_string WITH 'Priya'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Feb 3, 2009 4:08 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 10:36:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092333#M1182017</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-02-03T10:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092334#M1182018</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;yes, u can do that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;my name is &amp;amp;
REPLACE '&amp;amp;'  WITH 'Priya'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 10:39:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092334#M1182018</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-02-03T10:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092335#M1182019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use the replace statement&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;where sub_string = xyz&lt;/P&gt;&lt;P&gt;and text1 = priya.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 10:40:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092335#M1182019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T10:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092336#M1182020</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;See the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: name type string VALUE 'xyz',
      name1 TYPE string VALUE 'priya'.


REPLACE name WITH name1 into name.

WRITE:/ name.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this u can loop ur internal table and replace the name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 10:43:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092336#M1182020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T10:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092337#M1182021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes, you can do it.&lt;/P&gt;&lt;P&gt;REPLACE  'xyz'  WITH 'Priya'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other wise you can use move commad and pass to perticular field and append internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Md.MahabooobKhan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 10:44:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092337#M1182021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T10:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092338#M1182022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my problem is I am passing an internal table and not a single variable...and it is not working in an internal table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 10:52:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092338#M1182022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T10:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092339#M1182023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: name type TABLE OF string ,&lt;/P&gt;&lt;P&gt;      wa_name type string.&lt;/P&gt;&lt;P&gt;      wa_name = 'my name is xxx'.&lt;/P&gt;&lt;P&gt;         append wa_name to name.&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF 'xxx'&lt;/P&gt;&lt;P&gt;  IN TABLE name WITH 'PRIYA' .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:09:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092339#M1182023</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T11:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092340#M1182024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt;Move tablename-fieldname to temp var.&lt;/P&gt;&lt;P&gt;replace temp var.&lt;/P&gt;&lt;P&gt;move the temp var back to tablename-fieldname.&lt;/P&gt;&lt;P&gt;modify table.&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:10:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092340#M1182024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T11:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092341#M1182025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt; use modify.&lt;/P&gt;&lt;P&gt;for eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;123 345 abc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read that particular line with key using read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-&amp;lt;filed&amp;gt; = priya.&lt;/P&gt;&lt;P&gt;Modify &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:13:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092341#M1182025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T11:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092342#M1182026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the structure of your internal table? Can you share this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else you can try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: V_STR TYPE STRING.

LOOP AT ITAB INTO WA.
MOVE WA TO V_STR.
REPLACE ALL OCCURENECES OF '&amp;amp;' IN V_STR WITH V_TEXT. "You can pass a varaible as well
MOVE V_STR TO WA.
MODIFY ITAB INDEX SY-TABIX.
CLEAR V_STR.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting for your input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:14:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092342#M1182026</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-02-03T11:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with replace function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092343#M1182027</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;if you are replacing one reocrd than&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    REPLACE FIRST OCCURRENCE OF REGEX 'XYZ' IN wa_t090naz-afasl WITH 'PRIYA'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to alter all record where is name is XYZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;than use this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


LOOP AT it_t090naz INTO wa_t090naz.

    " Replacing v to l.

    REPLACE FIRST OCCURRENCE OF REGEX 'XYZ' IN wa_t090naz-afasl WITH 'PRIYA'.
   
   "wa_t090naz-afasl  is the name of work area of internal table and afasl is the name of field,
Endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun kayal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:25:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-replace-function/m-p/5092343#M1182027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T11:25:15Z</dc:date>
    </item>
  </channel>
</rss>

