Skip to Content
-1
Jun 12, 2017 at 09:45 AM

Issue with SAP_WAPI_FORWARD_WORKITEM in sap workflow

591 Views

Hi Exprets,
I am using function module SAP_WAPI_FORWARD_WORKITEM to forward a work item from one user to another. I am getting return code as 2 . please let me know if I am missing any thing

SELECT wi_id wi_type wi_stat
FROM swwwihead
INTO TABLE i_wi_head
WHERE wi_id IN s_wi_id.

IF sy-subrc IS INITIAL.

v_oldus = p_oldus.
v_newus = p_newus.

* Forward the work item to the requred user
LOOP AT i_wi_head INTO w_wi_head.
CALL FUNCTION 'SAP_WAPI_FORWARD_WORKITEM'
EXPORTING
workitem_id = w_wi_head-wi_id
user_id = v_newus
language = sy-langu
do_commit = 'X'
current_user = v_oldus
IMPORTING
return_code = v_return
new_status = v_status.
v_oldus is the user id pf work item sender and v_newus is the id of the workitem receiver.
thanks,
rg