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: 

File type problem with email attachments

0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

hi

chk this thread:

regards,

madhu

Former Member
0 Kudos

Hi Filip,

Please check Amit's reply in the link given below,

Best Regards.

    • Reward points if it is useful.

0 Kudos

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.

0 Kudos

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