cancel
Showing results for 
Search instead for 
Did you mean: 

Sending an email in a Workflow

racingpro
Explorer
0 Kudos

Dear all,

I created a copy of standard Workflow WS20000075 for the PO release strategy. I added a new step to send an external email to the Workflow requester (Agent). The email is sent correctly and the Workflow works fine.

For now, I entered an initial value in the recipient field that contains the email address. I want to be able to use the requester email address instead of the initial value I populated in the container field.

I do not know how to perform this simple task. Do I need to create a new step (task) prior to the send email step? Is there a standard Class or BOR to retrieve the user's email address?

I tried to activate the "Send to home addresses" functionality in SO16 but no email is generated in SOST.

I've looked in other discussions but I am not sure of what I need to do since there seems to exist various solutions to my issue.

Can you provide a detailed step by step of what I need to do?

Thank you very much for your help,

Sylvain

Accepted Solutions (1)

Accepted Solutions (1)

racingpro
Explorer

Hi again,

I just wanted to make myself clearer on what I meant by "Workflow requester". Actually, I want to use the Agent defined in the PO release strategy which is not the Initiator. This agent (user) is the one who will release the PO. I believe I can find this agent somewhere in the Workflow container since he is receiving a message in his SAP Inbox.

I hope that my explanations were clear enough.

Thank you,

Sylvain

former_member185167
Active Contributor
0 Kudos

Hello,

I hope when you say "email" you mean email and not workitem.

If the person who is to receive this email is the one who also receives the workitem, then the best solution of all is to set up Extended Notifications. It can send emails to anyone with a new workitem in their inbox, no need to add a new step to this or any other workflow.

But otherwise the next best idea is to send the email to the SAP user and set up SO16 to forward it on to their email address. This is done by:

To get SAP to forward mails from the SAP inbox to external emails you have to:

1) add the email address in SU01

2) set "Comm. Method" to "E-mail" in SU01 [in Address tab]

3) in SO16, tab Mail sy.grp, radio button "Send to Home Addresses of Users"

4) in SO16, tab Addressing, Reset buffer

You might have to add an extra step if it's not immediately obvious who is supposed to receive the workitem or email. Yet another reason to rely on Extended Notifications instead.

regards

Rick

racingpro
Explorer
0 Kudos

Hi Rick,

Thank you for your quick answer.

Yes, when I was saying "email" and was referring to the work item received in the user's Inbox.

Unfortunately, your proposed solution does not seem to work in my case. I already performed the setup in SO16/SU01 prior to opening this discussion.

Just to be certain, I performed all of your 4 steps once again. I populated the Initiator (User who create the PO) Email address in SU01 as well as the agent (User who will approve the PO) receiving the workitem in his Inbox and I also populated the email address of the WF-BATCH user just in case.

I selected the "Send home Addresses" radio button and reset the buffer accordingly.

Neither of the users receive an email and no record is found in SOST. The SCOT configuration is good since other ABAP processes are sending external emails without any problem.

Is there any other setup I need to do beside the 4 steps you mentioned?

Thank you again for your help,

Sylvain

former_member186746
Active Contributor
0 Kudos

So... We are talking about workitems and not emails.

In that case check extended notification for execution of workitems through email.

there are now a number of guides and blogs on the subject, just search for SWN_SELSEN.

Kind regards, Rob Dielemans

racingpro
Explorer
0 Kudos

Hello,

I found a document to configure the SWN_SELSEN in TCode SWNCONFIG.

I followed all the steps but I must have something wrong since no notifications were found. I have various pending workitems that should have been selected.

There is one parameter that I am not sure if I populated correctly and it's the INBOX_LINK_URL in the General settings. I've entered the client web site URL. May it case any problem if it's not right?

What are the basic issue that I should pay attention in order to find the reason why no notifications were generated or found?

I am not really familiar with this config. I've looked at other discussion but I am more confused than anything else.

Thank you for your support,

Sylvain

former_member185167
Active Contributor
0 Kudos

See point 2 for the difference between workitems and emails:

I made some screenshots of an Extended Notifiction set up:

racingpro
Explorer
0 Kudos

Hi Rick,

Thank you very much for the documentation. It was very useful and especially your screen shot document.

After comparing my configuration with your document, I made a few changes that solved my issue. I realized that I entered 000000 in the Time From and Time To of the scheduling section. I also noticed that I did not populate the task number in the Delta filter settings.

Everything is working fine now.

I just have one last question, how can I modify the email body text? Is it in the Message template section? I would like to have a specific body text.

Thank you again for your help. You made my day.

I remarked that you have been active in Workflow discussions for a long time now and it's easy to seel that you possess a deep knowledge of the subject. Keep up the good work.

Sylvain

former_member185167
Active Contributor
0 Kudos

You're welcome!

The Extended Notifications email body text comes from the workitem itself so you would have to change that.

Or do you mean something else?

racingpro
Explorer
0 Kudos

Hi Rick,

Yes you are right, the email title and body text are coming from the workitem. The can see my text in the body.

I would like to remove the system text that is included automatically in the body as well. This technical information will confused the users more than anything else since my client does not use SAP Inbox.

Any idea on how to remove this text ?  I will keep on looking on other discussions in case I can find the solution.

Thank you in advance for your help,

Sylvain

Answers (0)