Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to send an e-mail to additional recipients as CC

I have the need to code a PPF action which sends an e-mail (smartform) not only to the main recipient(s) but also to additional recipients as CC.

I am wondering if module SO_NEW_DOCUMENT_ATT_SEND_API1 does the job, but I am very skeptical.

Has someone already done it and who can share his experience?


Dear Riccardo,

the best approach for this issue is to follow the description and example of note #935670.

The general outline is as follows:

1. when calling the SF function module set parameter to get back the OTF document

*-----------get back OTF document --------------------------------------
* set 'ls_control_parameters-getotf' to get back the processed OTF
* document; OTF document is returned in 'job_output_info-oftdata'
* sending will be done in a later step
 ls_control_parameters-getotf = sppf_true.

2. use class CL_BCS to send the document

There are standard example reports BCS_EXAMPLE_X X=1..5 which shows the general usage of this class to send messages. This class is the recommended interface for SAPconnect to generate and send messages. Whenever possible, please use this class instead of outdated function modules.

3. to add a second recipient as CC use

* set recipient (mandatory)
  lo_recipient = cl_bor_object_bcs=>getu_persistent(
                        i_logsys  = is_mail_recipient-logsys
                        i_objkey  = is_mail_recipient-objkey
                        i_objtype = is_mail_recipient-objtype ).
  call method send_request->add_recipient
      i_recipient      = lo_recipient
*      i_express        = i_express
*      i_copy           = i_copy
*      i_blind_copy     = i_blind_copy
*      i_no_forward     = i_no_forward
* set CC recipient in addition (optional)
  clear lo_recipient.
  lo_recipient = cl_cam_address_bcs=>create_internet_address(
                        i_address_string = ''
                        i_address_name = 'Your Visible Name'
  call method send_request->add_recipient
      i_recipient      = lo_recipient
      i_copy           = sppf_true

That's all

Best regards, Daniel

Edited by: Daniel-Alexander Heller on Dec 3, 2008 10:24 AM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question