Terminating Event Terminating all work items

System : Solution Manager
Business object : BUS2000116
1. I have multiline container element for Agent.Agents are Dynamic not static.Approval from all agents is required.
2. Work flow desing
a.Defination of Agent : ABAP Dictionary type SWP_AGENT with Multiline
b. FORK with two steps , One step Required
c. One part of FORK has WAIT FOR EVENT "REJECTED" Event and other has Activity with Agent "_underline []Agent()Index of: Agent _underline"
d. Under the Miscellaneous tab Multiline line element Agent.
e. Terminating event for this activitiy is APPROVED Event, which I have defined in business object.
Let say in Program [Custom tab for standard transaction CRMD_ORDER] I have three agents I am getting Three work item in the workflow log with different Agent.
PROBLEM:
When any user open the workitem from SAP Inbox and APPROVE it[ Custom button on standard screen CRMD_ORDER], Program raises Event APPROVED by using Function Module "SWE_EVENT_CREATE". But it set other two work items also in Completed status.
concatenate 'US' sy-uname into v_creator.
        call function 'SWE_EVENT_CREATE'
          exporting
            objtype                       = c_objtype    "BUS2000116
            objkey                        = objectkey    "Key field Which is GUID from CRMD_ORDERADM_H  table
            event                         = gs_event      "APPROVE"
           creator                       = v_creator
            take_workitem_requester       = 'X'
          START_WITH_DELAY              = ' '
          START_RECFB_SYNCHRON          = ' '
          NO_COMMIT_FOR_QUEUE           = ' '
          DEBUG_FLAG                    = ' '
          NO_LOGGING                    = ' '
          IDENT                         =
         importing
           event_id                      = v_eventid
           receiver_count                = v_count
        TABLES
          EVENT_CONTAINER               =
         exceptions
           objtype_not_found             = 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.
Please let me know what could be the reason?
Thanks in Advance.

I think instead of using a event you can use a container element. You want to make sure that the users performs the approving action properly. If the user does that inside your code you set this container element as X. You pu the approval step inside a loop that checks whether the container element is X. Also another important thing you need to put the parallel approval step along with the loop inside a subworkflow.
Thanks
Arghadip

