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

Opening Excel as XML file

0 Likes
1,634

Hi,

Ive created an Excel document through a XSLT transformation. I have a string that represent an XML structure.

It starts like this :

<?xml version="1.0" encoding="utf-8"?><?mso-application progid="Excel.Sheet"?>

I think my document is fine.

But when I want to display the document with ABAP code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1234  DATA: l_xml TYPE REF TO cl_xml_document .
  CREATE OBJECT l_xml.
  CALL METHOD l_xml->parse_string EXPORTING stream = lv_xml_string.
  CALL METHOD l_xml->display.

Excel opens and there's also a popup that displays behind.. (see picture)How can I avoid this ?

Thanks
Simon

1 REPLY 1
Read only

Sandra_Rossi
Active Contributor
992

I guess CL_XML_DOCUMENT displays it in a web page, the Microsoft browser recognizes that it's an Excel file and starts Excel instead. Instead of using CL_XML_DOCUMENT, download the file in a temporary folder on the laptop, with extension .xlsx, and execute the file (using CL_GUI_FRONTEND_SERVICES, methods GET_TEMP_DIRECTORY, GUI_DOWNLOAD and EXECUTE, lots of examples in the forum and www), that will work identically to double-clicking an xlsx file from the Windows file explorer.