This website is not affiliated with, sponsored by, or approved by SAP AG.

Open XML in Excel without downloading to a file

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Open XML in Excel without downloading to a file

Postby q4u » Mon Aug 13, 2018 4:13 am

I have an internal table filled with XML for an Excel sheet. I can open it in Excel by downloading to a file and opening the file (sample code below).
However can this (the internal table XML data) be opened in Excel without downloading it to a file first? Thanks.

CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = lv_size
filename = lv_filename
filetype = 'BIN'
CHANGING
data_tab = lt_xml
EXCEPTIONS
OTHERS = 1.

cl_gui_frontend_services=>execute(
EXPORTING
document = lv_filename
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10 ).
q4u
 
Posts: 441
Joined: Wed Mar 08, 2006 7:02 am

Re: Open XML in Excel without downloading to a file

Postby q4u » Mon Aug 13, 2018 4:55 am

Solved using i_oi_document_proxy:

data cl_document type ref to i_oi_document_proxy.
cl_document->open_document_from_table( exporting document_size = lv_size
document_table = lt_xml
open_inplace = 'X' ).
q4u
 
Posts: 441
Joined: Wed Mar 08, 2006 7:02 am


Return to ABAP

Who is online

Users browsing this forum: Google Adsense [Bot] and 4 guests





This website is not affiliated with, sponsored by, or approved by SAP AG.