Skip to Content
Former Member
Jul 11, 2014 at 07:04 AM

Cancelling workflow & trigerring workflow email from program


Hi Experts,

I have never worked on workflows earlier.

There is a workflow in our system in which user receives email in SAP inbox to approve/reject a PR item.

Once the user takes action, the workflow has custom code to approve/reject the PR item, then send emails in workflow tasks & cancel the workflow.

However, sometimes users also approve/reject PR item through ME54N transaction.

This does not update in the workflow due to which workflow keeps on sending reminder emails and(or) escalation emails.

Client do not want to use the option of substitution.

Following is the approach that I have determined to resolve this issue (after having an offline discussion with the developer who is not with our project anymore):

1. Find user-exit which gets triggered when user approves/rejects from ME54N

2. In that user-exit I need to code following:

a. Obtain the workflow pertaining to this PR item

b. Cancel the workflow

c. Send the approval/rejection emails as given in workflow

I need help on the Function Modules to be used for points 2.a & 2.b.

Also for point 2.c, I was wondering whether is it possible to call the same workflow task (using some Function Module) which sends emails along with the required data.

If it is not possible then I would need to code logic for email separately in the user-exit. Due to this the email subject & body content & format would have to be managed at 2 places: Workflow & User-exit which I want to avoid.

Thanks in Advance.

Apologies if requirement of points 2a & 2b is very common & available elsewhere.