<?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: Convert string to XML format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-xml-format/m-p/7675938#M1575540</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be highly rewarded. I need this very urgently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is basically a 'kiss of death' in my book.  I scanned down to see what your question was and didn't bother to look at your XSLT after that...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Feb 2011 14:20:55 GMT</pubDate>
    <dc:creator>brad_bohn</dc:creator>
    <dc:date>2011-02-24T14:20:55Z</dc:date>
    <item>
      <title>Convert string to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-xml-format/m-p/7675937#M1575539</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;My requirement is to download data to an excel sheet with specific formats like background color, font, size etc (can't use OLE or any function modules since I want to execute in background). I have chosen XSLT program to do this. following is my XSLT program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;asx:transform xmlns:asx="http://www.w3.org/1999/XSL/Transform"&lt;/P&gt;&lt;P&gt;               xmlns:sap="http://www.sap.com/abapxml" version="1.0"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;asx:template match="/"&amp;gt;&lt;/P&gt;&lt;P&gt;    &amp;lt;asx:copy-of select="."/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &amp;lt;html&amp;gt;&lt;/P&gt;&lt;P&gt;      &amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;table border="2"&amp;gt;&lt;/P&gt;&lt;P&gt;          &amp;lt;tr&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;th align="LEFT" colspan="7" rowspan="2"&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;font face="Arial" size="2"&amp;gt;New Bills&amp;lt;/font&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;          &amp;lt;/tr&amp;gt;&lt;/P&gt;&lt;P&gt;          &amp;lt;table border="2"&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;tr&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;font face="Arial" size="1"&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;th colspan="2" rowspan="2"&amp;gt;Payment Details&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;th colspan="3" rowspan="2"&amp;gt;Total Charge Details&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;th colspan="2" rowspan="2"/&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;/font&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;/tr&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;table border="1"&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;tr&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;font face="Arial" size="1"&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;th&amp;gt;Payment reference&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;th bgcolor="#FFFF00"&amp;gt;Payment approved (Yes/No)&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;th&amp;gt;Net charge&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;th&amp;gt;VAT&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;th&amp;gt;Total charge&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;th&amp;gt;Your Reference&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;th&amp;gt;Account Number&amp;lt;/th&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;/font&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/tr&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;asx:for-each select="catalog/cd"&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;tr&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;td&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;asx:value-of select="payref"/&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;/td&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;td&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;asx:value-of select="payapprov"/&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;/td&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;td&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;asx:value-of select="netcharge"/&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;/td&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;td&amp;gt;&lt;/P&gt;&lt;P&gt;                    &amp;lt;asx:value-of select="vat"/&amp;gt;&lt;/P&gt;&lt;P&gt;                  &amp;lt;/td&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;/tr&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/asx:for-each&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;/table&amp;gt;&lt;/P&gt;&lt;P&gt;          &amp;lt;/table&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;/table&amp;gt;&lt;/P&gt;&lt;P&gt;      &amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;    &amp;lt;/html&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;/asx:template&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/asx:transform&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a piece of code in ABAP like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_data-payref    = '100000000013'.&lt;/P&gt;&lt;P&gt;wa_data-payapprov = 'N'.&lt;/P&gt;&lt;P&gt;wa_data-netcharge = '160.00'.&lt;/P&gt;&lt;P&gt;wa_data-vat       = '20.00'.&lt;/P&gt;&lt;P&gt;APPEND wa_data TO it_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_final_data = '&amp;lt;catalog&amp;gt;'.&lt;/P&gt;&lt;P&gt;APPEND wa_final_data TO it_final_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_data INTO wa_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONCATENATE '&amp;lt;cd&amp;gt;' '&amp;lt;payref&amp;gt;' wa_data-payref '&amp;lt;/payref&amp;gt;' INTO wa_final_data.&lt;/P&gt;&lt;P&gt;  CONCATENATE wa_final_data '&amp;lt;payapprov&amp;gt;' wa_data-payapprov '&amp;lt;/payapprov&amp;gt;' INTO wa_final_data.&lt;/P&gt;&lt;P&gt;  APPEND wa_final_data TO it_final_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONCATENATE '&amp;lt;netcharge&amp;gt;' wa_data-netcharge '&amp;lt;/netcharge&amp;gt;' INTO wa_final_data.&lt;/P&gt;&lt;P&gt;  CONCATENATE wa_final_data '&amp;lt;vat&amp;gt;' wa_data-vat '&amp;lt;/vat&amp;gt;&amp;lt;/cd&amp;gt;' INTO wa_final_data.&lt;/P&gt;&lt;P&gt;  APPEND wa_final_data TO it_final_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_TABLE_TO_STRING'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    i_tabline_length = '255'&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    e_string         = ls_string&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    it_table         = it_final_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call transformation z_xml_xls_6&lt;/P&gt;&lt;P&gt;source tab = it_final_data[]&lt;/P&gt;&lt;P&gt;result xml lr_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know whether my XSLT is wrong or my ABAP code, but when I see the result of LR_STRING in debug mode I am getting tag values as for example '&amp;amp;ltvat&amp;amp;gt' rather than &amp;lt;vat&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be highly rewarded. I need this very urgently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 13:18:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-xml-format/m-p/7675937#M1575539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-24T13:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-xml-format/m-p/7675938#M1575540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be highly rewarded. I need this very urgently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is basically a 'kiss of death' in my book.  I scanned down to see what your question was and didn't bother to look at your XSLT after that...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 14:20:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-xml-format/m-p/7675938#M1575540</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2011-02-24T14:20:55Z</dc:date>
    </item>
  </channel>
</rss>

