SAP: Email Functionality in SAP with a Custom Function Module
A custom ABAP function module, ZFM_SEND_EMAIL, sends mail through Business Communication Services' CL_BCS and CL_DOCUMENT_BCS classes, adding TO/CC/BCC recipients and multiple attachments by building the HTML document in application code on top of what CL_BCS delivers, which is how ABAP's notificationsNotificationsTelling a person something happened when they are not looking at the screen — a notification in the launchpad, an email, a message somewhere they already are.SAP and community, narrow by design capability describes mail going out. The send sits in a TRY structure whose three CATCH blocks for CL_BCS's class-based exceptions are empty, so what reaches the caller is a BAPIRET2 table that BAPI_MESSAGE_GETDETAIL fills on the paths without an exception: no recipients given, sent to all, or not sent. That conversion into a caller-facing message table is what ABAP's error handlingError handlingTurning a failure into a response a client can act on — protocol-correct error payloads, correlation, and a boundary between internal detail and what a caller sees.SAP and community, unassessed capability leaves to the application.
Where it sits
Who is behind it
Properties
About this work
For notifications
For error-handling
Details
Graph
Source
History
- Entered the atlasDiscovered via SAP Community · btp-abap-environment-tag.
For your agent
- Ref
content:sap-email-functionality-in-sap-with-a-custom-function-module- JSON
- /content/sap-email-functionality-in-sap-with-a-custom-function-module.json
- MCP
- Connecting an agent