Back to Sending Mails - Home Page
Author: Pratik Mallick
Submitted: 3rd April 2009
Send notification is becoming important from business point of view. It adds extra reliability to the process and enables business person to react quickly to customer's requirement. If any error occurred to a process some group of people in the top management will get a notification and react based on the details specified in the notification.
In some situation we had to send a notification to a group people. Some cases we had to only send the text in the mail body and some cases we had to send the detail records as attachments. Suppose one user ran a program to update the material master and the top management wants to get the success records as one attachment and error records as another attachment in the email.
Using the below object oriented technique it can easily obtained.
The standard class CL_BCS is used to send the notification along with attachment to a group of people. Method CREATE_PERSISTENT is used to create an send request object of the standard class CL_BCS.
Create body of the email
Method CREATE_DOCUMENT of standard class CL_DOCUMENT_BCS is used to create the text of the email body.
Create attachments of the email
Method ADD_ATTACHMENT of standard class CL_DOCUMENT_BCS is used to create attachment of the email. If we want to create the multiple attachment we have call this method multiple times.
Method SET_DOCUMENT of the standard class CL_BCS is used to add the document (email body and attachments) to be send request object.
Method CREATE of the standard class CL_SAPUSER_BCS is used to create the sender address.
Method SET_SENDER of standard class CL_BCS is used add the sender address to the send request object.
Method CREATE_INTERNET_ADDRESS of standard class CL_CAM_ADDRESS_BCS is used to create recipient email address.
Method ADD_RECIPIENT of standard class CL_BCS is used to add the recipient email address to the send request object.
Method SEND of standard class CL_BCS is used to send the send request object to a group of people added in the recipient list.
Sending is done in a queued way; immediate sending can be triggered for very urgent alerts.