Terminate workflow programmically

Hi,
Is there any way to terminate an active workflow from an ABAP program?
My requirement is to check for some condition and if its is satisfying, terminate a workflow which is in waitinf state.
Any pointers will be highly appreciated.
Thanks in advance,
Sreekanth.

If you are having the workitem ID which is currently in the wait state, You can use the function module
"SAP_WAPI_WORKITEM_COMPLETE" which will set the workitem status as "COMPLETE"
Regards
Vinod

Similar Messages

  • Terminate workflow

    Hi Abapers,
    I am having a problem in the workflow. I have created one simple workflow regarding the dealine monitoring..and used  Loop(Untill) control , for every 3 minutes one mail is trigger
      Now I have executed my workflow and every three minutes it is executing one external mail and I want to terminate the workflow at any cost manually.
    Can anyone tell me how to terminate the executed workflow.

    Hi,
    You can do one thing, once you reaches your deadline and once the mail triggers you set the flag and check the loop for the flag. If flag is 'X' then terminate the loop.
    I think to achieve this you need to change the loop check condition.
    Hope this helps to solve your problem.
    Cheers,
    Prashant

  • Web-based Work flow management programme

    I am new to this website. I am currently doing a project on producing a web-based workflow programme. This workflow program should have functions which can make different nodes I should be also to produce arrows to link up these nodes. These nodes should provide information to the user when it is clicked. I was told to use java, java applet and javascript for this project. However, I am not familar with these programmes!!! This project is due be end of the year!! Could any kind souls briefly explain to me the method I am suppose to attempt this project. Thanks alot!!

    H E L L O !   - a JAVA book probably by Sue ???
    So you know about this then? - GOOD!
    Actually the first chapter is all about the early attempts to succeed in achieving computational result with a binary output, plus of course the history of programming perverts and people who were relatively normal once upon a while. It goes from Nigel Astley Heatherington-Smythe, who as one time assistant to Charles Babbage spent the remainder of his twilight years with the Tuareg people of North Africa, mounting camels and cackling insanely to himself whist reciting natural logarithm tables. And spanning right accross the decades to the present day 'uj' from Sweden, who seems to be suffering from a severe gender identity crisis typical of many of his forebears.
    (The second chapter is about spanking ... mostly)

  • Request to review the custom workflow logic in E recruting

    <b>Requirement:</b>
    The purpose of this workflow is to change the status of the candidate to “Rejected” if they are not selected in the selection process and also to change the status of the requisition to “Closed” when a candidate is selected. The workflow is triggered when the system is updated to reflect that the candidate has accepted the offer.
    <b>processing details:</b>
    • When a candidate has accepted an offer, an activity “Offer Accepted” is created in the Status Change infotype (IT5139). This will trigger the workflow.
    • The workflow will check the Candidacy infotype (5133) for all other candidates who have applied for the same position and reject the candidate by creating a “Rejected” activity.
    • Simultaneously the workflow should change the status of the Requisition Info type to closed, so that the requisition status is closed
    <b>
    Logic</b>
    <b>Step 1</b>: Candidate accepts the offer (Trigger)
    When the Candidate accepts the offer, i.e. if in the table HRP 5139 (Status change infotype which stores the activities which result in status change of candidate) for the keyed in value of object type ‘NE’ (Candidacy) plan version Current, with the keyed in start date and the end date the value of the field ‘ACT_CAT’ (activity category) is ‘5100-Offer Accepted’, the workflow should trigger
    <b>Step 2</b>: Change Status of Non-Selected Candidates to rejected
    A) Check infotype, table HRP 5139(Status change infotype which stores the activities which result in status change of candidate) for keyed in value of object type ‘NE’ (Candidacy) plan version Current (field name PLVAR), with the keyed in start date (field name - BEGDA) and end date (field name-ENDDA) the value of the field ‘ACT_CAT’ (activity category) is ‘5100-Offer Accepted’ or not
    If it exists then no action,
    If not then,
    B) Trigger (create) the activity “5010-Rejection” (field name “ACT_TYPE”,) in the table HRP 5139 (Status change infotype which stores the activities which result in status change of candidate) for the object type ‘NE’(Candidacy) plan version ‘Current’ with the keyed in start date (field name- BEGDA) and end date (field name-ENDDA) and save ,
    <b>Step 3</b>: Close Job Requisition
    A) Derive the value of object id for object type ‘NB’ {Requisition (related object type)} in table HRP 1001, subtype A654 (Relationship between Candidacy and Requisition) for the keyed in value of the object type NE (Candidacy) plan version ‘Current’ with the keyed in start date (field name- BEGDA) and end date (field name-ENDDA) .
    B) For the above derived value of Object type ‘NB’ (Requisition), change the status of the table HRP 5125 (‘Requisition information’ infotype that stores the status of the ‘Requisition’), to closed field name “STATUS” ‘value 2-closed’ plan version ‘Current’ with the keyed in start date (field name- BEGDA) and end date (field name-ENDDA).
    Request to Check the workflow logicand provide your valuable comments.
    Thanks and best regards
    Rajeev

    Hallo Rajeev,
    better forget the idea of the standard sap workflows - they are just examples and my opinion is: they are bad ones.
    I understand the topic, although so far I did not encounter any customer / hr department which was giving the system so much power through automatization. You also will never be able to hire more than 1 person on 1 requisition. But this is all requirement analysis not solution (although the sencond one is not possible w/o the first one - "pigs will fly before I implement a workflow just the way the hr department described and requested it" ;o).
    Your description is quite rough from my point of view. The workflow landscape is missing to tell you if this steps are enough to get your things done correctly and of course without your processes no serious workflow programmer will give his ok to a workflow soluition.
    What I see as a problem you defined everything based on tables. E-recruiting is an object oriented solution. You never go down to table level for workflows you not even use the hr function modules. You always have to use the service funtions contained in classes like the cl_hrrcf_*_bl ones.
    If you change to service functions you are at least not completely wrong based on what you described as your approach. But for a real complete analysis everyone would have to dig into the processes what is usually impossible as they are company secrets.
    Best Regards
    Roman Weise

  • Unable to see server nodes in sap management console

    I am unable to see servernodes in sap management console.
    I am getting error like sapstartsrv.exe-application error ,
    "The instruction at " 0x00000000" referenced memory at "0x00000000".The memory couldnot be "written "
    click on Ok to terminate the programme.
    click on cancel to debug the programme ".
    Please advise me how can i see servernodes in the sap management console.
    Rewardpoints will be awarded.

    Hi,
    You get back your MMC , please do the following steps.
    1. Go to Run and type MMC.
    2.Go to file and select add/remove snap in ( alt+m).
    3.Click on add
    4.Select the SAP system from there.
    Save  the MMC console which you have created now....This should work fine.
    Thanks
    Pankaj

  • Credit Manager

    Dear SAP Experts,
    PLease tell me how do I configure Industry Credit manager for my system.
    I want Bussiness Partners in the Customer master as Credit Manager.
    Who will only have the authorization to release a failed credit check.
    I have configured Automatic credit check and its working fine.
    The credit manager would be a person form management in payroll, the employee number would be taken from the employee master.
    CAN ANYONE EXPLAIN THE WORK FLOW CONFIGS STEPS
    Edited by: EXPLORING MULTIDIMENSIONAL SAP on Sep 6, 2008 4:00 PM

    This is workflow. The procedure is as follows:
    The organisation management should have been implemented. This is a prequesite since the levels will be defined there.
    Next yu need to define the sender and the receiver and the credit manager authorisations.
    When you create a credit memo request, the created event is triggered for object BUS2094 and the workflow template 20000009 is started.
    The system checks how high the net value of the credit memo request is. If the net value is below limit 1 (minimum limit), the system automatically releases the credit memo request in background processing.
    If the net value of the credit memo request is over limit value 1, the system terminates workflow template 20000009 and initiates workflow template 20000019.
    The relevant employee, depending on the value of the credit memo request and the organizational structure in use (sales organization, distribution channel, division), is then informed of this by the arrival of a work item in their integrated inbox. If the employee releases the credit memo request, the system ends the workflow and deletes the work item from the inbox.
    If the employee stops processing the work item, it remains in the inbox until it has been
    completed and only then is the workflow finished. If the employee changes any of the determining factors in the credit memo request (such as net value), the net value of the credit memo request has to be re-checked. The system deletes the work item from the inbox.
    Workflow template 20000009 receives a terminating event and workflow template 20000019 is triggered. Depending on the value of the item, the relevant employee is informed and receives a work item in their integrated inbox. Once the employee has finished processing the work item (by rejecting or releasing the credit memo request), the workflow is concluded. If the credit memo
    request is changed, workflow template 20000019 is called up. Processing continues until the credit memo request has either been rejected or released.
    This is very technical. It would be better to consult a workflow or a basis consultant for this.
    regds
    Jude

  • Challenges and limitation with ECM ?

    Hi,
    We are evaluating ECM (ERP2004) to automate our compensation process. The following limitations hinder us from pursuing with ECM. I wonder if any of you have experienced with these limitations and managed to overcome via some workaround solutions :
    1. Salary adjustments or bonuses for a staff may be allocated from 2 or more source of budget. Example, the staff bonus (represented by Budget Type = Bonus) may be paid partially by the organization unit's budget and a central budget (another source of fund). It is not possible to allocated specific amount from the different source of budgets into a particular budget type (in this case Bonus) to be allocated to staff.
    2. Our budget needs to be linked to the allocation distribution rule specified in IT27 (Cost Distribution). However, we find no linkages between the budget type with the cost distribution. Example, a staff is funded by 75% WBS A (belonging to Org Unit A) and 25% WBS B (belonging to Org Unit B). When a bonus amount is allocated to the staff, the budget from the respective Org Unit should be deducted accordingly from the budgets of the 2 Org Units.
    3. A budget belonging to an Org Unit may be used to fund the bonus of a personnel or staff belonging to another Org Unit (Example, the staff belongs to another Org Unit but he is rendering his service to this Org Unit). This seems impossible with ECM.
    4. Workflow, in our setup, we need 2 levels of approval. ECM only supports 1 level, and there is no underlying workflow template for us to further enhance or customize.
    5. No audit trail to view who had changed the various adjustments along the way.
    Will be very thankful if you can share some experiences with regards to the above challenges.
    Regards
    Kir Chern

    Hi Kir
    I didn't get a chance to test it out but I would try to create a work around based on:
    1. create 2 comp wage types (one for each budget type)
    2. create 2 comp wage types and custom guidelines to pick on the IT 27 %
    3. this needs some business process change to ensure the funding and distribution are synced.
    4. you can get experienced workflow programmer to fix it
    5. I need to check this one

  • Satellite L300D - recovery error BSOD+imagex.exe application error

    Hi,
    My Laptop lost function a while ago due to some unknown errors. I managed to get most of the data out through safemode and have transfered them to my desktop.
    The problem I am having now is repairing my laptop. I have since lost my receipt and therefore unable to claim warranty; but I figured I could restore my computer to its factory state with the recovery disk I created. The original problem and the one I am facing can be seen here...-> http://forums.computers.toshiba-europe.com/forums/message.jspa?messageID=153146#153146 <-
    As you can see from that thread, the recovery disk didn't work. So based on the advice I received I went to a Toshiba authorised computer repairs centre today and they replaced my Hard Disk Drive with a Fujitsu SATA 120GB. I then attempted to use the recovery disk but ran into a few hiccups. 1) A BSOD comes up randomly during the restoration i.e. During image copying it would pop up... sometimes it would pop up when it is finalising the recovery. 2) Sometimes, the BSOD will be bipassed and instead, an error would come up at 3% of installation finalising saying that img could not be copied from HDD to C/:! 3)Sometimes an image.exe application error would come up saying 'The instruction at 0x77c45a20 referenced memory at 0x00000000. The memory could not be written. Click on OK to terminate the programme.'
    NOTE: None of the these problems occur in the same recovery trial. But they DO come up randomly and when they do, I have to restart the computer and try again.
    My question is this. Since the last piece of advice was to replace my faulty HDD, and I have done so, why am I still unable to repair my computer? And if it is not the matter of HDD, then what is the problem here? I am desperate in fixing my laptop as it is meant to be my 14 year old desktop replacement. Thank you all for your kind attention; I only hope that there is someone out there who has faced and overcome such a problem before.

    Hi!
    Its not easy to say what the reason is for this. It could be a faulty RAM, mainboard or maybe the HDD again. So it could be bad luck that the new HDD is also faulty
    I think you should test something on your notebook with special diagnostic tools.
    http://www.hitachigst.com/hdd/support/download.htm#DFT
    With the Drive Fitness Test you can test your HDD. Download the CD image, burn it on a CD and boot from it. Then you can test the HDD.
    On the same website is a user guide if you want to know more.
    http://memtest86.com/
    Memtest86 is a diagnostic tool to check the RAM. There you can also download a CD image.
    Its easy to use. Run the test 3-4 hours and then you will see if the RAM has some errors.
    After this post your result. Maybe one the tests can find an error.
    If not you should try it with a Microsoft installation disk. Maybe the recovery disk is scratchy or so
    In you cant find something you should go to the ASP again. Speak with the technicians and explain the situation. I think they will try to help you as fast as possible.
    Bye

  • Help: Process control - kill itself and its phater

    Friends,
    If I use the Process control. Is it possible to use the Process Control 'Cancel workflow' to kill ONLY the actual sub-wf and its phater, without killing its grandfhater ?
    Grandfhater - WF
    Fhater - Sub-WF
    Actual Sub-WF (Using Process control here)
    I want to kill only this actual and its fhater. I want the grandfhader alive and go on.

    Create Container element[like status] in Father SUB-WF and In Actual SUB-WF.
    Based on condition if you want to terminate Actual SUB_WF and Father SUB-WF then set the set container element status = 'X' and then use process control [terminate workflow] this will terminate Actual SUB-WF.
    then do the binding fo container element status from Actual SUB WF to Father SUB WF.
    Then in the father SUB WF check the container element status . if Status = 'X'. then use process control to terminate the Father SUB WF.
    In the process control use terminate workflow.

  • SharePoint Online workflows show server error when link is clicked. Cannot terminate them.

    This is for SharePoint Online. I have a number of workflows on a list that are in a 'suspended' state when I navigate to the workflows page for the item. When I click the link to view the workflow, I get a server error.  I need to terminate these workflows.

    Hi,
    Based on your description, you want to terminate these workflows in SharePoint online.
    You can terminate these workflows by the CSOM implementation through passing the ID of the list and list item.
    You can refer to the code snippets below.
    // connect to the workflow services via a CSOM client context
    var clientContext = new ClientContext(siteCollectionUrl);
    var workflowServicesManager = new WorkflowServicesManager(clientContext, clientContext.Web);
    // connect to the instance service
    var workflowInstanceService = workflowServicesManager.GetWorkflowInstanceService();
    // get all instances
    var workflowInstances = workflowInstanceService.EnumerateInstancesForListItem(listId, listItemId);
    clientContext.Load(workflowInstances);
    clientContext.ExecuteQuery();
    foreach (var instance in workflowInstances)
    // is this what we are looking for?
    // if so, suspend it
    workflowInstanceService.SuspendWorkflow(instance);
    // or you can terminate it
    workflowInstanceService.TerminateWorkflow(instance);
    There is a similar case:
    https://social.msdn.microsoft.com/Forums/office/en-US/c62e1d54-bd58-4d38-9514-d58cd22557e4/stop-and-restart-workflow-on-item-edit-sharepoint-online?forum=sharepointdevelopment
    Best regards
    Sara Fan
    TechNet Community Support

  • Workflow terminate if Map MDMWebService CheckOutResponse to artifact in BPM

    Hello, All
       Have you ever try to map a MDM Web Service checkout response to an Data Object in BPM?
       I have published MDM Web Service (checkout checkin) and try to use them as automatical activity in BPM. As for the checkout MDM web Service, it returns the check-out  internal Id array list in response. I have tested this Web Service seperately and it can return the correct check-out  internal Id array list in response.
    My problem:
      I want to save the returned internal Id array list into an artifact in BPM. I defined an Data Object in the type of com.sap.mdm.ws.beans.checkoutResponse, and I map the check out response to this Data Object directly. But BPM workflow will terminate if I map the MDM web service checkout responses to this Data Object.
       If you have used MDM Web Service as automatic task in your past BPM design, have you ever map out the output internal Id array? If so, could you please confirm whether it is the correct mapping method to save the output internal Id array?
    Thanks a lot!
    Welkin

    i think we have the same issue.
    the bpm call checkin ws to check in a mdm record.
    the ws call is succeeded, as the record is checked in.
    the problem is the bpm process will be screwed up if you try to map the response of the that ws call to context object.
    another problem is the bpm will convert the user account to lower case to call the ws.
    it is problem for mdm, as the login account for mdm is case sensitive.
    for this, we have created a ticket yesterday.
    Edited by: John Wu on Jan 13, 2011 5:18 PM

  • Dispatcher failfast is causing the Workflow Manager backend to terminate

    im receiving this error on our event log - workflow, with event ID 359: i tried to restart the IIS of the Workflow Server no Luck, and then did the restart of the workflow backend service, still the same and finally i restarted the whole production server.
    but still the below error is still popping up. please help on how you solve the issue below. i followed all the trouble shooting tips on this site":
    http://technet.microsoft.com/en-us/library/jj193529.aspx
    Dispatcher failfast is causing the Workflow Manager backend to terminate. Exception: System.AggregateException: The dispatcher failure rate has reached 11%. InnerException is the last failure; see traces for other failures. ---> System.Runtime.CallbackException:
    The call to OnRequestAbort on the WorkflowInstance 'a742053a-ed2c-496d-a103-0adfbd2d4437' threw an exception. This is considered fatal. See inner exception for details. ---> System.AggregateException: Should be processing if notifying about persistable
    idle. ---> System.NullReferenceException: Object reference not set to an instance of an object.    at System.Activities.Runtime.ActivityExecutor.CancelRootActivity()    at System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.ScheduleCancel()   
    at Microsoft.Activities.Hosting.HostedWorkflowInstance.Cancel()    at Microsoft.Activities.Hosting.WorkflowSession.TryDispatchNextSubroutineWorkItem()    at Microsoft.Activities.Hosting.WorkflowSession.OnPaused(HostedWorkflowInstance
    pausedInstance)    at Microsoft.Activities.Hosting.HostedWorkflowInstance.ReleaseLock()    at Microsoft.Activities.Hosting.HostedWorkflowInstance.OnNotifyPaused()    at System.Activities.Runtime.ActivityExecutor.OnSchedulerIdle()   

    Hi Jeff12.12.12,
    seems your workflow got stuck in somewhere in the process,
    perhaps you can elaborate me more detail regarding this,
    do this workflow is a custom workflow?
    is there any steps that we can try to reproduce the issue in our lab?
    is there any other error from the ULS log that you able to find regarding this workflows?
    please have a try to clean up the cache.ini,
    http://support.microsoft.com/kb/939308/en-us
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Cancel or terminate a workflow instance

    Hi,
    I have developed a workflow, which will be initiated each time when the item is edted.
    I want to Cancel or terminate a previous workflow instance when the new instance is initiated (i.e when editing list item the workflow associated with that item will be cancelled as the new workflow instance going to be initiated.
    Please let me know how to achieve this.
    I have developed the workflow using Designed.
    It will be fine if we use sandbox solution as well.

    Well you can use the event receiver on ItemUpdated. In this event receiver you can cancel the current running workflow and then start the new instance of the workflow.
    If you want to use this in sandbox solution then check you another thread that you have opened where I have replied. You will have to rely on full trust proxies for that.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d83df5b7-8b05-4f89-8ca1-7dece20cd319/stop-and-restart-workflow-on-item-edit?forum=sharepointdevelopmentprevious
    Amit

  • Employee terminate.Std workflow

    Hi Friends
    Is there any std. workflow to send a notification when an employee terminate? We are in Ecc 6. Let me know which business object to be used.
    Thank a lot in advance
    Nash

    WS 01000041        Delimit Vacancy for Position
    You can check through pftc Tcode.
    Most probably configure the HR Event in SWEHR3 Tcode.
    <b>Reward points if useful</b>

  • Terminate the workflow

    Hi All
    We are on R12.1.3.
    We have a requirement to terminate the workflow when no action has taken on notification for few days.
    Is there any API or the methods to terminate the workflow after the notification timeout.
    Any help is appreciated.
    Regards,
    Sanjay

    Please see these docs.
    Workflow Java Mailer & Notifications FAQ [ID 562551.1] -- "How to Cancel Email Notifications for Particular Workflow Type?" and "How To Cancel Workflow Item Keys In Bulk?"
    How to Identify and Abort Items in a Workflow Queue using Oracle Applications Manager OAM [ID 393460.1]
    You can also use wf_engine.abortProcess API -- http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=WF_ENGINE&c_owner=APPS&c_type=PACKAGE
    Thanks,
    Hussein

Maybe you are looking for

  • I'm using tor program and i cant add flash player to fire fox

    mu problem i'm using tor program to navegat youtube and facebook ( incloud tor program firefox) but this fire fox is not suport to play the flash vedio i tried to add flash player to hem but he didint work '''coud you help me to add flash player to t

  • Oracle 10G Forms and Reports Developer Issue (CANVAS Property)!!!

    Okay guys. I have a form that uses a canvas named as CANVAS4 and another canvas (horizontal toolbar) named HEADER that is the subclass of HEADER and a library called TDAS. What happening is, my CANVAS4 color is r240g240b255 and when i try to set the

  • Transaction key UMB determined on transaction MB1A

    Hi experts, I'm having a problem with a goods movement via transaction MB1A. When trying to move material, an error message is displayed with the information that the account does not exist in the chart of accounts. The account in question is configu

  • Create folder in address book

    Does anyone know how to create a folder in the address book? I do not want to create a group, but an actual folder where multiple contacts can be put into that folder and not exist on the main list of contacts. Any ideas would be great. Thanks nik

  • Problem with 301 redirect

    We moved our site from one domain to another  in the application.cfm on the old domain I analyze incoming CGI.SCRIPT_NAME, divide URL into composite parts and form new links into  tmpRedirectPath variable and after that make redirect to new links usi