cancel
Showing results for 
Search instead for 
Did you mean: 

How to get whole email (with attachment) as binary file

0 Kudos

Hello experts,

I have requirement, when processing email, to save the email as attachment to sales order.

I need to save the whole email as file *.msg, like you can do from Outlook (fro message, then File -> Save As), then the message would be saved as file on local drive, which you can attach to the sales order in Services for Object (BDS).

I would like to add attachment by calling BAPI.

I can add attachment using this blog: https://blogs.sap.com/2007/06/27/bsphow-to-create-attachment-in-business-transactions/

My problem is, that I dont see method that would return the whole email (with subject, body, attachments) as *.msg bytes variable. I can get Body, Subject, from and to, and attachments separately.

Could you please advise the way to achieve that? I would like to avoid using SAP GUI capture and stay with BAPIs only.

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Hello,

Unfortunately, there is no method in the Outlook library allowing the save of whole email.

Please check the following documentation to find another method which can fits your needs: https://help.sap.com/viewer/dbe2687952b8433a953c6b6305429122/Cloud/en-US/5fd064707e7547dd967afe5e1b5...

Best regards,

Baptiste Saint-André

Answers (0)