2010 Mar 17 2:52 AM
Hi All,
I have existing program which sends email with HTML attachment. I would like to convert the attachment format to EXCEL format. Do you have any idea on how to do this?
I did some research and found that it can be done via SCOT config. But i just want to make sure that there's no abap code change. The program used FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'. Packing list documnet type is HTM.
Please advice.
Thanks so much in advance.
Hi All,
I have existing program which sends email with HTML attachment. I would like to convert the attachment format to EXCEL format. Do you have any idea on how to do this?
I did some research and found that it can be done via SCOT config. But i just want to make sure that there's no abap code change. The program used FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'. Packing list documnet type is HTM.
Please advice.
Thanks so much in advance.
2010 Mar 17 3:06 AM
Hi,
<li>I think that you have to modify code to send mail with XLS attachment, set below one after attachment table is built.
<li>Check the existing packing table how the data is passed when docutype is HTM.
Thanks
Venkat.Ow_packing_list-doc_type = 'XLS'.
2010 Mar 17 3:52 AM
Thanks for prompt reply.
I have changed the document type to 'XLS'. But the problem now, the excel doesn't contain correct output. I think is more of unicode characters.
Can you help me on this? Thanks
2010 Mar 17 4:09 AM
Hi,
<li>There are 3 exp parameters related to attachments in FM
<li>If you are sending text file or xls file as attachments, use CONTENTS_TXT parameter instead of CONTENTS_BIN and CONTENTS_HEX.
Thanks
Venkat.O
CONTENTS_BIN LIKE SOLISTI1 Obsolete: See Contents_Hex
CONTENTS_TXT LIKE SOLISTI1 ASCII contents of object and attachments
CONTENTS_HEX LIKE SOLIX Binary contents of object and attachments
2010 Mar 17 6:04 AM
I still get the wrong excel contents. The excel contains the html codes. what would I need to correct the values on excel.
Appreciate your help. Thanks a lot.
2010 Mar 17 6:08 AM
Dear friend, <li>Go through the program where attachment is being built, there you will see HTML tags, then decide instead of HTML tags, what needs to be replaced. Thanks Venkat.O
2010 Mar 17 7:02 AM
2 things you can do!!
1) First write a sample program for sending excel attachment mail
->You can definetly tons of programs here or in your own system also you can see ...its easy way
-> Then you can Compare the Excel mail attachment program with the Existing HTML program
2) At last nothing works out ..Please past your code !! But make it as final option
Best wishes
sas
2010 Mar 17 6:29 AM
Hi
First you need to check in your program, how they are filling the attachement table while passing the "SO_NEW_DOCUMENT_ATT_SEND_API1"
Define a new internal table type solisti1 and try to fill the contents seperated by '#' or CL_ABAP_CHAR_UTILITIES-HORIZONTAL_TAB
packlist-doc_type 'XLS' and try to execute the fm.
Thanks
Praveen
2010 Mar 17 6:50 AM
Hi,
SAP_CONVERT_TO_XLS_FORMAT function module converts data to excel format.
2010 Mar 17 8:12 AM
hi Akaira,
you can use the following function module "SO_NEW_DOCUMENT_ATT_SEND_API1"
use the fiollowing class "cl_abap_char_utilities" to build the Excel data table from this class use the attributes "CR_LF" and "HORIZONTAL_TAB",
or
if you kow the SpoolID then you can do the following thing
Use Function "RSPO_DISPLAY_SPOOLJOB" to automate the process of display.
u then can download to Excel.
"RSPO_DOWNLOAD_SPOOLJOB" downloads to a flat fileThat could be processed to CSV & captured into Excel.
Try "SE37 RSPO_DOWNLOAD_SPOOLJOB" single test nothing could be easier.
and simple and easy manual process is :
1. SP01 and see your entry
2. Click on Type or Display Button or F6
3. It may show 1st 10 pages
4. Click on settings in the display
Change last page
5. Ignore memory warning - whisper 'Joy Ma Kaali'
6. Right click & Save to Local File as Excel!
************************************************************************************************
if it is not clear then please let me know I will provide you the example program
Regards,
Arif
2010 Mar 17 8:51 AM
Hi,
what ever way you go, it will never work in background. The excel installation on your client (PC) must be used to create MS excel proprietary format.
If you do not want proprietary binary MS excel format but something excel can read (tab-delimited, CSV, mhtmlm...) there are more ways. But first you need to know what you want.
Regards,
Clemens
2010 Mar 17 8:46 AM
I don´t understand exactly why do you need to do this. But if you want to generate the Excel programatically, you can use approach presented in my blog here: /people/otto.gold/blog/2010/02/11/happy-reporting-with-excel-ii
Otto
2010 Mar 17 11:10 AM
thanks to all your replies.
I need to convert the html format because it caused too big file attachment which exceeds to 20 MB.
Now, i am able to get the html file but the contents are displayed in the first line of the excel.
Do you have any ideas on this?
Thanks again.
2010 Mar 17 1:59 PM
Hi akira,
if size is the issue, i wonder why any excel shouls be significantly smaller.
You can use Class CL_ABAP_GZIP and its static methods
COMPRESS_TEXT
DECOMPRESS_TEXT
COMPRESS_BINARY
DECOMPRESS_BINARYto shrink to an appropriate size.
Regards,
Clemens
2010 Mar 17 3:08 PM
what ever way you go, it will never work in background
This is not true!! If you would read a blog I have mentioned above (part 2), you would understand that works the way it generates the xml file which is then interpreted as Excel file. Maybe you can do a little check first.
Otto
2010 Mar 17 5:15 PM
Hi Otto,
what ever way you go, it will never work in background is what I wrote. And I continued
The excel installation on your client (PC) must be used to create MS excel proprietary format.
If you do not want proprietary binary MS excel format but something excel can read (tab-delimited, CSV, mhtmlm...) there are more ways. But first you need to know what you want.
And this is still true. more ways includes background processing.
Anyway, obviously file size is the issue, not file format. As I said, need to know what you want is quite important.
do a little check first is always helpful, but: People do not always have the time for such things
Regards,
Clemens
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |