04-03-2014 4:43 PM
Hi Guys,
I am downloading a XLSX file to a network drive using Open Dataset but the Excel is unable to open downloaded XLSX file. If XLS extension is used then Excel is able to open the file but not XLSX. Is there some way i can achieve this without using ABAP2XLS project?
Any help with the code would be greatly appreciated.
Thanks
04-04-2014 12:26 AM
XLSX is a zipped group of xml files. You can't simply send ASCII data to the .xlsx file. So no = there is no other way as using an external (3rd party) tool, as SAP does not support .xlsx natively.
04-04-2014 10:08 AM
As Jozef has pointed changing the extension will not change the file content. But you can try the solution from ABAP Blog - Create XLSX/MHTML file from internal table in background where if you have proper SAP version you can create XLSX, XML or MHTML excel files.
Regards
Łukasz
04-04-2014 2:19 PM
Thanks for your reply, Lukasz.
I have seen this blog earlier but the problem is the code will eventually help to create file at Presentation Server but it will not work to create file at Application Server using Open Dataset.
04-04-2014 2:29 PM
the method which creates xlsx is creating xstring, so you can write it to AS using open dataset in binary mode...
04-04-2014 6:23 PM
If you check the below code, We have to assign a constant value of c_type_xlsx to file type but the problem is this constant is not available in my system which is SAP BASIS 701 release but it is available in SAP BASIS 730 release.
"if we flag i_XLSX then we'll create XLSX if not then MHTML excel file
if i_xlsx is not initial.
m_file_type = if_salv_bs_xml=>c_type_xlsx.
else.
m_file_type = if_salv_bs_xml=>c_type_mhtml.
endif.
04-04-2014 8:36 PM
In that case beside ABAP2XLSX I don't see any solution for you for real XLSX file in the background, if you run it in foreground then you can still use OLE or SOI (Sap Office Integration).
Regards
Lukasz
04-07-2014 5:43 PM