cancel
Showing results for 
Search instead for 
Did you mean: 

getting sc details in brf workflow

former_member305388
Active Contributor
0 Kudos

I am implementing a Costcenter based brf workflow and have copied /SAPSRM/CL_WF_AREA_COST_CTR to a Z object. I need to get the Shopping cart details in the /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS method. I was planning to use BBP_PD_SC_GETDETAIL FM to get the required details but which value from the method should I pass to get the I_GUID or I_OBJECT_ID for passing to the FM?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

What is your requirement ? you can pass the SC GUID in different way to GET_RESPONSIBLE_APPROVERS. but GET_RESPONSIBLE_APPROVERS is optional and this method is used to identify the approver by pass the leading_object_id from method GET_APPROVERS_BY_AREA_GUID.

Saravanan

former_member305388
Active Contributor
0 Kudos

Hi Saravanan,

The requirement is to have SC approval based on Cost Center.

The Approver details needs to be selected from ECC based on the gross price.

I have copied the following standard class and modified the methods given for the requirement.

Class: /SAPSRM/CL_IM_WF_RR_CCTR_SC, Method: GET_AREA_TO_ITEM_MAP

Class: /SAPSRM/CL_IM_WF_RR_CCTR_SC, Method: GET_APPROVERS_BY_AREA_GUID

Class: /SAPSRM/CL_WF_AREA_COST_CTR, Method: GET_RESPONSIBLE_APPROVERS

I want to do a rfc call in the GET_RESPONSIBLE_APPROVERS to get the approvers.

Do let me know your view.

Thanks

Former Member
0 Kudos

Hi,

You have to change the logic in the method GET_RESPONSIBLE_APPROVERS at line 22.. instead of calling the FM ''RH_STRUC_GET' call your RFC FM to get the CC approver from ECC.. ls_costcenter_id-sobid will hold the cost center value..

Saravanan

former_member305388
Active Contributor
0 Kudos

Hi Saravanan,

Is there any way I can get the SC details in GET_RESPONSIBLE_APPROVERS method as I need to send the amount also to the RFC FM in ECC.

Thanks

Former Member
0 Kudos

Hi,

The workaround to get the DOC_GUID into method GET_RESPONSIBLE_APPROVERS is, you can concatenate DOC_GUID with cost center to leading_object_id in the GET_AREA_TO_ITEM_MAP method and the split the cost center and DOC_GUID in the GET_RESPONSIBLE_APPROVERS, Hence you can get the current leading_object_id in the GET_RESPONSIBLE_APPROVERS method.

FYI -

As I replied my previous response, GET_RESPONSIBLE_APPROVERS is itself optional.. you can get the leading object details in the method GET_APPROVERS_BY_AREA_GUID. Here is the sample code..

DATA LV_LEADING_OBJ_ID TYPE STRING.

  • 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

).

WRITE THE BELOW CODE AFTER

LV_LEADING_OBJ_ID = LO_AREA->GET_LEADING_OBJEACT_ID().

Saravanan

Edited by: Saravanan Dharmaraj on Feb 10, 2011 1:40 PM

former_member305388
Active Contributor
0 Kudos

Thanks Saravanan.

One more question I am getting the user id from ecc, should i call any fm and convert this to agent id? as the rt_approvers has approver id with description " Identification (PD-Org. ID) of Approver"

Answers (2)

Answers (2)

former_member305388
Active Contributor
0 Kudos

Thanks Saravanan.

Got the user ip and person id mapping in usr21 table.

former_member305388
Active Contributor
0 Kudos

I am able to order the SC but when i try to check the SC details i get the following error

Object or set with GUID 00000000000000000000000000000000 does not exist.

what might be wrong?

Former Member
0 Kudos

Hi,

is this happened after concatenate doc_guid with costcenter in the workflow Badi?.. if yes.. check your code in the BADI..

Saravanan

former_member305388
Active Contributor
0 Kudos

Hi Saravanan,

I am getting the approvers in GET_APPROVERS_BY_AREA_GUID. method. So there is no concatenation logic involved.

Do let me know any pointers on the same. Thanks

EDIT: I deactivated the badi and changed back to the standard process level config as earlier, still when I try to view old shopping carts before this change I am getting the same error.

Edited by: Srinivas Kalluri on Feb 14, 2011 10:16 AM

Former Member
0 Kudos

Hi,

Better you re-do from beginning.. delete all the process configuration, and redo from beginning.

Saravanan

former_member305388
Active Contributor
0 Kudos

Hi Saravanan,

the approval and everything is working fine. The issue I mentioned is existing from earlier.

Thanks for the help

former_member305388
Active Contributor
0 Kudos

Saravanan is there any way to raise error if no approver is found in the GET_APPROVERS_BY_AREA_GUID method?

There are two exception handing methods /SAPSRM/CX_WF_ERROR and /SAPSRM/CX_WF_ABORT but I am not sure how to use them for raising custom error message.

former_member305388
Active Contributor
0 Kudos

I am trying to get the shopping cart instance to get the SC item details. any ponters as how to get the SC guid in this method is appreciated.

Thanks

Edited by: Srinivas Kalluri on Feb 8, 2011 5:09 PM

former_member305388
Active Contributor
0 Kudos

I am new to workflows any help on this is highly appreciated.