Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Jigang_Zhang张吉刚
Active Contributor
Generally, setting hard-coded email addresses inside the Workflow is infrequent and not recommended, if you're not familiar with Workflow you may wonder how to control the sender/receiver or CC email address? This article will try to wrap up the basic settings for those emails used inside Workflow.




1. The Sender's Email address inside the Workflow


The sender email used by Workflow usually will be the person who has actioned on the workflow recently. If the user profile has already been updated at SAP then the email address used inside the workflow will be reflected with new ones. Besides, there's one default user WF-BATCH which is always seen as a sender for many emails sent from WorkFlow.
The workflow runtime system always carries out its tRFC (transactional RFC) calls on the logical destination WORKFLOW_LOCAL_XYZ (xyz stands for the three-digit number of the client).

The workflow runtime system only operates within one client; by assigning a name to the logical destination, the system-wide uniqueness of this name is ensured.

If you execute this activity automatically, the logical RFC destination WORKFLOW_LOCAL_xyz is created (if not yet available). This destination is assigned the user WF-BATCH (system user).

If you belong to the user group SUPER and the user WF-BATCH does not exist, it is created and automatically receives the maximum authorization of the current user (SY-UNAME ). This function should be executed once by a user belonging to the SUPER user group.



The default email address/Domain for this WF_BATCH can be controlled by SWU3. Please check this for more details about this TCODE.


Please be aware that this WF-BATCH has been replaced with SAP_WFRT for S/4 HANA.
Starting with S/4 Hana OnPremise 1709 the workflow system user and workflow system jobs changed. The workflow system user is called SAP_WFRT now instead of WF-BATCH. The workflow system jobs start with SAP_WORKFLOW now and are scheduled automatically by the "Technical Job Repository", transaction SJOBREPO.

Starting with S/4 Hana OnPremise 1809 the workflow system jobs are scheduled under the user, under which the system jobs of Technical Job Repository run. This might be a different user than SAP_WFRT.

 

2. The Receiver Email address within the standard Workflow Email Step


The receiver email will be binding to the Agent which could depend on the Rule/Organization Unit/Position/User, etc.


Those pre-defined objects in the end will be linked to some profile or partner attributes from business objects (for example through some standard methods provided by business objects). Like Organization Unit/Position we need to update accordingly at Organizational structure by TCODE PPOME. Customized Rules may need to be checked individually as they involve various objects/approaches to achieve that. Please check the below articles for more details:

Even the standard agent rule could be enhanced with reserved user-exit, please check this Workflow Agent Determination Customization.


3. The Receiver Email address within the general Workflow Step


When the logic is too complex and can't be achieved by the Agent determination rule easily, then will choose to use the general workflow step to send email instead of the standard email step.


Here is one example that one customized TASK needs to be created and assigned to this activity step as below.


Here we can see all customized logic will be defined through the method CONTACT_EMAIL for this Customized object type ZQM_NOTWF.


Please check this for more details on how to create business objects, methods, events, and event linkage.