<?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: Simple Transformation - XML to Internal Table Error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-xml-to-internal-table-error/m-p/5572794#M1271196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Upon further inspection and testing with a simple file and program, I can see that the XML structure isn't quite correct for the loop process.  There needs to be a single &amp;lt;PAPERWORK&amp;gt; node, instead of one for each table line in the file.  This should allow the loop to execute properly after a slight adjustment to the XSLT template.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 May 2009 19:23:26 GMT</pubDate>
    <dc:creator>brad_bohn</dc:creator>
    <dc:date>2009-05-02T19:23:26Z</dc:date>
    <item>
      <title>Simple Transformation - XML to Internal Table Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-xml-to-internal-table-error/m-p/5572793#M1271195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a webservice call that returns XML.  I need to transform a portion of the response to an internal table, but my simple transformation is not working with loop processing.  I have read through most posts regarding the topic but they're either too old or related to serialization.  There aren't any exceptions thrown, but I don't get any data in the internal table (PAPERWORK root).  Below are some code snippets.  Any ideas on the problem with the XSLT template?  Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample XML:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;PrintVersionDataSet&amp;gt;
&amp;lt;Result&amp;gt;
&amp;lt;ReturnCode&amp;gt;W&amp;lt;/ReturnCode&amp;gt; 
&amp;lt;ReturnMessage&amp;gt;There are reports with later version(s)&amp;lt;/ReturnMessage&amp;gt; 
&amp;lt;/Result&amp;gt;
&amp;lt;Paperwork&amp;gt;
&amp;lt;ReportCode&amp;gt;CVR&amp;lt;/ReportCode&amp;gt; 
&amp;lt;ReportName&amp;gt;Cover Sheet&amp;lt;/ReportName&amp;gt; 
&amp;lt;Version&amp;gt;2&amp;lt;/Version&amp;gt; 
&amp;lt;PrintedDateTime&amp;gt;2009-05-01T09:54:04.1-05:00&amp;lt;/PrintedDateTime&amp;gt; 
&amp;lt;/Paperwork&amp;gt;
&amp;lt;Paperwork&amp;gt;
&amp;lt;ReportCode&amp;gt;SPS&amp;lt;/ReportCode&amp;gt; 
&amp;lt;ReportName&amp;gt;Sponsor Summary&amp;lt;/ReportName&amp;gt; 
&amp;lt;Version&amp;gt;2&amp;lt;/Version&amp;gt; 
&amp;lt;PrintedDateTime&amp;gt;2009-05-01T09:54:04.99-05:00&amp;lt;/PrintedDateTime&amp;gt; 
&amp;lt;/Paperwork&amp;gt;
&amp;lt;/PrintVersionDataSet&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XSLT Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;?sap.transform simple?&amp;gt;
&amp;lt;tt:transform xmlns:tt="http://www.sap.com/transformation-templates"&amp;gt;

  &amp;lt;tt:root name="RESULT"/&amp;gt;
  &amp;lt;tt:root name="PAPERWORK"/&amp;gt;

  &amp;lt;tt:template&amp;gt;

    &amp;lt;PrintVersionDataSet&amp;gt;

      &amp;lt;Result tt:ref="RESULT"&amp;gt;

        &amp;lt;ReturnCode&amp;gt;
          &amp;lt;tt:value ref="RETURNCODE"/&amp;gt;
        &amp;lt;/ReturnCode&amp;gt;

        &amp;lt;ReturnMessage&amp;gt;
          &amp;lt;tt:value ref="RETURNMESSAGE"/&amp;gt;
        &amp;lt;/ReturnMessage&amp;gt;

      &amp;lt;/Result&amp;gt;

      &amp;lt;tt:deserialize&amp;gt;

        &amp;lt;tt:loop ref=".PAPERWORK"&amp;gt;

          &amp;lt;Paperwork&amp;gt;
            &amp;lt;ReportCode&amp;gt;
              &amp;lt;tt:value ref="REPORTCODE"/&amp;gt;
            &amp;lt;/ReportCode&amp;gt;

            &amp;lt;ReportName&amp;gt;
              &amp;lt;tt:value ref="REPORTNAME"/&amp;gt;
            &amp;lt;/ReportName&amp;gt;

            &amp;lt;Version&amp;gt;
              &amp;lt;tt:value ref="VERSION"/&amp;gt;
            &amp;lt;/Version&amp;gt;

            &amp;lt;PrintedDateTime&amp;gt;
              &amp;lt;tt:value ref="PRINTEDDATETIME"/&amp;gt;
            &amp;lt;/PrintedDateTime&amp;gt;

          &amp;lt;/Paperwork&amp;gt;

        &amp;lt;/tt:loop&amp;gt;

      &amp;lt;/tt:deserialize&amp;gt;

    &amp;lt;/PrintVersionDataSet&amp;gt;

  &amp;lt;/tt:template&amp;gt;

&amp;lt;/tt:transform&amp;gt; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP Call to Transform Data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TRY.
      
CALL TRANSFORMATION Z_GA_PAPERWORK_VERS_WEBSVC
      SOURCE XML LS_RESPONSE-VERIFY_PRINT_VERSION_RESULT
      RESULT RESULT     = LS_RESULT
             PAPERWORK  = LT_PAPERWORK.

    CATCH CX_ROOT INTO ROOT_EXCEPTION.

      CALL METHOD ROOT_EXCEPTION-&amp;gt;IF_MESSAGE~GET_TEXT
        RECEIVING
          RESULT = LV_MESSAGE.

  ENDTRY. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2009 16:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-xml-to-internal-table-error/m-p/5572793#M1271195</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2009-05-02T16:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Transformation - XML to Internal Table Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-xml-to-internal-table-error/m-p/5572794#M1271196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Upon further inspection and testing with a simple file and program, I can see that the XML structure isn't quite correct for the loop process.  There needs to be a single &amp;lt;PAPERWORK&amp;gt; node, instead of one for each table line in the file.  This should allow the loop to execute properly after a slight adjustment to the XSLT template.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2009 19:23:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-xml-to-internal-table-error/m-p/5572794#M1271196</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2009-05-02T19:23:26Z</dc:date>
    </item>
  </channel>
</rss>

