Skip to Content
Product Information
Author's profile photo Former Member

Recipient Determination in Workflow Rules in SAP Cloud for Customer

From the release 1911 of SAP Cloud for Customer, you’ll notice new and exciting features while configuring the recipients in the workflow rules of type e-mail in SAP Cloud for Customer. In this blog post, I want to share the features existing till the release 1908, what has been added in 1911 and how it will help you out in configuring the recipients in a more flexible manner.

The ability to automate a process of sending out an e-mail, sms, notification, WhatsApp text, updating field(s) or triggering an action on a create/update of a document through workflow rules has been a key component of SAP Cloud for Customer. Until the release 1908 of SAP Cloud for Customer, an e-mail could only be sent out to the recipients who were the business partners in the system. A recipient could be an account, contact, individual customer or an employee. Workflow Rule didn’t support sending out an e-mail directly to an e-mail address which was not associated with any business partner in the system.

Earlier, you could configure recipients in the workflow rule only in the following two ways:

  1. Recipient determination: This includes a set of standard recipient determinations depending on the Business Object for which the workflow rule is configured. It also includes z-parties defined by the customer in the business configuration.
  2. Employee: This option is used to directly configure all those employees who should be receiving the e-mail whenever the workflow rule is triggered.

The above-mentioned ways of configuring the recipients could meet most of the customer’s use cases, but did not meet the following scenarios:

  1. Ability to send out e-mail directly to an e-mail address
  2. Ability to create your own custom recipient determination to meet the use cases which are not covered by the standard recipient determinations

From the 1911 release, you will see the following new features which have been added to Workflow rules of type e-mail that will help you to achieve the above-mentioned scenarios:

  1. E-Mail Address: With this feature, you will be able to configure in workflow rule, the e-mail addresses to which the e-mail can be sent out directly
  2. Custom Recipient Determination: With this feature, you will be able to do your own PDI enhancement implementation. In that implementation, you can write your own logic to return a table of business partner UUIDs that are existing in the system, and/or to return a table of e-mail addresses. If you configure this custom recipient determination in the workflow rule, then the workflow rule will call the determination during its execution and will send the e-mail to the business partners and/or to the e-mail addresses returned by your custom implementation.

You can follow the following steps to implement the Custom Recipient Determination:

  1. Login into your cloud application studio.
  2. Right click on your PDI solution and click on Add-> New Item.
  3. Select Extension from left hand side tree and select Enhancement Implementation. You have to provide some meaningful enhancement implementation name in the Name field and click on Add. Please note that the same name will appear under Custom Recipient Determination when you configure the workflow rule.
  4. Select Namespace and Enhancement Option as shown below and click on OK.
  5. Select .fltr file which got created from the Solution Explorer and provide the MO name for which this custom recipient determination will trigger.
  6. Double click on DETERMINE_CUST_RECIP.absl file. You can write your custom logic to determine the recipients depending on your business use case in this file. The output of the code can be stored in result variable which can have both business partner UUID’s and/or the recipient email ids to whom the e-mail will be sent out. You need to activate all the files and the solution once your code changes are done.
  7. Now when you will configure the workflow rule, you will see the custom recipient determination that was created under Custom Recipient Determination table.

 

Once you have activated the rule, at the time of its execution, it will call the custom recipient determinations configured in it along with the other Recipient Determinations, Employees and E-Mail addresses configured to send out an email to all the determined recipients.

As you can see, with these new features, the possibility to determine Recipients in workflow rules of type e-mail is extremely flexible and helpful.

 

