on 09-17-2014 9:32 AM
Hi Experts,
Is there any RFC/ FM to approve or reject the work flow?
I am using SAP_WAPI_DECISION_COMPLETE, with following inputs:
WORKITEM_ID <000000665113>
LANGUAGE = EN
USER = <user id>
DECISION_Key = 0001
DO_COMMIT= X
It gives:
return code = 2
message line: M = E, line = Work item 000000665113 is not a user decision
Message structure
MSGID M MSG MSGV1
SWR E 205 000000665113
Where am I going wrong? Need help.
It shows ready status after execution at SWIA.
Is there an alternative?
Thanks,
Ritu
Hi Ritu
the workitem you are trying to end is not of type USER DECISION. It may be a workitem of type dialog. See how it actually ends in the workflow...by way of terminating events? or the users just open it and close and then it completes?
You can try using SAP_WAPI_WORKITEM_COMPLETE ... but after knowing fully how the WI is handled in the actual WF.
regards,
Modak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ritu
It would be a bit tricky as both types are 'W' - dialog WI. This is how you can decide which FM to call:
Call a method to get the Header of the work item:
CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
EXPORTING
im_wiid = <<Your Work Item ID>>
RECEIVING
re_instance = lv_wi_handle.
Where lv_wi_handle is defined as lv_wi_handle TYPE REF TO if_swf_run_wim_internal
Then call method to get Node details based on header:
MOVE-CORRESPONDING lv_wi_handle->m_sww_wihead TO ls_swwwihead.
(ls_swwwihead is defined as ls_swwwihead TYPE swwwihead)
CALL METHOD cl_swf_run_workitem_compatible=>get_def_guid_structure
EXPORTING
im_header = ls_swwwihead
IMPORTING
ex_nodetype = l_nodetype.
where l_nodetype. is defined as : l_nodetype TYPE swd_nodetp.
IF l_nodetype <> 'D', call FM SAP_WAPI_WORKITEM_COMPLETE else call FM SAP_WAPI_DECISION_COMPLETE
Regards,
Modak
Hi Ritu
Call FM SAP_WAPI_GET_WORKITEM_DETAIL, the export parameter WORKITEM_DETAIL-TOP_WI_ID will give you the work item ID of the parent. If you do not have sub-workflows within the main WF, you will just need to call it once. But if you are using sub workflows and your step is inside the Sub-WF, then call it first to get the Sub WF ID, then Use the sub WF ID and call it again to get the MAIN WF Id ....
And if you want the details on the main Workflow, use the TOP_WI_ID and then call SAP_WAPI_GET_WORKITEM_DETAIL again to get the details of the main WF.
Regards,
Modak
Good to see that you are learning ... however do keep the SCN Rules Of Engagement in mind ( http://scn.sap.com/docs/DOC-18590 ) . Ask only one question in one thread.
Also, your question are not very specific for SRM and hence the right place to post such questions are on the forum SAP Business Workflow http://scn.sap.com/community/bpm/business-workflow
Post your question on this (current) forum only when you need SRM specific advise for workflows.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.