Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Excel-File per Email with class CL_DOCUMENT_BCS

frank_bork
Participant
0 Kudos

Hi all,

What I need is an excel file with subtotals as EMail-Attachment.

I created an ALV-List with the subtotals, converted the ALV to BIN-Data via Method CL_SALV_TABLE->TO_XML and created the attachment in the mail via class CL_DOCUMENT_BCS.

The Email is looking fine and the excel Attachment is there.

But If I try to open the attachment in SOST I get the following Message:

Excel cannot open the file ''Attachment_20150129111717.173_X.XLS' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

If I open the file the excel is showing the correct data including the subtotals.

Is there any posiibilty to avoid the message above?

Remark: I can open the file without any problems with office version 2003, but in all newer versions I get the above message.

Thanks a lot.

Kind regards

Frank

1 ACCEPTED SOLUTION

former_member200338
Active Contributor
0 Kudos

Refer to link below.

3 REPLIES 3

former_member200338
Active Contributor
0 Kudos

Refer to link below.

0 Kudos

Thanks for your quick answer.

I found a solution in the method CL_SALV_TABLE->TO_XML to avoid the message in excel

0 Kudos

Hi Frank,

What other solution you found ? Kindly share the same. I am getting the same problem and cannot use tool like abap2xls etc.

Thanks

Rakesh