<?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: About replace stmt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-replace-stmt/m-p/4584377#M1081380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mr.A,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an internal table just to hold the BATCH CHARACTERISTICs and their respective REPLACEMENT values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop this internal table and do as you given in the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of that Hardcoded value put the workarea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  LOOP AT IT_BATCH INTO WA_BATCH.
    FIND WA_BATCH-BC IN str.
    if sy-subrc = 0.
      REPLACE ALL OCCURRENCES OF REGEX WA_BATCH-BC IN STR WITH WA_BATCH-RV.
      write str.
    endif.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, BC is the Batch Characteristics.&lt;/P&gt;&lt;P&gt;         RV is the Replacement Value.&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;R.Nagarajan.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt; We can -&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Oct 2008 05:16:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-06T05:16:02Z</dc:date>
    <item>
      <title>About replace stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-replace-stmt/m-p/4584376#M1081379</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 have a string say 'C100&lt;STRONG&gt;C110&lt;/STRONG&gt;C120*( 100-C130 )', in which c100,c110,c120... are different batch characteristics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String and Batch characteristics may vary from batch to batch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i need to do is to replace these c100,c110 etc..with some values related to them .&lt;/P&gt;&lt;P&gt;ie: c100 with 500, c110 with 250, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to do it is by using find and replace statements,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;FIND 'C100' IN str.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF REGEX 'C100' IN STR WITH '500'.&lt;/P&gt;&lt;P&gt;write str.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there may be number of characteristics....and i need to repeat the above procedure n times for n number of batches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so is there any alternative to do it???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2008 05:04:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-replace-stmt/m-p/4584376#M1081379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-06T05:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: About replace stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-replace-stmt/m-p/4584377#M1081380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mr.A,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an internal table just to hold the BATCH CHARACTERISTICs and their respective REPLACEMENT values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop this internal table and do as you given in the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of that Hardcoded value put the workarea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  LOOP AT IT_BATCH INTO WA_BATCH.
    FIND WA_BATCH-BC IN str.
    if sy-subrc = 0.
      REPLACE ALL OCCURRENCES OF REGEX WA_BATCH-BC IN STR WITH WA_BATCH-RV.
      write str.
    endif.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, BC is the Batch Characteristics.&lt;/P&gt;&lt;P&gt;         RV is the Replacement Value.&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;R.Nagarajan.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt; We can -&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2008 05:16:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-replace-stmt/m-p/4584377#M1081380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-06T05:16:02Z</dc:date>
    </item>
  </channel>
</rss>

