<?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: SO10 text - replace with itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798111#M40641</link>
    <description>&lt;P&gt;Thanks for your responses. &lt;/P&gt;&lt;P&gt;The nested LOOP sollution is the best solution for me. So I can use the SO10 textes that are also translateable.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 13:46:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2019-02-01T13:46:31Z</dc:date>
    <item>
      <title>SO10 text - replace with itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798107#M40637</link>
      <description>&lt;P&gt;Hello together,&lt;/P&gt;
  &lt;P&gt;If I have a SO10 text and single variables I know what I have to do to replace them. But in my case I would like to take a SO10 text with an itab.&lt;/P&gt;
  &lt;P&gt;For example: If have the following SO10 Text:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;Error with article:
- Articlenumber: $NO&amp;amp;$ -&amp;gt; Reason: $REASON$&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;and an itab with the colums NO and REASON.&lt;/P&gt;
  &lt;P&gt;I want that the second line will be repeated for each line in the itab. &lt;/P&gt;
  &lt;P&gt;Does any body has an idea how do I achive this? Have I use smartforms?&lt;/P&gt;
  &lt;P&gt;The output later should be html code.&lt;/P&gt;
  &lt;P&gt;Best regards&lt;BR /&gt;Uwe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 11:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798107#M40637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-01T11:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: SO10 text - replace with itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798108#M40638</link>
      <description>&lt;P&gt;You mean you don't need to generate a Smart Form, only HTML? Why are you using a standard text then, can't it be more simple to do a custom solution?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:16:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798108#M40638</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-02-01T12:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: SO10 text - replace with itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798109#M40639</link>
      <description>&lt;P&gt;Why not just loop the itab and repeat that SO10 text for each line?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:44:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798109#M40639</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-02-01T12:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: SO10 text - replace with itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798110#M40640</link>
      <description>&lt;P&gt;If you are asking for the ABAP logic, it is a nested LOOP: go over the table of text lines, copy the line as a pattern and DELETE it if it has placeholders and LOOP over the internal table data, REPLACE the placeholders and INSERT the result into the text table.&lt;/P&gt;&lt;P&gt;Maybe like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;        lt_text = get_standard_text( ) " --&amp;gt; INTO 
        LOOP AT lt_text INTO DATA(ls_text) WHERE tdline CS '$REASON$'.
          DATA(lv_tabix) = sy-tabix.
          DELETE lt_text.
          LOOP AT it_data ASSIGNING FIELD-SYMBOL(&amp;lt;ls_entry&amp;gt;).
            DATA(ls_new) = ls_text.
            REPLACE:
               '$NO&amp;amp;$' IN ls_new-tdline WITH &amp;lt;ls_entry&amp;gt;-no,
               '$REASON$' IN ls_new-tdline WITH &amp;lt;ls_entry&amp;gt;-reason.
            CONDENSE ls_new-tdline.

            INSERT ls_new INTO mt_text INDEX lv_tabix.
            CHECK sy-subrc EQ 0.
            ADD 1 TO l_tabix.
          ENDLOOP.
          EXIT.
        ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But as you want an HTML output, I would prefer a transformation&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    DATA l_stream TYPE xstring. " or string

    CALL TRANSFORMATION your_transformation
      OPTIONS xml_header = 'no'
      SOURCE body = it_data
      RESULT XML l_stream.&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?sap.transform simple?&amp;gt;
&amp;lt;tt:transform template="my_template"  xmlns:tt="http://www.sap.com/transformation-templates"&amp;gt;
&amp;lt;tt:root name="BODY"/&amp;gt;
&amp;lt;tt:template name="my_template"&amp;gt;
&amp;lt;html xmlns:html="http://www.w3.org/TR/REC-html40"&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;table border='0' cellpadding='0' cellspacing='0'&amp;gt;
 &amp;lt;tr&amp;gt;
  &amp;lt;td&amp;gt;No.&amp;lt;/td&amp;gt;
  &amp;lt;td&amp;gt;Reason&amp;lt;/td&amp;gt;
 &amp;lt;/tr&amp;gt;
 &amp;lt;tt:loop ref="BODY"&amp;gt;
 &amp;lt;tr&amp;gt;
  &amp;lt;td&amp;gt;&amp;lt;tt:value ref="NO"/&amp;gt;&amp;lt;/td&amp;gt;
  &amp;lt;td&amp;gt;&amp;lt;tt:value ref="REASON"/&amp;gt;&amp;lt;/td&amp;gt;
 &amp;lt;/tr&amp;gt;
 &amp;lt;/tt:loop&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&amp;lt;/tt:template&amp;gt;
&amp;lt;/tt:transform&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;JNN&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:54:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798110#M40640</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2019-02-01T12:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: SO10 text - replace with itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798111#M40641</link>
      <description>&lt;P&gt;Thanks for your responses. &lt;/P&gt;&lt;P&gt;The nested LOOP sollution is the best solution for me. So I can use the SO10 textes that are also translateable.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798111#M40641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-01T13:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: SO10 text - replace with itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798112#M40642</link>
      <description>&lt;P&gt;Please use the button Comment, the Answer is only for proposed solutions.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so10-text-replace-with-itab/m-p/798112#M40642</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-02-01T13:48:29Z</dc:date>
    </item>
  </channel>
</rss>

