03-12-2009 1:51 PM
Hi Friends,
I have copied a report 'ZMULTIEXCEL' from www.sapdev.co.uk site.
I would like to create an excel file with multiple sheets through an abap report and attach to an email and I have to send that excel file. But when I am going to run the report, excel has been created successfully and also dynamically excel file is opening. But I don't want to open excel file dynamically.
I want to attach that excel file to an email id. Could you please help me?.
03-13-2009 5:40 AM
03-19-2009 8:30 AM
Hello.
When having created an Excel-file via OLE, just do the following:
1) Save it
You may generate the file-name dynamically, eg. using the timestamp information. You will save it somewhere on the client...
2) Close it
Like shown in ZMULTIEXCE, or you replace
CALL METHOD OF workbook 'Add'.
with
CALL METHOD OF workbook 'Add' = single_wb.
Then you can close the workbook with
CALL METHOD OF single_wb 'Close'.
3) Import
Import the file via CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD, using filetype = BIN, into an internal table
it_data TYPE solix_tab
4) Send as an email
I would suggest to use class CL_BCS (therefore the above definition of the external table), see examples in package SBCOM
Hope this helps,
Greetings.
03-19-2009 1:53 PM
Could you please provide any example report, if possible. Thank you for your reply.