cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow - Send email to Organization position holders

0 Kudos

I have a very simple Workflow with a triggering event whenever a Maintenance Notification ( BUS2038 ) is created, then i want the workflow to send a email ( Later phone SMS ) to external emails of the holders( Users - US object ) on a specific Position ( S object ) in my Organizational Model.

How do i set the Recipients of the email step to these users which are assigned as Holders to the specific Position?

I have tried to just set the Recipient type to Organizational Object and then Position and giving the Position key but this fails with message no so023.

Then i am trying with a workflow container to hold the users, but what type should the container be and how do i fill the container with the right users/recipients??

keohanster
Active Contributor
0 Kudos

Hi Nicolai,

First off, huge congratulations to you on your accomplishment!
I've never had to send an SMS so I have no personal experience there. But I am sure you can achieve this! Although this thread is kind of old, I hope you can find some good info here:

https://answers.sap.com/questions/5750689/send-sms-to-mobile-through-abap-code.html

If it were me, I would be making good friends with the Basis team (bring chocolate, or something suitable) so they can set up the SMS configuration for SCOT. And you should be able to enhance your method to gather the mobile phones of your recipients.

Good luck,

Sue

0 Kudos

Hi Nicholas,

I have a similar kind of requirement when a Notification is submitted, based on the duration time an email is to be triggered to group of peoples Internet mail Addresses, could you please help me out with the steps how u did this

I'm using the same BO 'BUS2038' and in the send mail step added Recipient type as Email

Could you also please let me know, which is the Function Module you have used to send multiple recipients mail Id's to trigger the Workflow

Thanks & Regards,

Naveen.

0 Kudos

Hi Naveen,

In my workflow I added a workflow container of my own created structure type as Susan displays in the image of the answer and gave it the property of multiline.

This container is filled with data from a custom Task that uses a custom method from a sub BO of BUS2038.

Then the workflow steps that I have after this custom task. is that i need to count how many entries was filled in the workflow container. Then created a loop containing the send mail step where in the Recipient type is set to E-mail Address and in the Email address i use the wokflow container like this:

&RETURN[&Counter&].EMAIL&

Return is my multiline container and Counter is also a container that contains a number of which entry is reached in the multiline container by the loop.

Hope this makes sense.

Accepted Solutions (1)

Accepted Solutions (1)

keohanster
Active Contributor

Hi Nicolai,

You would need to copy the standard SAP workflow to a customer workflow first. Then you'd also copy the business object (say, FIPP) to a customer object (ZFIPP). Make sure you perform the delegation. (https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4f/3459e50a7b5542e10000000a421937/frameset.h...)

Then you can create a method which you will use to gather these email addresses, and pass them as an export table parameter. For example, in our systems, we use a structure called ZWF_AGENTS which we populate in the method. (https://help.sap.com/saphelp_470/helpdata/es/a5/3ec9734ac011d1894e0000e829fbbd/content.htm?no_cache=...)

Then create a new task to call your method. Make sure you are importing your multiline parameter of email addresses. And insert this new task into your custom version of the workflow. Make sure to bind your multiline container element into the parameter &ADDRESSSTRINGS& and set your &TYPEID& to 'U' for an internet address.

Then, make sure you pat yourself on the back, because you have completed a whole bunch of steps that will enable you to grow your workflow skills in the future!!!

Sue

Hi Susan,

Took me a while to figure it all out, but this helped alot!

I now have a workflow that can send an email to external emails of users assigned as holders on a specific position.

Now next step is to send a text message to the users phone number instead, do you have any advice on this?

Thank you very much!

Answers (1)

Answers (1)

keohanster
Active Contributor
0 Kudos

Hi Nicolai,

Is this an SAP workflow or a Customer workflow? Are you certain that the holders of the position have email addresses? Are there any cases where workflow has been able to send out email?

I've found that it's helpful to have email recipients gathered and validated before launching a SENDMAIL task. That way, you can be sure that you do have recipients. Also, for the future, you'll be able to look at the workflow container to see who the recipients were.

You could write your own method to look up the email addresses of the people you want to send mail to and pass their email addresses back into the workflow container.

Good luck!

Sue

0 Kudos

Hi Susan,

Thanks for your answer.

Is this an SAP workflow or a Customer workflow? SAP workflow.

Are you certain that the holders of the position have email addresses? Yes, i am certain.

Are there any cases where workflow has been able to send out email? Yes, i tried statically setting the recipient to a user and that works sending the user an mail. ( Well only in the users business workplace inbox. What i rally want is for SAP to send it to the users external mail, i tried this by setting the recipient type to email address and that works but only with one email address. I guess i can then do it with a multi line email workflow container? )

Okay, i will try writing my own method to gather the emails and fill the workflow container with these emails, but i don't know how i can start on my own method inside a SAP workflow before the email step. What step type should be used for writing a method?

Thanks!

Nicolai