cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

create and download Excel file with multiple worksheet in sap webdynpro abap

Ajay_Kumar
Explorer
0 Likes
2,126

Hello All, I have a requirement, in which i need to create create and download XLSX file from Webdynpro ABAP.

I am able to create simple XLSX file and download it, but i am not able to create XLSX file with multiple worksheet.

I have data in xstring format and using cl_wd_runtime_services=>attach_file_to_response  to download excel file.

Kindly guide me , how can i create multiple worksheet in same excel file in webdynpro abap.

I am following below process:

I am creating and xlsx file from webdynpro abap. I am able to create a xlsx file with one worksheet using the standard functionality of sap.
1. getting reference of internal table.

2. using cl_salv_table=>factory to create the reference of output data.

3. Using cl_salv_controller_metadata=>get_lvc_fieldcatalog  to create the field catalogue.

4. Using cl_salv_ex_util=>factory_result_data_table, input is the field catalogue and the refernce internal table.

5. cl_salv_bs_tt_util=>if_salv_bs_tt_util~transform  is used to transform this data in xtsring .

6. this way the xlsx created is perfect, there is no need to formatting and other issue, Xlsx cerated will be same as we get using the standard EXPORT button.

7. use cl_wd_runtime_services=>attach_file_to_response  to download the xlsx file.

8. I want to add new worksheet in this excel, is there is any way, pls guide.

Accepted Solutions (0)

Answers (2)

Answers (2)

Ajay_Kumar
Explorer
0 Likes

Thanks for your comments, let me reshape my question.
I am creating and xlsx file from webdynpro abap. I am able to create a xlsx file with one worksheet using the standard functionality of sap.
1. getting reference of internal table.

2. using cl_salv_table=>factory to create the reference of output data.

3. Using cl_salv_controller_metadata=>get_lvc_fieldcatalog  to create the field catalogue.

4. Using cl_salv_ex_util=>factory_result_data_table, input is the field catalogue and the refernce internal table.

5. cl_salv_bs_tt_util=>if_salv_bs_tt_util~transform  is used to transform this data in xtsring .

6. this way the xlsx created is perfect, there is no need to formatting and other issue, Xlsx cerated will be same as we get using the standard EXPORT button.

7. use cl_wd_runtime_services=>attach_file_to_response  to download the xlsx file.

8. I want to add new worksheet in this excel, is there is any way, pls guide.

 

Sandra_Rossi
Active Contributor
0 Likes
Please do not post a solution for commenting the question. Use the "Show replies" of the question > Comment. Or better edit your question.
Ajay_Kumar
Explorer
0 Likes

Hello,

Thanks for your response.

I am searching from many days, but not able to get answer.

I can create Excel file, but the challenge is to create multiple worksheet in the Excel file.

If you know any answer, kindly guide me to the post.

Thanks.

Sandra_Rossi
Active Contributor
0 Likes
Please do not post a solution for commenting the question. Use the "Show replies" of the question > Comment.
SapRay001
Newcomer
0 Likes
Ajay - its been over a year - were you able to get a solution? You asked a question properly - not sure why the two other posters commented the way that they did.