Assigned Tags

      24 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Akhilendra Pratap Singh
      Akhilendra Pratap Singh

      Thanks Ankur for writing this Blog.

      C4C tenant is upgraded to 1911 and we followed the above provided steps to build our custom recipient determination logic. We ensured that,we are using correct BADI -"ExitForGettingWorkflowRecipient" and also solution is activated.

      When we try to configure the work flow rule of type e-mail for Ticket, we don't see our enhancement implementation name in the drop-down under "Custom Recipient Determination".

      Do we need to enable/activate anything else? Can you please provide your some insight?

      Thanks in advance for your help.

       

      Thanks,

      Akhil

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Akhilendra,

      Did you provide the filter as "Ticket" as mentioned in the step 5?

      Best Regards,

      Ankur

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Akhilendra,

      Have you grouped together your enhancement files in a folder? That might be an issue at the moment. For now, can you try moving the files out of the folder and try again?

      Regards,

      Ankur

      Author's profile photo Anil Chacko
      Anil Chacko

      Hi Ankur,

      I tried to implement as the steps provided in this blog. As you have mentioned here, I have given 'Ticket' in filter and also added the enhancement outside folder. I am still not able to view the enhancement name listed in custom recipient determination.

      Do you know of anything else which could cause this issue?

      Thanks

      Anil

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Anil,

      'Ticket' as a filter has to be given only if you are creating a workflow rule on "Ticket" object. For other objects, the filter has to be different. Did you use the same object? If yes, could you share the incident details?

      Regards,

      Ankur

      Author's profile photo debasish sharma
      debasish sharma

      Hi Ankur

      I’ve done same as mentioned in your blog and the BO is also ticket BO but still it’s not showing in the custom recipient determination section.

      And besides that if you can provide one same logic for the recipient determination then it’ll be a great help.

       

      Thanks

      Debasish

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Debasish,

      There was a bug, a fix which should have been deployed this weekend. You can check again on Monday. If issue still persists, then let us know.

       

      Code snippet:

      Your logic should determine the appropriate agent uuid and/or email address.

      Regards,

      Ankur

      Author's profile photo Anil Chacko
      Anil Chacko

      Hi Ankur,

       

      Yes, I was trying to use it for a ticket workflow.

      Right now it is working  for me.

       

      We also would like to use the same implementation for sales quote workflow.

      Could you please let me know what is the meta object name for Sales quote?

      Thank you in advance.

      -Anil

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Anil,

      Here's the list:

      Business Object Meta Object (Filter)
      Content Transfer /EXT/KUSL_CONTENT_TRANSFER
      Activity Task ACTIVITY_TASK
      Visit APPOINTMENT_ACTIVITY
      Assignment ASSIGNMENT_ACTIVITY
      Partner Registration CHNL_PARTNER_REG
      Appointment COD_APPOINTMENT
      Campaign COD_CAMPAIGN
      Contact COD_CONTACT
      Account COD_CUSTOMER
      Individual Customer COD_IND_CUSTOMER
      Phone Call COD_PHONECALL
      Sales Data COD_SALES_ARRANGEMENT
      Time Report COD_TIMEREPORT_NOTIFICATION
      Contract CONTRACT
      Sales Order CUSTOMER_ORDER
      Sales Quote CUSTOMER_QUOTE
      Deal Registration DEAL_REG
      E-Mail EMAIL_ACTIVITY
      Incident INCIDENT
      Installation Point/Registered Product INSTALLATION_POINT
      Installed Base INSTALLED_BASE
      Insurance Policy INSURANCE_POLICY
      Insurance Quick Quote INSURANCE_QUICK_QUOTE
      Insurance Quote INSURANCE_QUOTE
      Currency Exchange Rate LEAP_CER_EXCHANGE_RATE
      Leads MARKETING_LEAD
      Opportunity OPPORTUNITY
      Project Alert PROJECT_ALERT
      Promotion PROMOTION
      Sales Lead SALES_LEAD
      Social Media Message Import Run SOC_MED_ACT_CREATION_RUN
      Ticket TICKET
      Transport Request UNIFIED_TRANSPORT_REQUEST

       

      Best Regards,

      Ankur

       

       

      Author's profile photo Raghukiran kanneganti
      Raghukiran kanneganti

      Hi Ankur, It is great information. Thanks for sharing the knowledge. I have implemented the same for "Ticket" BO. With this approach, workflow is sending separate emails for each recipient added in  enhancement. Client is looking for kind of  "reply all" functionality. I mean one email to all the recipients. is there anyway can I achieve it? Like add all the emails in To line. Your help will be appreciated. Thanks.

      Author's profile photo Jasper Scheen
      Jasper Scheen

      Hi Ankur,

      Great stuff! Is the ability to set the FROM e-mail address as recipient for a workflow also on the roadmap? So that the notification is always sent as reply to the sender, even if it's an unknown contact.

      If so, do you know for which release?

      Kind regards,
      Jasper

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Jasper,

      Could you please check if your tenant is upgraded to 1911? If so, if you try configuring a workflow rule on "E-mail" object then under "Custom Recipient Determination" you should see an option of "Message From". This would enable you to reply to unknown contacts as well.

      Best Regards,

      Ankur

      Author's profile photo s.nv.chandra kishor
      s.nv.chandra kishor

      Hi Ankur,

      I have a custom BO "Project" where we create project IDs and maintain Escalation matrix with a list of employees.

      Extended the Ticket creation screen with a new OVS field "Project" to select the project ID from the custom BO. Ticket has been created with a project added.

      Now, the requirement is to send email to the employees maintained in escalation matrix of Project BO based on some conditions in Ticket. Is it possible to get the Project BO data from this enhancement option as I could see only the below two values in inputdata. If possible, please guide me how this can be done else what would be the alternative.

       

       

      Regards,

      Kishore.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Kishore,

      I believe you are trying to create a workflow on Ticket in order to use the conditions on the same. Here TriggerBOUUID should be the uuid of Ticket, Hence in the enhancement implementation you can use this ticket uuid to navigate to your project BO instance and fetch the relevant information and return the recipients accordingly.

      Regards,

      Ankur

      Author's profile photo Srinivas Vasamsetti
      Srinivas Vasamsetti

      Hi Ankur,

      First of all , Thanks for your blog on this topic. I recently I implemented this enhancement for object Activity Task  . I followed the same steps with Filter - ACTIVITY_TASK' but the enahncement is not available when I try to define work flow Rule for BO:ActivityTask . I Re-do the same steps for 3 times but no luck. Even I created the incident to SAP, they simply rejected without mentioning the reason.

      I Created the enhancement inside the folder. Still have bug in SAP Solution. Please confirm the same. I appreciative if you could provide more on this.

       

      Thanks

      Srinivas

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Srinivas,

      You should raise an incident for this. Not sure why was it rejected as you mentioned. Ideally it should have worked.

      Regards,

      Ankur

      Author's profile photo Nimisha Ray
      Nimisha Ray

      Hi Former Member

      Can we implement the same configuration for sending SMS, our requirement is to send the SMS on number which is captured on the Custom field of Service Ticket. Can we use this Enhancement implementation to send SMS without creating customer/Party involved in the system.

       

      Thanks and Regards

      Nimisha Ray

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Nimisha,

      No, at the moment it is supported only for e-mail. You can raise an idea on the idea forum to support it for sms as well.

      Regards,

      Ankur

      Author's profile photo Srikanth Rathod
      Srikanth Rathod

      Hi Ankur,

      I have followed your blog and I have created an Enhancement. But in my case it is Visit BO so in have added APPOINTMENT_ACTIVITY as the Meta Object name. But still I not able to view the enhancement name listed in custom recipient determination.

      Can you please suggest ?

       

      Regards,

      Srikanth Rathod

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Srikanth,

      Ideally, it should work. I would suggest you to raise an incident stating all the details of the implementation you have done.

      Regards,

      Ankur

      Author's profile photo Srikanth Rathod
      Srikanth Rathod

      Hi Ankur,

       

      Thanks for your quick reply.

      Alright. I have just raised an Incident stating all the details.

       

      Regards,

      Srikanth Rathod

      Author's profile photo Raghukiran kanneganti
      Raghukiran kanneganti

      Hi Ankur,

      I have enhanced "ExitForGettingWorkflowRecipients" for “Ticket” BO for custom recipient determination. With this approach, workflow is sending separate emails for each recipient added in enhancement. Client is looking for kind of “reply all” functionality. I mean one email for all the recipients. is there anyway can I achieve it? Like add all the emails in To line. Precisely client is looking to send one email for all custom recipients instead sending separate email for each recipient. Your help will be appreciated. Thanks.

       

      Author's profile photo Leonardo Dutra
      Leonardo Dutra

      Hey everyone, can you guys help me?

      I'm having an issue where the e-mail is sent twice to the customer account. It does work, but the customer is receiving duplicate e-mail.

      Here is my code:

      .fltr

      .fltr

      .absl

      .absl

       

      .enht

      .enht

      Author's profile photo Chandra sekar
      Chandra sekar

      Hi Leonardo,

      Did you find the route case. I am also facing the same issue.

      Thank you,

      Chandrasekar Balan