on 2011 Jan 06 5:15 AM
Hi All
Our requirement is to have cost centre based approval using BRF.
We will be getting the Approval chain from ECC using an RFC call.
If ECC returns an Approver depending on the approval limit, all other people in the chain below him should get a review work item.
1) Our requirement is to combine the items belonging to same cost center together and send a single work item to the approver. I checked the sample code provided in thread:
It talks about using 2 methods:
METHOD /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS
METHOD /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUID.
However I checked in other threads that I need to use the method Get_AREA_TO_ITEM_MAP. Is it not required when using the above two methods?
2) Can I add my code directly inside the class /SAPSRM/CL_WF_AREA_COST_CTR or copy it into a new one??
Why is this BADI /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS not available in SPRO under Process controlled WF?
3) Since my requirement is also to assign reviewers as well as approvers to decision sets based on cost centre using the same ECC function module, could I do it in one RFC call?
For e.g. I am already making the RFC call from within the Method /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS for getting approvers.
Could I call the BADI SAPSRM/IF_EX_WF_REVIEWER_RULE :- Method :- GET_REVIEWER_BY_DOCUMENT & set the reviewers also from here.
If not I need to implement the whole logic of grouping by cost centres etc in the reviewer BADI & make 2 RFC calls to ECC
Thanks
Kedar
Request clarification before answering.
Hi,
if ECC returns an Approver depending on the approval limit, all other people in the chain below him should get a review work item.
you can simply create custom enhancement implementation for Badi '/SAPSRM/BD_WF_REVIEWER_RULE/SAPSRM/IF_EX_WF_REVIEWER_RULEGET_REVIEWER_BY_DOCUMENT', which will be implemented separately.
1) Our requirement is to combine the items belonging to same cost center together and send a single work item to the approver. I checked the sample code provided in thread:
It talks about using 2 methods:
METHOD /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS ( NO NEED )
METHOD /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUID.
YOU DON'T NEED TO USE THE BELOW METHOD , YOU CAN DIRECTLY CALLED THE LEADING VALUE BY WRITING THE BELOW CODE IN THE GET_APPROVERS_BY_AREA_GUID
data lv_cost_center type KOSTL.
DATA lo_area TYPE REF TO /sapsrm/if_wf_area.
Input checks
ASSERT ID /sapsrm/wf_cfg CONDITION ( NOT is_area IS INITIAL ).
IF is_area IS INITIAL.
RETURN.
ENDIF.
Get responsibility area reference for given area GUID
lo_area = /sapsrm/cl_wf_area=>/sapsrm/if_wf_area~get_instance_by_guid(
iv_area_type = /sapsrm/if_wf_process_c=>gc_area_type_purch_grp
iv_area_guid = is_area-area_guid
lv_cost_center = lo_area->/sapsrm/if_wf_area~get_leading_object_id( ).
However I checked in other threads that I need to use the method Get_AREA_TO_ITEM_MAP. Is it not required when using the above two methods?
2) Can I add my code directly inside the class /SAPSRM/CL_WF_AREA_COST_CTR or copy it into a new one??
Why is this BADI /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS not available in SPRO under Process controlled WF?
3) Since my requirement is also to assign reviewers as well as approvers to decision sets based on cost centre using the same ECC function module, could I do it in one RFC call?
For e.g. I am already making the RFC call from within the Method /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS for getting approvers.
Could I call the BADI SAPSRM/IF_EX_WF_REVIEWER_RULE :- Method :- GET_REVIEWER_BY_DOCUMENT & set the reviewers also from here.
If not I need to implement the whole logic of grouping by cost centers etc in the reviewer BADI & make 2 RFC calls to ECC..
you can't write logic to grouping by cost centers in the reviewer BADI., becuse Reviewer BADI is used determine the reviewer's only, even if you write the Logic which will not be help. You don't need 2 RFC calls, you can simply write a RFC which has to have option to get Reviewers and Cost center owners and use the same FM in both places..
Regards,
Saravanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a Lot Sarvanan.
I still have some questions.
1) I have one ECC function module which returns me the approver as well as the reviewers ( table).After your suggestions, I am calling this FM from within the function GET_APPROVERS_BY_AREA_GUID.
At the same time when I am calling ECC from here, can I pass the set of reviewers to the function GET_REVIEWER_BY_DOCUMENT using only one call?
If not , I will have to write separate code in the GET_REVIEWER_BY_DOCUMENT method and call the ECC FM again.
Regards
Kedar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.