<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body style="MARGIN-TOP: 2px; FONT: 8pt Tahoma; MARGIN-LEFT: 2px">
Hi Rob,
<br>Though there might be many ways of deleting the workitem from Inbox,I
have used a
<br>background job to delete the workitems which are say 1 week old.This
background job will run every day and delete all the workitems created
by my workflow only which are 1 week old.I am using a report program which
does the actual job.
<br>The code used is:
<br>REPORT YMIB_DELETE_ORDRSP_MAIL .
<p><A HREF="data:begin">data:begin</A> of i_swwwihead occurs 0,
<br>wi_id like swwwihead-wi_id,
<br>end of i_swwwihead,
<br>l_date like sy-datum.
<br>&nbsp;
<br>&nbsp;
<p>l_date = sy-datum - 1.
<p>select&nbsp; wi_id from swwwihead into table i_swwwihead
<br>where WI_RH_TASK = 'TS00008075'
<br>and wi_cd between l_date and sy-datum.
<br>loop at i_swwwihead.
<p>CALL FUNCTION 'SWW_WI_DELETE'
<br>&nbsp;&nbsp;&nbsp;&nbsp; EXPORTING
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WI_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
= i_swwwihead-wi_id
<br>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO_COMMIT&nbsp;&nbsp;&nbsp;&nbsp;
= 'X'
<br>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CREATE_EVENT&nbsp;
= ' '
<br>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DELETE_LOG&nbsp;&nbsp;&nbsp;
= ' '
<br>&nbsp;&nbsp;&nbsp; EXCEPTIONS
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UPDATE_FAILED = 1
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OTHERS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
= 2
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .
<br>IF SY-SUBRC &lt;> 0.
<br>&nbsp;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WITH SY-MSGV1 SY-MSGV2
SY-MSGV3 SY-MSGV4.
<br>ENDIF.
<p>endloop.
<p>ROB CRAWFORD wrote:
<blockquote TYPE=CITE>&nbsp;<font size=-2>I am trying to delete a couple
of work items which are the result of a custom workflow template.&nbsp;
I get the following error if I(the WF-Admin) try to delete the work item
from the action list.&nbsp; "Work item could not be accepted (->function
canceled)"&nbsp; I have also tried to delete the work item using SWWL specifying
the work item and I don't get any results back.&nbsp; The work item still
shows up in the user's inbox and in SWI5(workload analysis).&nbsp; Is there
something special I need to do in the development of the workflow to allow
deletion of a work item?&nbsp; How can I get rid of these work items?</font>&nbsp;<font size=-2>-Rob</font>&nbsp;<font size=-2>Rob
Crawford</font>
<br><font size=-2>Menasha Advantage</font>
<br><font size=-2>1649 Bergstrom Rd.</font>
<br><font size=-2>Neenah, WI 54957</font>
<br><font size=-2>(920)751-2513</font>
<br><font size=-2><a href="mailto:rob.crawford@menasha.com">rob.crawford@menasha.com</a></font></blockquote>
 
</body>
</html>