Need to change the revered( in process state) work item to Ready state again
Florin Wach
florin.wach at gmx.net
Thu Aug 6 03:35:11 EDT 2009
Hello Preethi,
I have a small & tricky solution at hand for such matter:
- You need to extend the coding right before the macro EXIT_CANCELLED is beeing executed (or the event RAISE CX_BO_TEMPORARY).
- In the case of a generic user decision you'll needed to extended the business object DECISION.process by a system-wide delegation. Using the newer releases that make use of the ABAP-OO-Workflow-Framework (as this happends with 6.20, you can change the coding here and replace the part finding the workitem-ID by using the existing variable in the coding and/or use the already instantiated workitem-object to reverse the status.
- You can also put the part of the coding in a new object ZWFTOOLS, method REPLACE and call that as a "Method after execution" from your workflow pattern.
However, here's a piece of coding that you may use:
FUNCTION Z_WF_WORKINGWI_PUTBACK.
*"-----------------------------------------------------
*"Lokale Schnittstelle:
*" EXCEPTIONS
*" NO_WORKITEM_ACTIVE
*" ERROR_ON_PUTTING_BACK
*"-----------------------------------------------------
* (c) written by Florin Wach
DATA: requesters TYPE STANDARD TABLE
OF SWOTOBJID
INITIAL SIZE 10.
CALL FUNCTION 'SWO_QUERY_REQUESTER'
TABLES
REQUESTER = requesters
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC 0.
" Laufendes Workitem konnte nicht ermittelt werden,
" zurücklegen deshalb nicht möglich.
" Bearbeitung einfach abbrechen, wie sonst im
" Standard auch
MESSAGE E003 RAISING NO_WORKITEM_ACTIVE.
ENDIF.
DATA: wi_id TYPE SWR_STRUCT-WORKITEMID,
new_status TYPE SWR_WISTAT,
rc TYPE sy-subrc.
FIELD-SYMBOLS: <r> TYPE SWOTOBJID.
READ TABLE requesters ASSIGNING <r>
WITH KEY objtype = 'WORKITEM'.
IF sy-subrc 0.
" Laufendes Workitem konnte nicht ermittelt werden,
" zurücklegen deshalb nicht möglich.
" Bearbeitung einfach abbrechen, wie sonst im
" Standard auch
MESSAGE E003 RAISING NO_WORKITEM_ACTIVE.
ENDIF.
wi_id = <r>-objkey.
CALL FUNCTION 'SAP_WAPI_PUT_BACK_WORKITEM'
EXPORTING
WORKITEM_ID = wi_id
IMPORTING
NEW_STATUS = new_status
RETURN_CODE = rc.
IF rc 0 OR new_status+0(5) 'READY'.
MESSAGE E002 RAISING ERROR_ON_PUTTING_BACK.
ENDIF.
ENDFUNCTION.
-------- Original-Nachricht --------
> Datum: Thu, 6 Aug 2009 10:38:28 +0530
> Von: "Gurramkonda, Preethi" <preethi.gurramkonda at capgemini.com>
> An: "SAP Workflow Users\' Group" <sap-wug at mit.edu>
> Betreff: Need to change the revered( in process state) work item to Ready state again
> Hi All,
>
>
>
> If the work item/ User decision step has more than one agent and any one
> of the agents opens the work item and cancels it, then the work item
> will get removed from other agents inboxes. IF the work items is
> replaced then again it will come to all the agents. This is the standard
> SAP behavior.
>
> However is there any possibility even though the work item is reserved
> by the user and if he cancels the work item , it has to appear in other
> agents inboxes.
>
> Whether we can do any customization for this that is activating the back
> button for the user decision step so that the user can use this button
> without using the cancel button.
>
> And if he used the back button , the user decision step/ work item
> should be ready to all the agents.
>
>
>
> Please let me know your inputs.
>
>
>
> Thanks in Advance.
>
>
>
> Thanks & Regards,
>
> Preethi G
>
>
>
>
>
>
>
> </PRE><p style="font-family:arial;color:grey" style="font-size:13px">This
> message contains information that may be privileged or confidential and is
> the property of the Capgemini Group. It is intended only for the person to
> whom it is addressed. If you are not the intended recipient, you are not
> authorized to read, print, retain, copy, disseminate, distribute, or use this
> message or any part thereof. If you receive this message in error, please
> notify the sender immediately and delete all copies of this
> message.</p><PRE>
More information about the SAP-WUG
mailing list