Delete Work Item from PO Releaser's Inbox during Workflow

Hi All
How can I delete the previous Work Item that was created in the PO Releaser's Inbox if a PO was changed which re-triggered the PO Release workflow but this time to a different PO Releaser.
The workflow is working correctly, i.e. creating the new release item in the new releaser'd Inbox but not deleting the old Work Item for the previous releaser.
Any idea on how I can accomplish this?
Kind Regards
Utian Goliath

PLease refer the below stuff................create a task and put the code inside the method.This task should be fisrt step in your workflow.
User sets doc to Complete from FBV2 , Complete event triggered and workflow triggered.
Workitem goes to approver .
Now , the user immediately changes doc from FBV2 , sets it to Complete again and workflow triggered
workitem goes to the same approver for the same document.
SAP_WAPI_WORKITEM_TO_OBJECT - Worklist table will giv all parent id's for the object key concatenation of
com code , doc no and fiscal year.
SWP_WORKFLOW_INSTANCE_DELETE - Pass the parent id and will delete the entire instance but not
parent workitem id.
SAP_WAPI_WORKITEM_DELETE - Pass parent id everything will be deleted .( Check_final_state = blank ).
No trace found in SWI14 and SWI2_FREQ.
To remove the previous workitem , create a method in the begining of the workflow , use F.M.
SAP_WAPI_WORKITEM_TO_OBJECT to get the workflow id's and then
SWP_WORKFLOW_INSTANCE_DELETE or SAP_WAPI_WORKITEM_DELETE to delete the previous instance.
data : lt_worklist type table of SWR_WIHDR,
       lw_worklist type SWR_WIHDR,
       lv_objkey type SWOTOBJID-OBJKEY,
       lv_return type sy-subrc,
       lv_id type SWP_HEADER-WF_ID.
concatenate object-key-sourcecompanycode object-key-documentn
object-key-fiscalyear into lv_objkey.
CALL FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'
EXPORTING
  OBJECT_POR                     =
   OBJTYPE                        = 'FIPP'
   OBJKEY                          = lv_objkey
  TOP_LEVEL_ITEMS                = 'X'
  SELECTION_STATUS_VARIANT       = 0001
  TIME                           =
  TEXT                           = 'X'
  OUTPUT_ONLY_TOP_LEVEL          = ' '
  LANGUAGE                       = SY-LANGU
  DETERMINE_TASK_FILTER          = 'X'
  REMOVED_OBJECTS                = ' '
IMPORTING
   RETURN_CODE                    = lv_return
  TABLES
  TASK_FILTER                    =
    WORKLIST                       = lt_worklist
  MESSAGE_LINES                  =
  MESSAGE_STRUCT                 =
   if lt_worklist is not initial.
loop at lt_worklist into lw_worklist.
  object-instance = 'X'.
move lw_worklist-wi_id to lv_id.
CALL FUNCTION 'SWP_WORKFLOW_INSTANCE_DELETE'
  EXPORTING
    WF_ID                         = lv_id
    DO_COMMIT                     = 'X'
EXCEPTIONS
  WORKFLOW_DOES_NOT_EXIST       = 1
  OTHERS                        = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
ENDIF.
Second way is to create a fork , and use wait for event step in it with the same event that is triggering the WFL
In the same branch take a process control to end workflow instance.
In the second branch carry out normal processing.
Necessary branch = 1.
So incase the user triggers the event again, a new instance will be created ,
and in the previous instance , the first branch will follow ending the
previous instance and the workitems of other branch will be logically deleted.

