<?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: Help on XML transformation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309833#M1535331</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 don't think the issue is at the loop, it could be inside the loop &lt;/P&gt;&lt;P&gt;i mean the way you declare your elements and attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check you structure and if possible try to replicate the same example on the link that gives you an idea on how to drive with the XSLT TOOL &lt;/P&gt;&lt;P&gt;If you can send the ST structure i can have a look&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one more way of converting itab to xml format, check the below code as well &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_XML_DOC_NAME = 'xmldocument'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;PE_BIN_FILESIZE = BIN_SIZE&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;I_TAB_SAP_DATA = T_EXTRACT " your table name&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;I_TAB_CONVERTED_DATA = XMLTAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_FAILED = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CALL METHOD CL_RSZ_WWW_DB_INTERFACE=&amp;gt;CONVERT_RAW_TO_CHAR&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_T_IN = XMLTAB&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;E_T_OUT = GT_ITAB[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Sep 2010 14:27:57 GMT</pubDate>
    <dc:creator>anesh_kumar</dc:creator>
    <dc:date>2010-09-24T14:27:57Z</dc:date>
    <item>
      <title>Help on XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309830#M1535328</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;&lt;/P&gt;&lt;P&gt;I discover the XML in SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal is to integrate an xml file in SAP using an ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;File:&lt;/U&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;A&amp;gt;
      &amp;lt;B&amp;gt;
             &amp;lt;C&amp;gt;Val 1&amp;lt;/C&amp;gt;
             &amp;lt;D&amp;gt;Val 2 &amp;lt;/D&amp;gt; 
             &amp;lt;E&amp;gt;Val 3 &amp;lt;/E&amp;gt;
      &amp;lt;/B&amp;gt;
      &amp;lt;B&amp;gt;
             &amp;lt;C&amp;gt;Val 4&amp;lt;/C&amp;gt;
             &amp;lt;D&amp;gt;Val 5&amp;lt;/D&amp;gt; 
             &amp;lt;E&amp;gt;Val 6&amp;lt;/E&amp;gt;
      &amp;lt;/B&amp;gt;
&amp;lt;/A&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I create a table type include a structure with the following fields: C, D, E (all in char100).&lt;/P&gt;&lt;P&gt;A is the root and B a node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i try the test mode using a file, i have the following error (No Valide XSLT supplied program)...&lt;/P&gt;&lt;P&gt;When i try the transformation in an ABAP program, i have a dump...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help on this topic?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked on the web but i do not find some beginer's guide on the transaction XSLT_TOOL....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: David31 on Sep 23, 2010 3:45 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 13:45:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309830#M1535328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-23T13:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help on XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309831#M1535329</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;1. Write XSLT program. T.code XSLT . e.g. XSLT name "ZTRANS".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Write ABAP program&lt;/P&gt;&lt;P&gt;Which includes declaration of internal tables&lt;/P&gt;&lt;P&gt;that you need "IT_DATA".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upload XML data to an internal table "IT_XML "&lt;/P&gt;&lt;P&gt;use below statement to convert XML to internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call transformation ZTRANS&lt;/P&gt;&lt;P&gt;source XML IT_XML&lt;/P&gt;&lt;P&gt;result IT_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this [Link|http://sapblog.rmtiwari.com/2009/04/generate-simple-transformation-for-xml.html] as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 13:59:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309831#M1535329</guid>
      <dc:creator>anesh_kumar</dc:creator>
      <dc:date>2010-09-23T13:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help on XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309832#M1535330</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;&lt;/P&gt;&lt;P&gt;I progress a few.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now using the transformation in my program. I have an error on &amp;lt;tt:loop ref="A"&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Transformation:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;1 &amp;lt;?sap.transform simple?&amp;gt;                                                                     
    2 &amp;lt;tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www. 
    3   &amp;lt;tt:root name="A" type="ddic:TABLE_TYPE"/&amp;gt;                             
    4   &amp;lt;tt:template&amp;gt;                                                                                
5     &amp;lt;A&amp;gt;                                                                      
    6     &amp;lt;tt:loop ref="A"&amp;gt;     &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;                                                 
    7         &amp;lt;B&amp;gt;                                                                   
    8           &amp;lt;target tt:value-ref="C"/&amp;gt;                                                    
    9           &amp;lt;atributename tt:value-ref="D"/&amp;gt;                                        
   10           &amp;lt;value tt:value-ref="E"/&amp;gt;                                                      
   11         &amp;lt;/B&amp;gt;                                                                  
   12       &amp;lt;/tt:loop&amp;gt;                                                                                
13     &amp;lt;/A&amp;gt;                                                                     
   14   &amp;lt;/tt:template&amp;gt;                                                                                
15 &amp;lt;/tt:transform&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i read the previous post (link) i do not see where is the mistake....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 08:15:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309832#M1535330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-24T08:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help on XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309833#M1535331</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 don't think the issue is at the loop, it could be inside the loop &lt;/P&gt;&lt;P&gt;i mean the way you declare your elements and attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check you structure and if possible try to replicate the same example on the link that gives you an idea on how to drive with the XSLT TOOL &lt;/P&gt;&lt;P&gt;If you can send the ST structure i can have a look&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one more way of converting itab to xml format, check the below code as well &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_XML_DOC_NAME = 'xmldocument'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;PE_BIN_FILESIZE = BIN_SIZE&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;I_TAB_SAP_DATA = T_EXTRACT " your table name&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;I_TAB_CONVERTED_DATA = XMLTAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_FAILED = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CALL METHOD CL_RSZ_WWW_DB_INTERFACE=&amp;gt;CONVERT_RAW_TO_CHAR&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_T_IN = XMLTAB&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;E_T_OUT = GT_ITAB[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 14:27:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309833#M1535331</guid>
      <dc:creator>anesh_kumar</dc:creator>
      <dc:date>2010-09-24T14:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help on XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309834#M1535332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If 'A' is your root, then your ST program should look like the below code.  This will render your internal table in your program.  There are some help files on ST syntax but they aren't very good...&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="A"/&amp;gt;
  &amp;lt;tt:template&amp;gt;
    &amp;lt;A&amp;gt;
      &amp;lt;tt:loop name="line" ref=".A"&amp;gt;
        &amp;lt;B&amp;gt;
          &amp;lt;C&amp;gt;
            &amp;lt;tt:value ref="$line.C"/&amp;gt;
          &amp;lt;/C&amp;gt;
          &amp;lt;D&amp;gt;
            &amp;lt;tt:value ref="$line.D"/&amp;gt;
          &amp;lt;/D&amp;gt;
          &amp;lt;E&amp;gt;
            &amp;lt;tt:value ref="$line.E"/&amp;gt;
          &amp;lt;/E&amp;gt;
        &amp;lt;/B&amp;gt;
      &amp;lt;/tt:loop&amp;gt;
    &amp;lt;/A&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 15:04:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-on-xml-transformation/m-p/7309834#M1535332</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2010-09-24T15:04:11Z</dc:date>
    </item>
  </channel>
</rss>

