cancel
Showing results for 
Search instead for 
Did you mean: 

Download Internal table to Excel

Former Member
0 Kudos

Hi,

I have Webdynpro ABAP component. In this I am downloading some internal table data into spread sheet using following code. In that first column is appending with empty data.

CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

EXPORTING

text = ls_text

IMPORTING

buffer = ls_xtext.

wdr_task=>client_window->client->attach_file_to_response(

**path to the word file

i_filename = 'WDP.xls'

  • String Variable

i_content = ls_xtext

  • File Type

i_mime_type = 'EXCEL' ).

Please help in resolving this issue.

Regards,

vinoth

Edited by: vinoth rajendran on Sep 17, 2010 12:08 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Its fixed i deleted add new_line for each itm

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>In that first column is appending with empty data.

I'm guessing it has to do with how you built your ls_text string. It is probably text tab delimited. You probably are inserting a tab before the first column of data. We would have to see your logic for building ls_text to be sure, but it seems like the likely candidate.

Former Member
0 Kudos

Hello Vinoth,

Can you please try using class method 'cl_wd_runtime_services=>attach_file_to_response' directly instead of 'wdr_task'.


* Convert to Excel
        cl_wd_runtime_services=>attach_file_to_response(
                                i_filename      = 'C:\FILE.XLS'
                                i_content       = lo_final_string
                                i_mime_type     = 'APPLICATION/MSEXCEL'
*                               i_in_new_window = abap_true
*                               i_inplace       = abap_true
                                 ).

Hope this resolves the issue.

Kind Regards,

Tejaswini.