Similar Messages

  • How to transfer work items from one user's inbox to other user,s inbox(UWL)

    Hello All
    We need to transfer existing  but  open work items from one user's inbox to other user,s inbox(UWL)
    How to go about it?
    These are the items from backend  R3.
    Thanking you
    Rajendra

    Hi Rajendra,
    Usually in R/3 if you want to transfer the workitems to other user , you can just select the workitem and then click on "Forward" button. This will pop-up a box to enter the "User" ID of the other user to whome you want to transfer the Workitem. A Similar button is available in UWL as well.
    So, in UWL when you click on the Workitem, it will should give you a button "Forward" and by clicking on that you should be able to transfer the workitem you the other user.
    I hope this helps you. Let me know if you need any more help.
    Regards,
    Gopal.

  • Forwarding of Work Item from Approver's Inbox

    Hi All,
    We are in SRM 5.0 SP07 Classic Scenario.
    We have a requirement of restricting forwarding of work items from approver's inbox to users who do not have a approver's role. Presently, when the system takes in a user ID who is having a requisitioner role or for that matter any role. The requistioner receives a work item but the requsitioner is not be able to approve/reject the workitem.
    We would like to ensure only the approvers are selected in search and other users are not even displayed for selection.
    Is there a way to achieve this?
    With Regards
    Sathya

    Hi,
    As per the config guide,when you try to assign the User,using the FIND button,you will get to see all the users with the role "SAP_BBP_STAL_MANAGER" who can approve.
    Else you can filter the possible selection with the BADI BBP_CHNG_AGNT_GET.
    See the foll thread for more pointers:
    Re: Selection of approvers for Bid
    BR,
    Disha.

  • How to forward a work item from user inbox

    Hello,
    We are trying to find a way to remove work items from a users inbox. the workitem has not been opened
    and also it is possible that the work item is in more than 1 users inbox.
    we want to remove the work item from only the 1 user and leave the work item in the other user's inbox.
    Regards
    Gaurav Maini

    Hi ,
    U can see the workitem of the user by the table SWWUSERWI giving user id.
    select the workitem id.
    Go to the transcation SWIA.
    Forward the workitem to your inbox.
    This will not appear in user inbox anymore
    Regards
    Pranab

  • Block deletion of item from PR once released

    hi friends,we are facing a problem that our user is able to delete the item from the PR even when the item is released.But if PO or RFQ is created against it then he is not able to delete item.
    what we want is that if the only PR is created and it is released then user shud not be able to change it even when PO/RFQ is not created.
    is there any solution to this?
    is it possible for us to inactivate the delete button on PR screen if the item is released.?

    Dear All,
    Thanking everyone for quick response
    Well, I tried to delete item from the order in t code IW32. I opened the order in changed mode, selected component tab then choose the same line item number and deleted then saved the order and came out. But to my surprise, this line itme remined intact even after deletion and still appearing under maintenance order
    Any clue how to remove it
    Thanks in advance
    SG

  • SWWL - delete work item - approval preview log??

    Hi all,
    SRM 5.0 ECS.
    We have implemented custom  n step approval wf for shopping cart .The shopping cart has PO and invoice created and the header status for shopping cart is approved.However now the workflow has restarted for the cart and I need to delete the work items from the approvers inbox.
    If i delete the work items from SWWL transaction,will the shopping cart status still be "APPROVED"???
    Is SWWL the best way to delete the work items??What will the approval preview for the shopping cart show after I delete the work item?

    Once, Workfiow item is approved, Workitem disappears from inbox right..
    Why do you use SWWL transaction to delete the workitems..
    Can you elaborate the issue..Please.
    Thanks,
    Balaji.T

  • Delete work items

    Hi All,
    I need to delete/archive work item from SAP Inbox for a particular task upto a specific date only.
    How can I do this.
    Regards,
    Neerja

    Hi,
    Delete in test system using RSWWWIDE and RSWWHIDE reports.
    Reports RSWWWIDE and RSWWHIDE are intended for internal use only. The work items are deleted from the database without further query or an authorization check. They can be started from the workflow development environment using the administration menu.
    In a production system, you must archive the work items before you delete them (transaction SARA), with the object 'WORKITEM'.
    Regards,
    Lim...

  • To remove work item from Universal worklist

    Hi,
    Can we remove work item from Universal Worklist by deleting. We don't want to approve or reject them but want to remove from inbox.
    Is there a way for this?
    Regards
    PV

    Hi Parveen,
    check the below note
    check below note
    Note 49545 - Deleting unnecessary work items
    Koti Reddy

  • Two work items are generating in approver inbox ?

    Hi Experts,
    iam working on PR Workflow. I used the user decision to the Approver for approving.  when i relased in me54n. it will go to the approver. but every time two work items are generated in Approver inbox.
    I used the Responsible agent and possible agent is the same user.
    Please how can i control this ?

    Hi Chinni,
                   I guess this could be happening because of any of the following reasons.
    1) if you are using a custom workflow for PR release check the standard one is deactivated.
    2) In SWEL check the event linkage for your BUS there could be 2 of them, Delete one of them.
    Regards,
    Dheepak

  • Deleting work items in PTARQ in mass. Is this possible ?

    Hi
    I have a number of leave request work items that I need to remove/delete from Manager Inboxes in the portal.
    I have identified the work item #'s and am aware that I can remove these via SWWL in mass which is fine. In order to remove the reference to these leave requests from the UWL worklist in the portal also means that I need to remove these workflow instance #s/work items from PTARQ. However the issue I have is that the delete program RPTARQDBDEL does not allow me to enter in multiple work item numbers or even workflow instance #'s (which PTARQ seems to use).
    My question is how can I go about deleting these items from PTARQ in mass ?
    Might someone be able to help ?
    Thanks
    Nicola

    Hi,
    When the approver clicks the leave request approval item in UWL, it opens the leave request approval application. This application lists all leave requests with status SENT. So, if you delete the work item (with SWWL), yes - the work item disappears from UWL. Now if the manager opens some other work item, again the approval application lists all leave request. And since you did not delete the leave request from the database with PTARQ, it will be of course still included in the list.
    >PTARQ will remove any remaining details in the UWL
    >manager would see the skeleton information in the UWL list.
    So, these are not really correct. PTARQ does not delete anything from UWL. PTARQ deletes the leave request itself, and thus it will not be anymore in the approval application list of requests.
    So if you want to get rid of the whole "leave request package", you need to execute both PTARQ (to delete the leave request) and SWWL (to remove the item from UWL).
    Regards,
    Karri

  • Automatic deletion of Items from Customs Declaration

    Hello Experts,
    I will be thankful to anyone could help me with this one : We need to automatically delete line items from declaration based on certain criteria before the first outbound message is sent. For example : The process should be : 4 items in invoice, but only 2 in the declaration (duty unpaid goods). It cannot filter the data in the Feeder system. I was hoping data proposal BADI could be the solution however It does not seem to work...
    Your comments are appreciated,
    Branislav Petricek

    Dear Branko,
    if you want to delete the items before creating the idoc while processing the message, you can use the Badi /SAPSLL/CUS_ECC. There you can modify the data that are sent to customs.
    The items will still be physically available in the document itself but only the ones you do not filter will be sent.
    best regards,
    Christin

  • Display universal work item from CRM work list

    Hello all,
    In ECC system, we have defined several workflows. We can see the work item from the universal work list via the portal.
    Now, we have a new request, we would like to see these work items form CRM work list.
    I have checked the custo and I have questions:
    1. spro- Customer Relationship Management under  UI Framework  Technical Role Definition  Define Navigation Bar Profile . Select the relevant navigation bar profile and add the specific UI objects WI_BOR.
    please check the link http://help.sap.com/saphelp_crmscen70/helpdata/en/e9/7fec7e8f954e7fb60d56dd6324e313/frameset.htm
    2. CRM->Basic functions->Worklists->Define Alert Inbox and Workflow Inbox->Define Object-Specific Navigation
    => here i am not sure if need to add entry, if yes, which entry ?
    3.  need to define  ??
      RFC destination
    . Transaction Launcher Logical Systems and URLs 
      and workflow substitute profile Id
    Thanks in advance for your help.
    Best Regards,
    Elsa

    I've found a solution.
    I've been told that this problem is occuring
    because the Work Item ID is not being passed correctly to the BOR basedtransaction.
    The solution in my case is:
    (1) Goto SPRO -> Customer Relationship Management -> IC Web Client ->
    Basic Functions -> Transaction Launcher -> Configure Transaction
    Launcher (wizard)
    (2) Give the launch transaction id in the 'Entries' screen. The launch
    transaction id is Z_ACTION_EXECUTE_WORKITEM in my case.
    (3) Keep all the parameters same in the further screens until you reach
    the 'Transaction Parameters' screen
    (4) In this screen, the value currently being passed to Object Key is
    //selectedAUI Workitem/WI_ID. Change this to
    //selectedAUIWFWIAttachments/OBJECT_ID.
    Goto last step and then say 'Complete'.

  • Moving items from sub-folder to inbox are disappearing

    Hello everyone, 
    We have exchange 2010 and we are having issue when user move item from sub-folder to inbox then the item just disappears. I have tested this at-least 3 mailboxes. 
    If i do this in outlook then it disappears right away. if i do this in OWA then it disappears in 10 seconds.  Sometimes it shows up in deleted folder but most of the time it doesn't but it always shows up in "recover deleted item" in outlook.
    Please advise how to find what's going on. thanks 

    I don't think it is a Managed Folder Mailbox Policy which is doing this. We have almost ruled out that the issue is specific to Client but not Server. If you want to check the Managed Folder Mailbox Policy for a mailbox run the command below:
    Get-Mailbox -ResultSize Unlimited -Server ServerName |?{$_.ManagedFolderMailboxPolicy -ne $Null}
    The above command will help us get all the mailboxes where there is a ManagedFolderMailboxPolicy Applied
    To Get the ManagedFolderMailboxPolicy for a Specific Mailbox Run the command below:
    Get-Mailbox MailboxName | Fl Name,DisplayName,ManagedFolderMailboxPolicy
    If Deleting the outlook profile/ost fixed the issue, then it might have been most likely an issue with corrupted outlook rule. if you want to do it for all the mailboxes across org, i would suggest you force that via group policy using a PRF File.
    M.P.K ~ ( Exchange | 2003/2007/2010/E15(2013)) ~~ Please remember to click “Vote As Helpful" if it really helps and "Mark as Answer” if it answers your question, “Unmark as Answer” if a marked post does not actually answer your question. ~~ This
    Information is provided is "AS IS" and confers NO Rights!!

  • Deleting a contact list item through Powershell in sharepoint 2010 synced with outlook 2010, does not delete the item from outlook.

    hi All,
    I have a requirement for updating the contact list from CSV file and updating/ adding and  deleting the changes in the SharePoint list using PowerShell script. List is also synced with outlook.
    The problem arises, when we delete an item from the list using PS, the item (which was earlier synced with outlook) is not getting deleted from outlook.
    Strange behavior : when we perform the same deletion operation manually from the SharePoint UI, every thing works fine as required.
    Please refer the below PS
    #Adding the records from SharePoint not in CSV file
    if($flag -ne 1)
    Get-Member -InputObject $csvRow -MemberType NoteProperty | ForEach-Object {
    $property = $_.Name
    $newItem.set_Item($property, $csvRow.$property)
    $newItem.Update()
    #Deleting the records from SharePoint not in CSV file
    CreatePSLog "Deleting the records from SharePoint not in CSV file"
    foreach($itm in $List.items)
    $del = 0
    $items | ForEach-Object {
    if($itm["SAP Ansprechpartnernr"] -eq $_."SAP Ansprechpartnernr")
    $del++;
    if(!$del)
    $List.GetItemById($itm.Id).Delete()
    $List.Update();
    $Web.Update();
    many thanks in advance, Please suggest as I am completly stuck on this :(
    Regards, Arun kumar

    Hi Kumar,
    Please remove the codeline $List.Update();, then run your code again, it works for me.
    You may need to firstly delete the synced contacts list within Outlook to remove those undeleted accounts, then re-connect the SharePoint contacts list to outlook, then run your modified Powershell code.
    Thanks
    Daniel Yang
    TechNet Community Support

  • Is there any way to make work item invisible in the SAP inbox?

    Is there any way to make work item invisible in the SAP inbox?
    If yes , How?
    How can we delete a work item without using SAPLSINWP program?Is it possible???

    Thanks suresh, But I was a looking for a solution where as soon as the work item is created should be made invisible in the SAP inbox, is there any way for this or any other alternative?

Maybe you are looking for