Improvement Note - Enhancements To Email Functionality With Output Control in SAP ERP Sales and Distribution
Improvement Note - Enhancements To Email Functionality With Output Control in SAP ERP Sales and Distribution
Symptom
Improvement Request
SAP shall provide the possibility to enhance the email capability (such as the sender, recipient, cc, bcc, and
title) using output control through BAdI(s).
Request Reason
The current system behavior, where the login user is the default email sender in transactions using the Sales
and Distribution (SD) output control, is not suitable for some customers due to their specific roles and
responsibilities. The sender requires additional features such as having a copy of the email, changing the
subject line, receiving a copy of the email in their outlook mailbox (including other email services, such as
Gmail) and keeping a record of all communication.
Other Terms
Output control, email enhancements, change sender, cc, subject, Customer Connection, 6468, Improvement
note
In the existing implementation, it is not possible for a customer to have the enhanced email functionality using
the output control in SD transactions.
Solution
Scope:
The improvement request "Email Output Control Part 1 (SD Sales Order, Invoice)" for ERP 6.0 EhP7 SP09 is
delivered only via SP. The full functionality is not available to be installed via Notes. However, "Email Output
Control Part 2 (SD Delivery)" is fully available both via SP delivery (ERP 6.0 EhP7 SP11) and via Notes
install.
If you wish to implement the full functionality of the "Email Output Control Part 2 (SD Delivery)" via Notes on
top of ERP 6.0 EhP7 SP09 (or SP10), then first implement Note 2291353 for DDIC changes, then second
implement Note 2219370 for the source code changes.
For EhP6, both Parts 1 and 2 (SD Sales Order, Invoice, and Delivery) are delivered only via SP17. The Notes
are only available as Interface Notes for correction dependencies.
For EhP8, both Parts 1 and 2 (SD Sales Order, Invoice, and Delivery) are delivered only via SP01. The Notes
are only available as Interface Notes for correction dependencies.
This improvement is only applicable for SAP standard delivered programs. Please note that customer
adapted Z programs are out of scope for support.
Improvement:
This BAdI allows the customer to modify the sender, recipient, subject, text and attachments. The
modification can be customized depending on the business data such as from an invoice or sales order that
is transferred by the BAdI: Mapping for Business Data.
This BAdI enables the transfer of business data such as from sales orders and invoices to the BAdI: Modify
Email Settings to support customized implementation.
Benefit:
The customers will have enhanced emailing capabilities through output control such as changing the sender,
adding multiple recipients, copying the email (using cc and bcc) and changing the subject and body by
implementing the above-mentioned BADIs.
Delivery:
The functionality is enhanced by implementing the BADI. You can also refer to the sample implementation.
This improvement only supports sales orders and invoices. Outbound deliveries will be delivered in the next
support package (SP).
Please refer to Note 2171824 for the Material Management (MM) part of the enhancement.
Solution Details:
Development objects that support output control email enhancements are listed below.
BAdI Implementations:
Both BAdIs are multi-use and designed with filters. They are called by programs using filter values, which are
maintained in IF_SD_EMAIL_PROCESS_CONSTANT. The execution will depend on runtime filter values,
which are validated against the domain object fixed value ranges (EMAIL_PROGRAM_FILTER).
Enhancement spots enforce the user to create one filter for each enhancement implementation and the filter
value is selected from the fixed value range of the domain object. To add a new entry to the domain object,
create a 'fixed value append' on the domain object, after which you can use the new value in the
enhancement implementation.
Example:
The print program that calls sales orders (SD_SDOC_PRINT01) passes "SDOC_PRINT01" as a filter. This
value is maintained in the interface constants IF_SD_EMAIL_PROCESS_CONSTANT which calls the
matching BAdI implementation for this filter.
To add a new entry to domain object, follow the steps outlined in the documentation below:
http://help.sap.com/saphelp_nw74/helpdata/en/6e/d5574168ef7d47e10000000a1550b0/content.htm
You can also refer to the attached PDF document in Note Attachments for the same documentation.
The BAdI enables you to add recipients, edit the sender, subject and text, add attachments, and send the
email. The print programs call corresponding BAdI interface methods. This BAdI can be implemented as
follows:
Interface Methods
The implementation for the BAdI: Modify Email Settings can be reused between SAP Script and PDF
programs by passing the corresponding filter value in the enhancement implementation. Implement all
required methods by referring to the sample class CL_SD_SAMPLE_EMAIL_IMPL as follows:
• The IF_BADI_SD_SLS_EMAIL->set_mapper method enables you to provide the mapper type to get
the business data from the BAdI: Mapping for Business Data. Copying the set_mapper method
implementation from the sample class will set gs_type_map with business data.
sample class.
3. Set the email address in the recipient structure ls_email_rcp-email_addr and other required fields.
Repeat this step to add multiple recipients.
4. Repeat the previous step to add the sender.
Note that when the helper class method modify_email is called using the class instance go_cl_helper_obj
by passing the table type of recipient and sender, it sets the required email addresses on the BCS class
instance.
Note that when the helper class method process_document is called using the class instance
go_cl_helper_obj by passing the modified subject, text, and table of files to create the document, update the
subject, text and attach the PDF file on the BCS object.
Note that when the helper method send_document is called using the class instance go_cl_helper_obj, the
BCS class instance is updated with the recipient, sender, and file attributes in the previous methods outlined
above sends the email.
This BAdI transfers the business data to the BAdI: Modify Email Settings. Since the business data is not
available in a uniform structure across the programs, the interface has various methods to support business
data from different programs. Implement all the required methods by referring to the sample class
CL_SD_SAMPLE_EMAIL_OBJ_MAPPER as follows:
Interface Methods:
Depending on the enhancement implementation (sales order or invoice) and on the program (SAP Script or
PDF), the methods to implement differ as follows:
Software Components
2291353 Interface Note: DDIC objects for Note 2219370 (EhP7 & EhP8)
2265421 Interface Note: Source code changes for Note 2153962 (EhP6)
Attachments
creating_fixed_value_appends.pdf 47 application/pdf