3 Replies Latest reply: Sep 20, 2010 12:30 PM by Vinoth Rajendran RSS

Download Internal table to Excel

Vinoth Rajendran
Currently Being Moderated

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

  • Re: Download Internal table to Excel
    Tejaswini Chafekar
    Currently Being Moderated

    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.

  • Re: Download Internal table to Excel
    Thomas Jung
    Currently Being Moderated

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

  • Re: Download Internal table to Excel
    Vinoth Rajendran
    Currently Being Moderated

    Its fixed i deleted add new_line for each itm

Actions