Skip to Content

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

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 27 at 09:45 AM

    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/5fd064707e7547dd967afe5e1b507532.html

    Best regards,

    Baptiste Saint-André

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.