on 01-28-2014 3:23 AM
Hi SRM experts,
I have a requirement to approve n-step process control workflow manually in SRM 7.0.
Suppose if there is 5 steps, the first step should manually complete based on the work item id and rigger next level for approval.
The function module SAP_WAPI_WORKITEM_COMPLETE allows to approve only for single step approval. So it doesn’t really help.
Can you please suggest any FM/Class method/or any other method to complete the N-approval?
Thank you
Magesh.
Hi Magesh,
try the class /SAPSRM/CL_WF_PROCESS_MANAGER
Regards
Konstantin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Konstantin,
Thank you for the suggestions.
I was using different methods of the class /SAPSRM/CL_WF_PROCESS_MANAGER, But did not really helped me to resolve the issue. The workitems are not approve/complete/reject.
It would be great if you could suggest any other methods available.
I was trying to debug the webdynpro application and unable point out exact place.
Thank you
Magesh
Hi Konstantin,
thank you for the update again.
My requirement is also the same, I need to approve the first workflow step and open/trigger the next in N-step approval process. But I could not even to complete the first step. Do you have any idea which method used to complete the workitem and trigger next?
Since we are working for mobile approval, the process is when I receives the approval request from mobile i need to manually complete the workitem. if it is n-step, i need to complete the first one and triggers the next step.
Regards,
Magesh
Hi Magesh,
why don't just simulate it via SC object.
something like...
lo_sc = /sapsrm/cl_pdo_factory_sc_adv=>get_instance(
iv_header_guid = <<document_guid>>
iv_mode = /sapsrm/if_pdo_constants_gen_c=>gc_mode_approval
IV_WIID = <<workitem number>>
IV_USER_ID = <<approver>>
IV_USER_LANGUAGE = <<language>>
).
and then
lo_sc->/SAPSRM/IF_PDO_ADV_BASE~APPROVE( )
Regards
Konstantin
Hi Konstantin,
The SC manual N-step approval is working as you suggested.
I am now facing issue to approve change PO which goes for N-step approval.
data lo_sc type REF TO /sapsrm/if_pdo_bo_po_adv.
lo_sc = /sapsrm/cl_pdo_factory_po_adv=>get_instance(
iv_header_guid = iv_document_guid
IV_PROCESS_TYPE = 'PO' also used 'ECPO'
iv_mode = /sapsrm/if_pdo_constants_gen_c=>GC_MODE_APPROVAL
IV_WIID = iv_workflow_id
IV_USER_ID = iv_processing_user
).
when I debug above method,inside(below code) it is not creating any instance and always initial
CALL METHOD /sapsrm/cl_pdo_bo_po_adv=>get_po_adv_instance
Do you see any issue with this code ? is there any other method can we achieve this functionality?
Can you kind suggest your thoughts.
Thank you
Magesh
Hi Konstantin,
It will execute below method and always rejected.
"------ Test if the requested adv mode can be established.
/sapsrm/cl_pdo_adv_service=>evaluate_adv_mode(
EXPORTING
iv_requested_mode = mo_apf_context->mv_adv_mode
IMPORTING
ev_result = lv_result
CHANGING
co_apf_context = mo_apf_context
).
(IF co_apf_context->mv_workitem_type IS INITIAL.
* IF co_apf_context->mv_user_is_document_owner EQ abap_true.
" Doc owner with ADJUST work item:
" Doc owner may recall document from POWL if the document is in approval phase.
" Doc owner may not recall document from POWL if the document is in completion phase
" (but he is allowed to operate on the EDIT instance).
" Doc owner may operate on EDIT instance from UWL if document is in completion phase.
" Doc owner may not modify instance from UWL if document is in approval phase.
lt_edit_wis = get_wis_for_edit( co_apf_context->mt_workitems ).
IF lines( lt_edit_wis ) EQ 0.
IF co_apf_context->mv_apf_version EQ /sapsrm/if_wf_process_c=>GC_APF_VERSION_0200.
" In V20 a document may only be recalled if no REVISE work item exists
lo_apf_context_v20 ?= co_apf_context.
IF lo_apf_context_v20->ms_interaction_workitem-workitem_type EQ /sapsrm/if_wf_process_c=>gc_workitem_type_revise.
lv_result = GC_MODE_REJECTED.
ELSE.
lv_result = GC_RECALL_REQUIRED.
ENDIF.
ENDIF.)
Thank you
Magesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.