Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8985

Re: file is corrupted error while creating excel using xml

$
0
0

Hi Vidyasagar,

 

This solution was very helpful and I am now able to download an xls and xlsx file using this approach.

I have column headings included in my excel template. But I noticed one thing, When I enter data to be uploaded in this template and hit save , it saves it as an XML Spreadsheet, with a file extension of .XML. Is this the normal behavior, can I prevent this default.

 

Also, When I upload the excel file, it is pulling it up as an XML structure and not as an internal table

as I expected. The xlsx version is working fine, but the xls is coming up as XML.

 

I am doing the upload and download in WDA.

 

For uploading the xls version, I use the following approach -

CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = lv_data_source
IMPORTING
out_string = l_string.

 

where lv_data_source is the file content from the WDA.

Here l_string is returned all gibberish.

If I save it as .XML, it returns the XML structure.

 

Using the following option for xlsx file and that is working fine.

*Create object of class to read .xlsx file contents
CREATE OBJECT lref_excel
EXPORTING
document_name = lv_file_name
xdocument= lv_data_source.

 

 

 

Can anyone help me with the xls version, how do we read the file without having to work with the XML. Or if I am using the wrong FM to retrieve the data from the file.

 

Appreciate your input.

 

Thank you

Lalitha


Viewing all articles
Browse latest Browse all 8985

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>