ABAP Email Traditional API
SAP provides several function modules to send email to the external world. The interfaces of them are more or less the same, just with some minor difference.
Function Group: SOI1 – API Function Modules for Externals
Function Module:
SO_DOCUMENT_SEND_API1 – SAPoffice: Send new document with attachments using RFC
SO_NEW_DOCUMENT_SEND_API1 – SAPoffice: Send new document
SO_NEW_DOCUMENT_ATT_SEND_API1 - SAPoffice: Send new document with attachments using RFC
In the implementation, all above function modules will call another function module ‘SO_OBJECT_SEND’ to send email.
Differences among these function modules:
SO_DOCUMENT_SEND_API1 - In this FM u can specify the sender address. Means u can hardcode any ID and system will display that sender only irrespective of who is running the report.
SO_NEW_DOCUMENT_SEND_API1 – Through this system will pick sender based on from which id running the program. This function module also enables you to send a new document, which has not yet been created, internally and externally. During the send process the document is created, along with the attributes and content that is to be transferred.
SO_NEW_DOCUMENT_ATT_SEND_API1 - This function module enables you send a new document including any existing attachments. The document and the attachments are transferred in the same table. They are created when sent and can also be placed in the sender’s outbox.
Except these function modules, SAP provides a simplified one named HR_FBN_GENERATE_SEND_EMAIL. If you check the function module interface, you will find it is quite easy to use.
I will give some useful examples with actual scenario recently. But above function modules are more or less not state of the art and difficult to handle. Meanwhile, SAP introduced the BCS (Business Communication Services), a much more flexible and future-oriented OO attempt to Mail. We will discuss it later.