Similar Messages

  • UWl doesnt display all work items

    Hi all,
    We are on SRm 7. and EP7.
    The UWL config has been done only for SRM 7 system.
    However now when I access the UWL in Portal,I see all OLD WORK ITEMS.Howvere when Ic heck my SAP inbox,I see all new wokr items also in addition to the old work items.
    Can someone explain me this difference in the UWL dipslay in PORTAL?

    Hi,
       Check the option in the UWl whether you choose display all option.
    Saravanan

  • Parallel processing  not all work items are completed

    Hi experts,
      I have a strange problem with some Wi's wich does not get the status completed when the main WF is completed.
    I have a WF with a fork , one branch is waiting for an event and the other branch is looping  on a decision task and actions. when the event is received, the WF ends correctly and the main WF is completed. but the last active WI in the other branch is not completed  and remain in the inbox of the agents.
    I'm a bit confused,do you find this behaviour normal ?
    SAP_APPL   500 : level  11
    SAP_BASIS  640 : level 15
    SAP_ABA     640 : level 15
    regards,
    Abdellatif

    Hi Abdellatif,
    normally the workitem should be put to logically deleted, so this is indeed strange behaviour.
    The only thing I can think about is, that your workflowdefinition is a bit corrupt, if you check the workflow definition, no warnings occur?
    Kind regards, Rob Dielemans

  • Terminating event of a task is not working

    Hi,
    I implemented WS20000075 for purchase order release.
    The dialog workitem of approval has terminating event 'released'
    all thru the developement in dev and Q system., this was working
    but in production , it happened that other user release PO from me29n
    the approval workitem is still in process
    i cant check events because trace is off
    cud please suggest wat cud be the reason that inspite of release of PO, the workitem did not complete ?
    thanks
    r

    Two questions first:
    #1) In Dev and Q, did you test (or experience) the scenario you are facing in Prod, that being someone else is Releasing the PO?
    #2) In Prod, when the Approver performs the release step, does the WF advance?
    I'm going to presume that the answer to #1 is NO, and the answer to #2 is YES.  If that is the case, here's what I believe to be the dilemma you face.
    A "Terminating Event" is not the same as a "Wait for Event".  The purpose of a Terminating Event is to essentially call back to an activity that is "In Progress" that the work is done and that its time for the activity to end and to move on.
    Your PO Release for example; The user clicks the Release icon and then clicks Save.  At that point, processing is handed off to the Update Process (Asynchronous) and the screen is exited.  Even though you've left the screen, there's no telling if or when the Update Process for the save has even started or when it has been completed.  But it's only when the Update Process has completed that the true Logical Unit of Work (LUW) has completed, and hence when it's appropriate to move on to the next step in the WF.
    The way this gets accomplished is to trigger a Terminating Event at the very end of the Update Process, which in turn gets picked up by the PO Release activity that is still sitting and waiting with status "Executing".  And that's the key.
    I'm almost 100% certain that the Activity has to be in the state of "Executing" before it will react to a Terminating Event.  In your scenario, where the Release gets performed outside of the WF, the Release Activity is still in "Ready" status.
    I think the solution here is to put a "Wait for Released" in parallel with the Release Activity as a means of capturing the Release that occurs outside of the WF.
    Hope this is relevant....Apologies if not.
    Tom Carruth

  • Terminating Event for BUS2017 Custom Method

    Dear Experts,
    I have an issue with the Terminating Event of the Workflow for BO : BUS2017. The event is getting triggered but receiver is not being picked.
    I have created two events GR_103 and POST_105 in the Custom BO ZBUS2017 by delegating it to BUS2017. GR_103 is the triggering event for my workflow which I have triggered in the POST_DOCUMENT Method of the Implmentation for BADI : MB_MIGO_BADI.
    GR_103 is triggered while doing MIGO (Goods Receipt) for Movement Type 103. My Workflow is triggered perfectly and then I have used a Dialog Asynchronous Task in which I have called the MIGO Transaction for Releasing the GR Blokced Stock using the Movement Type 105. I have created a Custom Method POST in the BO ZBUS2017 and I have used the FM: MIGO_DIALOG to call the MIGO. I am trying to raise the POST_105 event in the Method MB_DOCUMENT_BEFORE_UPDATE of the Interface IF_EX_MB_DOCUMENT_BADI.  I have defined the Terminating Event for the asynchronous Task as POST_105.
    Now the event POST_105 is triggered, but SWEL says 'No receiver entered'. Even the SWEINST shows the object data as the current Work Item along with Object Key, but still receiver not picked. When I try to trigger the same event in a test report by using call transaction, then the event triggers and work item gets completed without any issues.
    Please advise.
    Below is my terminating event code.
      READ TABLE xmseg INTO wa_mseg INDEX 1.
      CONCATENATE wa_mseg-mblnr wa_mseg-mjahr INTO l_objkey.
      IF wa_mseg-bwart = '105' .
        CALL FUNCTION 'SWE_EVENT_CREATE'
          EXPORTING
            objtype           = 'BUS2017'
            objkey            = l_objkey
            event             = 'POST_105'
          EXCEPTIONS
            objtype_not_found = 1
            OTHERS            = 2.
      ENDIF.
    Regards,
    Raju.

    Have a COMMIT WORK after the function call. (At least test it - I am not sure if it will have some effects in your BADI - at least you will know whether the issue is about missing commit).
    And please use SAP_WAPI_CREATE_EVENT instead of the old function you are using.
    Also, make sure that the events will look exactly the same in event monitor SWEL when triggered from your code and when using test tool. Maybe there is some minor difference/mistake (object key, etc.) that you haven't noticed.
    Regards,
    Karri
    Edited by: Karri Kemppi on Feb 7, 2012 8:14 AM

  • Single work item view containing all different work item types

    Hello,
    I've been trying to create a view which should contain all different work item types that are assigned to "me" and not closed. I've created a type projection and the view itself and it displays all work items. The problem I've got is that I can't set a critera
    that only shows items that aren't closed as all work item types have their own statuses instead of one common work item status.
    Does anyone any ideas around how to solve this?
    Thanks in advance!
    /Alexander

    Hi,
    I can not justifiy to my clients to purchase an application from 3k to offer something that should be trivial in an application such as service manager. Furthermore, i need sort all my active work items (IR, SR and MA) in accordance with the target date
    calculated by SLO.
    The WorkItem class has a relathionship to the type SLA Information, but type 1 to many. Anyway I could create a view that displays work items and DisplayName field from SLA (basead on first row in the relationship). However I could not display more fields.
    If I  could display TargetEndDate and Status from SLA Information, it would be a reasonable solution for my client.
    Thank´s
    Juan

  • Closing Collections Work Items based on FI-CA Transactions

    Hello Colleagues,
    We have a requirement to close Collections Work Items when certain transactions are performed, e.g. Creation of Instalment Plan, Write-off, Payments to name just a few.
    Because some of  these items involve clearings,  Dunning  will not be triggered for the cleared items. Therefore I assume the Dunning BRF configuration cannot be used to close the Work items.
    Is the  only way to close work items when these FICA transactions are performed is by coding FICA Event logic that is specific to each of the transactions? (e.g. use a Write-Off Event to close work items when items are written off, an Installment Plan Event  when Installment Plan is created, and so on? )
    Your insights will be very helpful.
    Thanks in advance,
    Ivor Martin

    Thanks Bill.
    I understand and agree with  the expectation gap about Instalment Plans.
    Some good news on clearing of dunned items:
    We did some more testing after un-checking the  "Enforcement" Work item in the Work item category configuration.
    Now the work item is closed when the document that is in dunning is cleared (i.e. via payments, write-offs, reversals, acct maintence, etc). The Work item Status turns to "G" (closed due to incoming payment).
    I have logged an OSS in regards to the Instalment Plan on the request of my client - I would  be surprised if they send us a fix to close the work item upon creation of an Instalment Plan. I think we will end up coding our work item closing logic in FI-CA Event 3040 (after the Instalment Plan is created).
    Regards,
    Ivor

  • Transaltion in work item title not working consistently

    Hi,
    I am seeing a strange behaviour in SAP business workfplace with respect to the work item title (subject line) translation........................
    - Some prelimenary info : All work item translations for title (subject) and work item body are completly maintained
    - System : SAP ECC 6.0
    Problem being faced
    1. Workflow is trigerred by an user with English login and this generates a work item to the another users
    2. The work item receipent logs in in different langiage say german...................he then starts SBPW to check this work item
    3. The title of the work item appears in english while the same title which appears in the work item body also is shown in German (User log on language)..................
    4. The user displays (not execute) the work item........................The work item title is shown in in German.
    5. The user returns to the inbox and then the work item title changes to German language.........................
    Has any one encountered this problem.......................I looked for SAP notes but could not find any note suitable for this..........................
    I assume it is more a SBWP bug but want to gather some experience from this group
    Thanks
    Kiran

    Hi,
    This may happen due to the problem in language translation. Please maintain the language translation properly then test it agian.
    Pleae check the table HRS1206 where OTYPE = 'TS' and OBJID= 99000031 ( task number ) whether the multiple language translation is maintained or not. If not thenyou need to maintain through transaction SE63.
    Please visit below link for more details.
    http://wiki.sdn.sap.com/wiki/display/ABAP/TranslatingTaskDescriptionusingSE63
    Thanks and regards,
    SNJY

  • Forwarding 'Wait Step'work items using SWIA

    Hi,
    I need to forward work items of one user A to another user B urgently, using SWIA.
    The work items are in executed state. This is after a fork step in the workflow, where the executed work item is one branch of the fork.
    As these items are executed, we will have to forward the work items that are in ready state.
    The work item for the other branch of the fork is in ready state. However this is a wait step, and hence I am not able to forward this item.
    Kindly advise as to how should I forward these items.
    Best Regards,
    Smruthi.

    Hi Smruthi,
    Dont confuse with the wait for events and dialog work item. There is no direct link between the wait for events and the work item.
    Only dialog work items needs the user action and dialog work item's only can be forwarded to other user's.
    For this, the work item should have the status of 'Ready'. If the work item has the status 'In process' that means, the user opened the work item and still he didnt take ant action on it.
    In this case, using SWIA you can manually change the status as 'Ready' and then you can forward the work item to the other user's.
    To forward the work item use the function module 'SAP_WAPI_FORWARD_WORKITEM' or use the SWIA transaction.
    Thanks,
    Viji.

  • Amending List content (deleteing & renaming) - Effect on previous created work items/reporting

    Hi, 
    I going to be changing the naming and structure of support groups and incident tier groups. I'd like to know what effect this has on all previously created work items and the reporting on those work items. 
    In addition, I am also adding list items to impact and risk list to change incident prioritisation settings and want to know the effect it will have on the live work items and historical work items.
    Cheers,
    Pete

    When you're thinking about editing enums in a live system, it's important to know a little but about how they work on the back end. 
    each enumeration entry essentially breaks down into a GUID and a display string; there are other properties, like Parent, Ordinal, InternalName etc, but those don't come in right now. when you use a console form to look at an incident, the control reads
    the GUID that is stored on the incident in the property in question, and then goes and collects the list that property references, and shows you the correct display string for your language. the specifics are not important, but the fact that what's stored
    on the incident is that system generated GUID is. when you edit a list, each entry has a unique GUID, that can't be changed or seen through the UI.
    Adding a new entry will add a new guid and a new display string. this option will be available the next time the form is opened. this works pretty much the way you would expect it to. 
    Renaming an enumeration keeps the GUID the same, but changes the display string. any incident with that GUID will see the new string, and the data warehouse will be updated with the new string, so
    historical incidents that had that value will now have the new display string.
    Deleting an enumeration will remove the entry from the list and break the mapping of that guid to the display string, but does nothing to the incidents that have that guid on them. the net-net of this is that any incident with that guid
    will have a value (i.e. not null) but it won't have anything to show to analysts, so it will look like it isn't set. the datawarehouse keeps those mappings even after they are deleted, so removing a mapping will not affect reporting. 
    the end of this is that you should re-classify any items before deleting an enumeration, you should only rename an enumeration if that new name makes sense for all work items for all of history. it is possible to reorder enumerations while keeping their
    GUIDs, but it requires some XMLing. I've posted about it elsewhere in this forum, so let me know if you need a link

  • Getting UWL Work-items

    Hi all,
    I am trying to fetch all work-items out of an UWL for an user and display them.
    For this reason I have taken a look at: https://help.sap.com/javadocs/NW04S/current/uw/index.html
    Unfortunately I am absolutely not familiar using UWL-API and it is just overwhelming.
    Does anybody have a code example and a hint, what the most important classes in UWL-API are?
    Thank you for your help!
    Kind regards, Patrick.

    Hi Patrick,
    Go through :[http://help.sap.com/javadocs/NW04S/SPS09/uw/overview-summary.html]
    Using the UWL API inside a Web Service   
    [thread|Using the UWL API inside a Web Service;
    Regards
    Khushboo

  • How to access other user's inbox work items?

    Hi,
    I have to view what all work items are avaialble in a particular user's inbox. How to achieve this?
    Is it possible?
    -Nick

    Hi Nick,
    So you would need all the other users inbox items to be displayed in your SBWP rite?
    You can do this by substitution. Please follow the below steps.
    Go to SBWP of the user whose inbox you want to see.
    SBWP -> settings -> office settings  ->  Substitution -> Add ur inbox in the substitute field and substitute all authorizations .(Check for the End date as well).
    You need to follow the same for all the other users.
    After this, Log in your SBWP and check if you are able to see all the user's inboxes or not.
    Thanks,
    Nick S

  • Terminating Event to Event Queue due to Work Item Lock

    I have a dialog workflow task based on an asynchronous method defined with a terminating event.  When the user executes the work item, the method generates the terminating event (via a V2 change document) but the work item is enqueued (locked) by the same user (locked when they execute the work item from SBWP) and therefore the terminating event goes into error and is placed in the event queue.  The background job which processes the event queue does not redeliver the event so it stays in the event queue and the work item fails to complete.  Other than dequeing the work item lock myself with a function call how do I get around this catch 22?

    Hello Martin,
    Actually, the locking happens whether I have the task as asynchronous or synchronous.  The problem is the timing. If the user does not release the lock (by backing out of the dialog which is executed) prior to the terminating event attempting to enqueue and complete the work item then the event goes into error and is inserted into the event queue (and lingers there indefinitely, almost). Another issue with the asynchronous approach is that even if the user backs out of the dialog before the event actually attempts to complete the work item they will still see the work item in the inbox unless they click the refresh button when they get back to the inbox. 
    I have changed the task to synchronous but here is my scenario and another question.
    The process being workflowed is the approval of service entrysheets (similar to an invoice if you are not familiar with External Services).  In our process, there are a large number of documents being created and requiring approval by particular approvers.  It is a normal scenario for an approver to have, lets say 25 documents in his inbox awaiting approval. It was not practical for him to have to navigate back and forth between his inbox and the approval task screen.  Therefore, I give the users the option of (when executing a work item) having all the documents in his in-box (for this particular task) be presented in an approval list screen.  They can then do a mass approval of the 25 documents with 1 click and 1 navigation.  This list screen is also available to be executed outside workflow via a tcode.  So, when the user executes the mass approval (either from the inbox or outside workflow) the work items are terminated via the terminating event assigned to the approval task.
    A couple of issues remaining:
    1) Given my example of 25 work items (user executes 1 work item from in-box
    and I displayed all 25) being approved, when the user returns to the in-box, the 24
    items remain in his inbox until he clicks the refresh button since these were not actually "executed" from the workflow engines point of view.  However, these were terminated successfully because they were not "locked".
    <b>Question:</b> Is there a way (user exit?) to trigger the inbox refresh automatically.
    2) Now, the issue with the actual work item which the user executes from the inbox.  As I mentioned, the work item is locked as soon as the user executes it and is not released until they back out of the dialog or logoff.  So, here is what happens:  If the terminating event is sent before the lock is released the event is sent to the event queue.  If they then back out back to the in-box, its OK since I put some code in the SWO1 object type program (rememeber, its now synchronous) which will determine if they did the approval/rejection and the work item will complete and the event in the event queue will be deleted the next time the Event Queue Background job runs (it deletes any events for work items already in COMPLETED status). However, lets say they simply log off rather than backing up to the in-box or they don't do anything and are eventually logged off by timeout. In this case the code in the object type program to determine if the approval/rejection was done does not get executed (control does not return to the object type program) and the work item remains in "STARTED" status and remains in the users inbox and the event is in the event queue. So, now we have a work item that should be completed still sitting in the users in-box and the terminating event in the event queue. So the next time the user goes to their inbox the work item is still there.  The interesting thing is that though this may be confusing to the user, if they then attempt to execute the work item, they will get a message: "Work item currently being completed by event" (Message SWF_RUN 644) and the event sitting in the event queue gets redelivered and completes the work item.  To alleviate this problem I was thinking of adding a call to SAP_WAPI_WORKITEM_COMPLETE in the approval list screen after they do the approval but I'm guessing it wont work since it probably will try to enqueue the work item and it will still be locked. 
    Hopefully you haven't nodded off reading this rambling note...
    Thank you,
    Bob

  • Copy of task TS50000075 and  EXTSRV - termination event not working

    Hi,
    We have done copy of TS50000075 and extended business object EXTSRV to ZEXTSRV
    this was done to call function module ISR_CALL_FOR_CHANGE to open up adobe form in edit mode
    it works well but the task is not terminated
    if termination event is put just like TS50000075 like WIOBJECT, ZEXTSRV COMPLETED then workitem never ends and always stays in inbox
    ZEXTSRV COMPLETED event is not triggered when the workitem is completed in the UWL
    even if we trigger this event programatically , it does not find receiver and the task stays in-process
    if termination event is put as _WORKITEM PROCESSED then it bahves like synchronous task ie even if the workitem is clicked and form is not completed, the workitem ends. so the user can click it only once
    also i've tried following
    1 - used the function module to complete the workitem in QISR BADI. but the workitem ID is not available inthe BADI. If I try to export it from business object method and import in BADI, it doesnt work
    2 - find active workflows and derive workitem id and complete workitem using FM SAP_WAPI_WORKITEM_COMPLETE
         this FM doesnt work , step becomes logically deleted which is not desirable
    3 - find active workflows and derive workitem id and complete workitem using other FM SAP_WAPI_SET_WORKITEM_COMPLETD
         work item is complete but there is workflow error - cannot determine succesor node
    4 - find active workflows and derive workitem id and change a particular container element
        check this container element in complete workitem condition in activity step of dialog step of workflow of this task-
         workitem stays inprocess
        check this container element in parellel wait step to complete the workitem-
         parellel step executes but fork is not complete, workflow doesnt proceed
    kindly help in this matter. the workitem does not get completed at all even if we force complete, workflow goes in error of - cannot determine succesor node.
    is there anything specific to the EXTSRV-PROCESS method which makes the TS50000075 task to trigger EXTSRV-COMPLETED and end the workitem ?
    help is much needed in this case
    thank you,
    b

    Hi,
    You need to see the event in SWEL, otherwise it will never work with workflow. Make sure that the event monitor is on (in transaction SWELS).
    I cant see the event in SWEL. The vent monitor is on because if I create event in SWUE, it shows up.
    How you actually create the event now?
    There is BADI QISR which is always called to handle user action of PDF form. I have written the function modue to create event in the user action
    >If i trigger it using funciton module -- then it doesnt find any receivere so it doesnt terminate the task. it is seen in SWEL with no receiver found. do i still need to do commit work ?
    You need the COMMIT WORK always if you trigger the event in any program&function or whatever.
    ok ill try doing commit work after the create event function module
    Test your event with transaction SWUE. Make a test case first in a way that the task is waiting in the inbox/UWL. Then create the event in SWUE. Now, if the task gets completed, you will know that that event itself is working and your terminating event configuration is done properly. If this works, your only problem is in the event creation itself. And for that you need to tell exactly how you create the event. If you do it with your own custom code, use SAP_WAPI_CREATE_EVENT and don't forget to have COMMIT WORK after the function call.
    I am doing exactly like you said. but it doesnt work ie even if I create the event in SWUE, the workitem doesnt get completed.
    This event is seen in SWEL with no receivere found
    I am able to infact set the workitem to complete using WAPI funciton module to complete teh task in the BADI.
    but the workflow goes in to error saying , next node cannot be determined
    Regards,
    Karri

  • Terminating the work item

    Hi,
    I have an requirement where in i need to terminate the workitem after a user decision step. The termination should happen when the user decision is a 'Reject'.
    The termination needs to happen immediately after the rejection happens without any deadline monitoring.
    Can anyone please let me know how to set the work item to obsolete when the user decision is a reject?
    Many thanks,
    Raghav.

    My bad....I was a bit hasty in answering that!!
    Did you try activating the 'Processing obsolete' in the outcomes tab of the decision step? You should do that, and leave the path empty if you don't have any logic to add.
    Let me know if this works.
    -Krisnan
    Edited by: Krisnan Kumar on Jul 29, 2008 9:24 PM

Maybe you are looking for