Creating a simple e-mail message
In this recipe, we will see how we can create a simple program that will send an e-mail (SAP Office Mail) to an SAP user AJON1
. There are no attachments involved in this recipe. However, we will want the SAP user AJON1
to see a pop-up express message when the e-mail document is received in his or her inbox.
How to do it...
We will now perform the steps shown as follows:
Declare two reference variables
sendrequest
andmyrecpient
to the classescl_bcs
andcl_sapuser_bcs
.We will then declare a variable for specifying the content of the e-mail
email_text
. This is based on the typebcsy_text
. We also declare an object reference to the classcl_document_bcs
with the namedocument
.We call the static factory method
create_persistent
of the classcl_bcs
.The returned reference is stored in the
sendrequest
reference variable declared earlier.An SAP user object is then created using the
CREATE
method. This will be used later for specifying the e-mail recipient. The returned...