Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Proble With XSLT Program

Former Member
0 Likes
602

I have created a XSLT Program for an abap internal table.by using the foolowing code

CALL TRANSFORMATION z_mm__xls

SOURCE root = gt_po_data

RESULT XML gv_xml_result.

after this when i tried to download to presentation server using FM *cl_gui_frontend_services=>gui_download* i am unable to get the contents in excel.

Please find my XSLT code below

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

<tt:root name="ROOT"/>

<tt:template>

<?mso-application progid="Excel.Sheet"?>

<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s=

"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">

<STYLES>

<STYLE ss:ID="Default" ss:Name="Normal">

<Alignment ss:Vertical="Bottom"/>

<Borders/>

<Font/>

<Interior/>

<NumberFormat/>

<Protection/>

</STYLE>

<STYLE ss:ID="s21">

<NumberFormat ss:Format="Short Date"/>

</STYLE>

<STYLE ss:ID="s22">

<NumberFormat ss:Format="Standard"/>

</STYLE>

</STYLES>

<Worksheet ss:Name="spend_catalogen">

<NAMES>

<NamedRange ss:Hidden="1" ss:Name="_FilterDatabase" ss:RefersTo="=spend_catalogen!R1C1:R65536C15"/>

</NAMES>

<TABLE>

<COLUMN ss:Width="157.75"/>

<COLUMN ss:Index="20" ss:Width="150.25"/>

<COLUMN ss:Index="7" ss:Width="150.75"/>

<ROW>

<CELL>

<DATA ss:Type="String">sold-tor</DATA>

<NAMEDCELL ss:Name="_FilterDatabase"/>

</CELL>

<Cell>

<Data ss:Type="String">ship-to</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Special stock</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">End user</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Sched.Agr.</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Cust.material</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">MRP Material</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Plant</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Finishing line</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Zero date</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Alignment date</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Last run MRP</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Week</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Date</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Ordered Quantity</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Cml.released qty</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Quantity to be Delivered</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Quantity to be Produced</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Base Unit</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Last Material Ref.Millr</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Cons. Stock</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Stock on wheels</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Reshipper stock</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Plant Stock</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Thickness</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Width</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">Length</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

</ROW>

<tt:loop name="line" ref=".ROOT">

<Row>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.soldto"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.shipto"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.specil"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.endusr"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.vbeln"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell ss:StyleID="s21">

<Data ss:Type="String">

<tt:value ref="$line.kdmat"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.matnr"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.werks"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.zzpp16"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.cydat"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.aldate"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.lrdate"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="Number">

<tt:value ref="$line.week"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.date"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.ordqty"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.cumqty"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.delqty"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.proqty"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.meins"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.lmatnr"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.consi"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.stock"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.reshi"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.pstock"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.zzdi03"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.zzdi06"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="$line.zzdi09"/>

</Data>

<NamedCell ss:Name="_FilterDatabase"/>

</Cell>

</Row>

</tt:loop>

</TABLE>

<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">

<Selected/>

<Panes>

<Pane>

<Number>3</Number>

<ActiveRow>25</ActiveRow>

<ActiveCol>26</ActiveCol>

</Pane>

</Panes>

<ProtectObjects>False</ProtectObjects>

<ProtectScenarios>False</ProtectScenarios>

</WorksheetOptions>

<AutoFilter xmlns="urn:schemas-microsoft-com:office:excel" x:Range="R1C1:R65536C15"/>

</Worksheet>

</Workbook>

</tt:template>

</tt:transform>

Kindly help me to solve my problem..

2 REPLIES 2
Read only

Former Member
0 Likes
503

Hi,

You can try using JDBC adapter in the receiver side, By which you will be able to get you data in a MS Access database. And then you can try extracting the database table records into an excel file.

Regards,

Suvendu

Read only

rainer_hbenthal
Active Contributor
0 Likes
503

1) What type is gv_xml_result

2) use this fm


call function 'DISPLAY_XML_STRING'
      exporting
        xml_string      = gv_xml_result
      exceptions
        no_xml_document = 1
        others          = 2.

to display your xml an the ABAP side. Is it correct?