Skip to Content
avatar image
Former Member

Download Internal table to Excel

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 17, 2010 at 10:34 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 17, 2010 at 11:55 AM

    >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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 20, 2010 at 10:30 AM

    Its fixed i deleted add new_line for each itm

    Add comment
    10|10000 characters needed characters exceeded