Skip to Content
avatar image
Former Member

Download Excel with multiple sheets in Webdynpro/FPM

Hi Communinty,

I need to download an excel document with multiple sheets from webdynpro/FPM. I have tried OLE objects for download but it's not supporting Webdynpro ui. Is there any possibility to download excel with sheets using CL_FDT_XL_SPREADSHEET class?

Please let me know if any other ways to download excel sheets.

Thanks for the help.

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    Hi Laxmiprasad,

    Did you get any solution on this. Please let me know, i have same requirement.

    Download 2 internal tables data into two sheets of an excel.

    Thanks, Srini.

  • Get RSS Feed

7 Answers

  • Best Answer
    Dec 05, 2017 at 11:23 AM

    CL_FDT_XL_SPREADSHEET is only for internal usage and is reserved only for BRF+, as it is also described in SAP Note 2468709.

    Do you need to download just a xls file or you want to export an ALV table?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 06, 2017 at 06:03 AM

    Hi Maria and Mike.. Thanks for your response.

    The requirement is, I have data in 10 internal tables. Need to download all the internal tables data into single excel document with separate sheets per each from the webdynpro component.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 05, 2017 at 11:29 AM

    You can download excel spreadsheets just like any other file by attaching it to the response.

    Is your question about downloading or generating an Excel spreadsheet?

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 19, 2017 at 04:00 PM

    Hi, I had the same problem, just check simple transformation - it will help you. I´m doing all my excel downloads using simple transformations and it works!!

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 16 at 02:15 AM

    HI

    Pl find below a code snippet which I had used earlier


    // Fill header fields

    CONCATENATE lv_str

    'Obj Type'

    'Document No.'

    'Partner Fct'

    cl_abap_char_utilities=>newline

    INTO lv_str

    SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

    // Fill line items

    Loop all entries

    CONCATENATE

    lv_str

    ls_cbp_list-object_type

    ls_cbp_list-object_id

    ls_cbp_list-partner_fct

    INTO lv_str

    SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

    ENDLOOP.

    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

    EXPORTING

    text = lv_str

    * MIMETYPE = ' '

    * ENCODING =

    IMPORTING

    buffer = lv_xstr

    EXCEPTIONS

    failed = 1

    OTHERS = 2.

    IF sy-subrc <> 0.

    * Implement suitable error handling here

    ENDIF.

    // Download to excel

    wdr_task=>client_window->client->attach_file_to_response(

    i_filename = 'table.xls'

    i_content = lv_xstr

    i_mime_type = 'EXCEL' ).

    Regards

    Vinita

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 16 at 02:15 AM

    HI

    Pl find below a code snippet which I had used earlier


    // Fill header fields

    CONCATENATE lv_str

    'Obj Type'

    'Document No.'

    'Partner Fct'

    cl_abap_char_utilities=>newline

    INTO lv_str

    SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

    // Fill line items

    Loop all entries

    CONCATENATE

    lv_str

    ls_cbp_list-object_type

    ls_cbp_list-object_id

    ls_cbp_list-partner_fct

    INTO lv_str

    SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

    ENDLOOP.

    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

    EXPORTING

    text = lv_str

    * MIMETYPE = ' '

    * ENCODING =

    IMPORTING

    buffer = lv_xstr

    EXCEPTIONS

    failed = 1

    OTHERS = 2.

    IF sy-subrc <> 0.

    * Implement suitable error handling here

    ENDIF.

    // Download to excel

    wdr_task=>client_window->client->attach_file_to_response(

    i_filename = 'table.xls'

    i_content = lv_xstr

    i_mime_type = 'EXCEL' ).

    Regards

    Vinita

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 01 at 01:30 PM

    Hi, did you get any resolution for this issue? I am able to download my data in an excel file using method attach_file_to_response() but need to create multiple sheets in excel.

    Add comment
    10|10000 characters needed characters exceeded