Downloading Special Character Data to EXCEL using ATTACH_FILE_TO_RESPONSE
I have designed a Webdynpro application where there is one Button-Download to Excel which downloads the internal table data into Excel file .xls
The Problem is: If Internal Table contains special character like ' " ' example "BRING TEXT in one of column DESCRIPTION of internal table, the entire data in XLS file gets confined to one cell and the data below this row do not come in Excel file.
Piece of Code :
call function 'SCMS_STRING_TO_XSTRING'
text = l_input
mimetype = 'APPLICATION/MSEXCEL'
buffer = l_xstring.
* Attach file to respond
CALL METHOD cl_wd_runtime_services=>attach_file_to_response(
i_filename = l_c_filename
i_content = l_xstring
i_mime_type = l_c_excel ).
Please guide what needs to be done so that DESCRIPTION column if contains special character or simple english text everytime the data should be downloaded to XLS file in correct format.