Skip to Content
author's profile photo Former Member
Former Member

Reject Workflow Item Via BAPI

We are trying to implement functionality to reject a workflow item. We are using a BAPI to release and item.

Can you set the workitem status to rejected with SAP_WAPI_SET_WORKITEM_STATUS?

We attempted to use SAP_WAPI_REJECT_WORKITEM but the funtion states that our workitems cannot be rejected because it is the wrong type.

Any suggestions would be appreciated.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2005 at 02:38 PM

    Stephen,

    A workiten can only be rejected if the corresponding step in the worklfow definition is defined as 'can be rejected'. You can try the 'CANCEL'status, this logically deletes the WI.

    Cheers,

    Ramki Maley.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Stephen & Mark,

      I think you should check something first without going any further - is the step which you need to execute a user decision step or an activity (user decision has the question mark and the play button signs, activity only has a play button)?

      If it's an activity, I'm pretty sure the task behind the step points to a release method of the PR object. This means that whenever the step/task is executed, the user is brought to a standard program or transaction where s/he can release or reject the PReq. Based on the user option, the PR is then rejected or released, the task gets executed and the workflow continues.

      Without knowing your current workflow solution details, one option is to make this step/task so that it completes also when the PR has been released or rejected, not only when the task is executed. In other words, the task is waiting for an event and could complete when it is received, regardless of if it was really executed by the user.

      So, in conclusion, if you have a terminating event defined for the workflow task (or if you will define it), you can complete the task directly by releasing/rejecting the PReq. Just call the correct release/reject method of the PReq object (e.g. bus2009->release) and as a result the Preq gets rejected or released, task completes (since it received the terminating event) and the workflow can continue.

      But as I mentioned in the beginning, this is just one solution alternative, please provide more information about your current wf config (step type, task used, terminating events used, method called etc.) for us to get the complete picture.

      Hope this helps,

      Mikko

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2005 at 10:27 PM

    I believe this is the information you are asking for...

    Step Type – Activity

    Task Used – TS00008014 - Requisition release refused

    Terminating Events – I can’t find any

    Method Called – None

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Michael,

      I am assuming you are using the WF template 00000038 or a copy of it. The first step in the workflow Release Requisition is an asynchronous task listening for terminating events Released, Canceled, Rejected and Significantly Changed. When an item is released with BAPI_REQUISITION_RELEASE, the Released event is triggered. This completes the Release Requisition step and the WF proceeds to the Positive Confirmation step which I think displays the PO item to the initiator. However one can only reject the PR item by executing Release Req. WI in the inbox. I was not able to find a BAPI or FM to reject the PR item in the background or remotely in our 6.20 system. You may request SAP for such functionality to be developed since Release & Reset Release are made available.

      As Mikko suggests, your best bet is to go for UWL.

      Cheers,

      Ramki Maley.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 12:35 PM

    Any resolution to this? Please help as I am facing the same issue!

    Thanks.

    EnriqueL

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.