cancel
Showing results for 
Search instead for 
Did you mean: 

How to have CC in /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUI

former_member578547
Participant
0 Kudos

Hi Friends,

My process controlled is triggering when i specify User name and User type(US) in Method : /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUI of Custom implementation in which code is written like below.

WA_rt_approver-APPROVER_OT = 'US'.

WA_rt_approver-APPROVER_ID = 'BTHUNUGUNTU'. (User name)

APPEND WA_RT_APPROVER TO RT_APPROVER.

But , for my requirement, i need to fetch this User name, dynamically from Ztable which is having Costcenter. How to obtain cost center from this method : GET_APPROVERS_BY_AREA_GUI so that i can fetch data from Z table.

Infact, this method have only import value : IS_AREA , but not document id. How to obtain document id from IS_AREA.

Please help me .

Balaji.T.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The "iv_leading_object_id" of the method GET_AREA_TO_ITEM_MAP will have the cost center.

implement the below codes into method GET_APPROVERS_BY_AREA_GUID

DATA LEADING_OBJECT_ID type /SAPSRM/WF_LEADING_OBJECT_ID.

*----


  • 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_cost_ctr

iv_area_guid = is_area-area_guid

).

*----


  • Get Plant ID

*----


LEADING_OBJECT_ID = lo_area->GET_LEADING_OBJECT_ID( ).

Now LEADING_OBJECT_ID will have the cost center which you can use to find the corresponding approver's...

Saravanan

former_member578547
Participant
0 Kudos

Hi Saravanan,

I implemented this below code as you said in Get_approver_by_area_gui.

DATA LEADING_OBJECT_ID type /SAPSRM/WF_LEADING_OBJECT_ID.

DATA lo_area TYPE REF TO /sapsrm/if_wf_area.

*----


  • 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_cost_ctr

iv_area_guid = is_area-area_guid

).

*----


  • Get Plant ID

*----


LEADING_OBJECT_ID = lo_area->GET_LEADING_OBJECT_ID( ).

it is not giving any Leading_object_id.

Let me know what should i do Please..

Balaji.T.

Former Member
0 Kudos

Hi ,

Do you pass the cost center value to iv_leading_object_id in method 'GET_AREA_TO_ITEM_MAP.' please refer /SAPSRM/BD_WF_AGENTS_SC -


> /SAPSRM/BD_WF_SC_RR_PGRP to get more details. Please let us know if you need more information..

Saravanan.

former_member578547
Participant
0 Kudos

Hi saravanan,

Thank you for your inputs. I am able to solve the problem after seeing that.

Thank you .

Balaji..T.