on 06-12-2017 10:45 AM
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
Here is a snap shot of how to do..
first of all make sure your work item is correct.. to be sure about work item, go in to swi1 and pick the ID whose work item type is dialog step. (SWI1 screen shote )
go to Se37
type the FM SAP_WAPI_FORWARD_WORKITEM
in User ID table fill it as below
and execute.
Results in Message lines:
Enjoy!
I think now you know very well how to write the same in the code
Anand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please check the workitem status , is it in Ready status or not.
Return code 2 means, its can not be forwarded
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramya,
PFB the description for the return codes. You can read the table message_lines to get info about the workitem.
2 Work item cannot be forwarded.
3 No agents for forwarding specified during call
900 System error: method must not be used in the current context
999 An unknown error occurred.
Alternatively you can use the FM "SAP_WAPI_AGENTS_CHANGE".It also forwards the work item .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.