Skip to Content
0

Download Excel with multiple sheets in Webdynpro/FPM

Dec 05, 2017 at 06:15 AM

167

avatar image
Former Member

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.

10 |10000 characters needed characters left 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.

0
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Best Answer
Maria Erdey-Gruz
Dec 05, 2017 at 11:23 AM
0

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?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member
Dec 06, 2017 at 06:03 AM
0

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Bit confused, you marked the question as answered, is your problem resolved?

0
Mike Pokraka Dec 05, 2017 at 11:29 AM
0

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?

Share
10 |10000 characters needed characters left characters exceeded
Ohnutkova Lucie Dec 19, 2017 at 04:00 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 16 at 02:15 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 16 at 02:15 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Shruti Miglani Mar 01 at 01:30 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded