Work Item Approval/Rejections

Dart, Jocelyn jocelyn.dart at sap.com
Mon Feb 25 17:51:17 EST 2013


Hi David, 
Actually mandatory reason for rejection *is* supported as of certain releases (you need to check your NetWeaver release using the menu option System > Status and look at the components detail) - see these references for what is possible these days. 
http://service.sap.com/sap/support/notes/1643764 
http://service.sap.com/sap/support/notes/1648822
http://scn.sap.com/people/rj.vanlooy/blog/2012/01/29/dynamic-user-decisions-in-sap-business-workflow

Always pays to keep up to date with release changes... yet another reason to keep an eye on the Business Workflow space in SCN where these announcements tend to be made these days. 

BTW - it's standard behaviour to return an Enqueue error if it's the same user but the lock is in a different session or different logical unit of work - which sounds like what may have happened in your scenario. 

Your event raising sounds reasonable - but you might want to check the event log to see what event you are actually raising.  Possibly your Commit work statement is in the wrong place? 
Regards,
Jocelyn

-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of David G Cooper
Sent: Monday, 25 February 2013 10:37 PM
To: sap-wug at mit.edu
Subject: Work Item Approval/Rejections

HI fellow experts,

I have a requirement for a custom developed application that requires
workflow approval.

This is a complete customer application from top to bottom.

The standard user decision option in our current version does not support a
mandatory reason for rejection that can be enforced.

As a result the custom application has an approval sub screen with two
buttons.  This is delivered to the user via a BOR object method/Task using
Set parameter ID and a "Call Transaction".  The idea being that once the
decision is made the result can be returned to the work item.

The Task is contained within an Until Loop to make sure a decision is made,
before the work flow continues.  I now need to return the result of the user
decision from the custom application back to the work item.

What have I tried,
1) Raise Event and leave program where the task has terminating events.  
    When pressing BACK/EXIT/CANCEL buttons the user experiences a continual
loop back to the approval screen.
    The current work item completes, but as a decision has not been made, a
new instance of the work item is created and immediately redisplayed to the
user without going through the SAP Inbox again.  Result no way to exist
without choosing a decision.
   If one of the decision buttons is pressed an event is raised and the
program completes.  However this results in the work item completing, but
not returning the correct event, so loops back and presents the transaction
again without going through the SAP Inbox.

2) Next tried Function SAP_WAPI_WORKITEM_COMPLETE.  Work Item is locked and
function returns an ENQUEUE Error.  Even though the work item is locked by
the same user, as the one executing the function.   (Possible SAP Error).

Suggestions most welcome.

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug



More information about the SAP-WUG mailing list