cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Workflow issue: get error at Send Mail standard task

Former Member
0 Likes
1,190

Hello experts,

I am modifying an existing workflow. It has a Send Mail standard task. I would like to get the result of this task (error or success) and insert it in a Z dictionary table before it is totally completed. I am using a method in Program Exit of Mail Send task after creation and after execution but I am not able to know if the email is sent successfully until the task is completely finished. Therefore, my method is useless.

Here comes the question, is there any way of knowing if the email is sent successfully before finishing the task? I want to save the result of the standad task in a Z dictionary table.

I place my simple workflow just in case. The taks I talk about above is the circled one.

Thanks in advance.

PD: I have already read examples Program Exits In Workflow - ABAP Development - SCN Wiki and

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi,

If the users have a valid email address and they are set up correctly then the email should go to their inbox.

You could, as an extra precaution, check if the user has a valid email address and if not, send the email to a global inbox something like approvals@yourcompany.com.

Or you can just set up SCOT so that it records errors when sending out emails and monitor SOST.

In a normal world incorrect emails, or non-existing emails is not something that happens regularly; monitoring and ad-hoc decisions should be enough.

Kind regards, Rob Dielemans

Former Member

Hello,

Thanks for your answer. Finally I was able to get the status of the task before finishing. I used the program exit of the send mail task. I made use of 'status change' event. It is explained in more detail here:

Thank both of you for your help, regards.

Answers (1)

Answers (1)

Former Member
0 Likes

Hello,

"I would like to get the result of this task (error or success) and insert it in a Z dictionary table before it is totally completed."

Why????? You can read the status from workflow (using SAP_WAPI* function modules).

But anyway, if it isn't "totally completed" then how can anyone possibly know if it's going to be error or success?

Former Member
0 Likes

Hello,

Thank you for your answer. I am afraid you are right, I cannot know status of the task before finishing. So, could I know if the email was sent successfully? The email is sent before finishing the task to both internal and external inbox.

Regards.

Former Member
0 Likes

Hello,

You didn't answer the "Why???".

Yes, that should be possible, try using fm SAP_WAPI*GET*DETAILS* on a workflow where the mail was sent and see if you can detect it.

Or you could change the process so that it detects whether the Send Mail part was successful before continuing. If in error then stop, or return an error.

I see no reason to try to do this while the process is running, wait until it finishes.

And, as always, don't use a Z table!!   (unless you have no other choice)

regards

Rick

Former Member
0 Likes

Hello,

"I would like to get the result of this task (error or success) and insert it in a Z dictionary table before it is totally completed."


I wanted to do as I said above because I would have liked to be sure that the task is completed successfully or wrong.


Anyway, I am going to do as you say. I am going to wait until the task is totally finished. Detecting send email part in the standard task  or changing the process would be amore complex task.


Thank you for your help!