Work Item Approval/Rejections

Richa Gupta richa.cse7 at gmail.com
Mon Feb 25 11:29:47 EST 2013


Hi David,

Create an activity in the REJECT path and put in the below code. Using
this, once user clicks on REJECT button, a popup will appear where in user
will enter the rejection reason. If he/she does not do that, then a new pop
up regarding confirmation will appear and this will continue until and
unless user does not enter the rejection reason in the window. This will
save you using any loop or soemthing in the workflow.

FUNCTION zhrfm_get_rejection_reason.
**"----------------------------------------------------------------------*
**"*"Local Interface:*
**"  EXPORTING*
**"     REFERENCE(EX_TEXT) TYPE  CATSXT_LONGTEXT_ITAB*
**"----------------------------------------------------------------------*
** get  the reason for rejection from approver in a pop up window*
  DATA: lv_answer(1).
  CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'
    EXPORTING
      im_title        = 'Reason for Rejection'(008)
      im_start_column = 20
      im_start_row    = 20
    CHANGING
      ch_text         = ex_text.

  IF NOT ex_text IS INITIAL.
  ELSE.
    DO.
      CLEAR lv_answer.
      CALL FUNCTION 'POPUP_CONTINUE_YES_NO'
        EXPORTING
          defaultoption = 'Y'
          textline1     = 'Its Mandatory to fill Rejection reason'
          textline2     = 'Please continue to call editor again'
          titel         = 'Information'
          start_column  = 25
          start_row     = 6
        IMPORTING
          answer        = lv_answer.

      IF lv_answer = 'J'.
        CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'
          EXPORTING
            im_title        = 'Reason for Rejection'(008)
            im_start_column = 20
            im_start_row    = 20
          CHANGING
            ch_text         = ex_text.
        IF NOT ex_text IS INITIAL.
          EXIT.
        ENDIF.
      ENDIF.
    ENDDO.
  ENDIF.

ENDFUNCTION.

Regards,
Richa Gupta
Email : richa.cse7 at gmail.com

On Mon, Feb 25, 2013 at 5:07 PM, David G Cooper <davidgcooper06 at gmail.com>wrote:

> HI fellow experts,
>
> I have a requirement for a custom developed application that requires
> workflow approval.
>
> This is a complete customer application from top to bottom.
>
> The standard user decision option in our current version does not support a
> mandatory reason for rejection that can be enforced.
>
> As a result the custom application has an approval sub screen with two
> buttons.  This is delivered to the user via a BOR object method/Task using
> Set parameter ID and a "Call Transaction".  The idea being that once the
> decision is made the result can be returned to the work item.
>
> The Task is contained within an Until Loop to make sure a decision is made,
> before the work flow continues.  I now need to return the result of the
> user
> decision from the custom application back to the work item.
>
> What have I tried,
> 1) Raise Event and leave program where the task has terminating events.
>     When pressing BACK/EXIT/CANCEL buttons the user experiences a continual
> loop back to the approval screen.
>     The current work item completes, but as a decision has not been made, a
> new instance of the work item is created and immediately redisplayed to the
> user without going through the SAP Inbox again.  Result no way to exist
> without choosing a decision.
>    If one of the decision buttons is pressed an event is raised and the
> program completes.  However this results in the work item completing, but
> not returning the correct event, so loops back and presents the transaction
> again without going through the SAP Inbox.
>
> 2) Next tried Function SAP_WAPI_WORKITEM_COMPLETE.  Work Item is locked and
> function returns an ENQUEUE Error.  Even though the work item is locked by
> the same user, as the one executing the function.   (Possible SAP Error).
>
> Suggestions most welcome.
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20130225/7388ae62/attachment-0001.htm


More information about the SAP-WUG mailing list