cancel
Showing results for 
Search instead for 
Did you mean: 

How can I put back a workitem before I'm back in the business workplace?

Former Member
0 Kudos

Dear experts,

we have quite an interwoven development of workflows with own business objects

and own applications. On double-clicking a workitem for an approval we call up

our own application to show the dataset in question along with functions for

"Approval", "Disapproval" or "Cancel". If the user chooses "Cancel" we are

coming up with a popup offering the user to put back the workitem, which he has

taken over by double-clicking it in the first place.

My problem now is that apparently I cannot use the standard-FMs

"SAP_WAPI_ADM_WORKITEM_BACK" respectively "SAP_WAPI_PUT_BACK_WORKITEM" because I'm locking myself.

I have scruple deleting the SAP standard lock set by the business workplace

in order to be able to execute a put back function.

Does anybody have an idea how I could solve this more elegant ?

Thanks in advance for your appreciated help !

Andreas

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Andreas,

In your BO method (which inturn calls application ) , handle results of approval or Cancel button, by using a flag to determine if the Cancel button is clicked , and if so, raise an exception with macro EXIT_CANCELLED and achieve your requirement.

Hope this helps.

Regds,

Akshay Bhagwat

P.S.: Points would be nice if it helps:)

glauco
Active Contributor
0 Kudos

Hi Andreas,

I've already used the EXIT_CANCELLED too, but I had to develope the folowing code on a new object's method and I have configured this method as a AFTER method on task's tab 'Methods', and it solved my problem very well, so always after method execution, this AFTER method run and verify if user realy had accept and executed totally the wi. If not, I replaced the wi wir=th the second function showed bellow.

=====================

TABLES: swwwihead.

DATA: wi_wlc_header LIKE swwwlhead.

*1o. verify wi status

CALL FUNCTION 'SWW_WI_WL_READ'

EXPORTING

wi_id = swwwihead-wi_id

IMPORTING

wi_wlc_header = wi_wlc_header

EXCEPTIONS

read_failed = 1

OTHERS = 2.

IF sy-subrc is initial.

*2o. If status is 'started', replace WI.

IF wi_wlc_header-wi_stat = 'STARTED'.

CALL FUNCTION 'SWL_WI_REPLACE'

EXPORTING

wi_id = swwwihead-wi_id

  • DELETE_SWWORGTASK = ' '

  • CHANGING

  • WORKITEM =

EXCEPTIONS

replace_failed = 1

OTHERS = 2.

ENDIF.

ENDIF.

=====================

Please, if it works fine, mark points to me!!!

good luck.

Message was edited by:

Glauco Kubrusly

Message was edited by:

Glauco Kubrusly

morten_nielsen
Active Contributor
0 Kudos

Hi Andreas

My Main area isn't ABAP - but I think you can call the functuion module in "Update Mode" - it needs to be flagged as an update FM - but perhaps you could wrap one of the FM's you mentioned in your own FM

Regards

Morten Nielsen