03-19-2007 10:59 AM
Hi,
I'm using SO_DOCUMENT_SEND_API1 to send email with an attachment. This attachment is a random file uploaded by the user on an ITS web site and sent to my FM.
It is all working fine as long as I tell SO_DOCUMENT_SEND_API1 that the doc_type is 'PDF'. When I say it's 'JPG' I get an error "Message cannot be processed as it cannot be converted".
It's not the actual file that is the problem, I can send jpg-images or any other file as long as I say t_packing_list-doc_type = 'PDF'. However this leads to the attached file being called *.PDF instead of *.JPG, and the receiver has to rename it.
The relevant code is
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
where
- ld_format is the file extension (e.g. 'jpg', 'pdf', ...)
- ld_attdescription = ' ' (1 space)
- ld_attfilename is the file name without extension (e.g. 'image001')
My FM has to work with any file extension. It receives the file name and the file extension (jpg, pdf, doc, whatever) as an input parameter along with the file, and I just need to be able to email this file with the originale file name and extension no matter what that extension is. Any suggestions? Tia.
03-19-2007 11:18 AM
hi Filip Camerman,
i am giving you the sample code try this as such.
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
it_packing_list-doc_type = 'PDF'.
it_packing_list-body_num = tab_lines.
it_packing_list-doc_size = tab_lines * 255.
APPEND it_packing_list.
Regards,
Balaji E.
03-19-2007 12:23 PM
Balaji: as I said, it already works fine with it_packing_list-doc_type = 'PDF'. The problem is that some extensions, like 'JPG', don't work.
03-19-2007 12:29 PM
03-19-2007 11:20 AM
03-20-2007 1:36 PM
I found the problem myself. It was not with the ABAP code but with a server setting which did not let attachments with extensions like JPG pass.
The solution for anyone else wiht the same prob who ends up here later:
1) go to transaction SCOT
2) double click on the line with the internet mail process (INT - XMAIL)
3) click on the button "Set" next to Internet
4) select the option "All formats"
That's it.
07-31-2007 1:51 PM
Hi Filip Camerman,
I have a requirement like................ I have to convert smartform output to HTML and send this HTML ouput to external Email in the BODY of the mail not as an attachment. I have done this but whats happening is when I am sending this to an external Email id last couple of lines in the getting truncated but when I see this output in the SOST it showing the complete ouput.
Please help me Regarding this...............
Thanks and Regards,
Shravan