cancel
Showing results for 
Search instead for 
Did you mean: 

SRM 7.0 Shopping cart process schema determination

Former Member
0 Kudos

Hi,

We are using process controlled workflow and have a requirement to find either the cost centre manager or the WBS project manager dependent on the item A/C assignment. I created the BADIs to find the managers and can incorporate them in the process schema. However, I can not include both process levels in my process schema as one will fail and my testing shows the non relevant process level of the Approval status details for the selected item as processor 'system' agent determination 'SYSTEM'. Can anybody offer advice as how I can best implement a process schema that will include only the relevant level based on the account assignment in the item?

Regards

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

What is your BADI logic to get AREA_GUID?

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

The logic for the cost centre and WBS AREA_GUID is similar for both Agents as below example for the cost centre manager.

Also, could my problem actually be related to the fact that I am using evaluation id 0EV000 as you suggested with my last problem that you helped me. This worked and the process level executed but I believe this will always return result 'X'. Hence when I have an item that has a WBS account assignment the Cost centre process level will even though the agent is not found still return a result 'X'. I could be wrong but would appreciate your thoughts.

Regards

Kevin

-


*

  • (2) Get the cost-center assignment of each Shopping Cart item

  • - (only item leafs included) -

----


LOOP AT lt_item_guid REFERENCE INTO lr_item_guid WHERE leaf = abap_true.

ls_item_to_cctr_map-item_guid = lr_item_guid->guid.

TRY.

CALL METHOD lo_pdo_sc->/sapsrm/if_pdo_do_acct_assgmnt~get_account_assignment

EXPORTING

iv_parent = ls_item_to_cctr_map-item_guid

IMPORTING

et_account = lt_account.

SORT lt_account BY distr_perc.

LOOP AT lt_account REFERENCE INTO lr_account.

If not lr_account->cost_ctr is initial.

CONCATENATE lr_account->cost_ctr

lr_account->co_area

INTO ls_item_to_cctr_map-cost_ctr_id.

APPEND ls_item_to_cctr_map TO lt_item_to_cctr_map.

endif.

ENDLOOP.

CATCH /sapsrm/cx_pdo_abort INTO lx_pdo_ex.

RAISE EXCEPTION TYPE /sapsrm/cx_wf_abort EXPORTING previous = lx_pdo_ex.

ENDTRY.

ENDLOOP.

----


  • (3) Return document item - responsibility area assignment

----


  • The item list is sorted according to the characteristics of an

  • responsibility area (i.e. according to the cost center ID here)

SORT lt_item_to_cctr_map BY cost_ctr_id.

LOOP AT lt_item_to_cctr_map REFERENCE INTO lr_item_to_cctr_map.

AT NEW cost_ctr_id.

  • For each cost center a new responsibility area is created, which is

  • an instance of class ZGSR_CL_WF_AREA_COST_CTR; this instance can

  • later be retrieved by the cost center ID ("leading object ID") in

  • method GET_APPROVERS_BY_AREA_GUID to return the list of responsible

  • agents of this cost center

lo_area = /sapsrm/cl_wf_area=>/sapsrm/if_wf_area~create_instance(

iv_area_type = lc_area_type_cc

iv_leading_object_id = lr_item_to_cctr_map->cost_ctr_id

).

ls_area_to_item_map-area_guid = lo_area->get_guid( ).

ENDAT.

IF NOT ls_area_to_item_map-area_guid EQ /sapsrm/if_wf_process_c=>gc_nil_guid.

ls_area_to_item_map-item_guid = lr_item_to_cctr_map->item_guid.

APPEND ls_area_to_item_map TO rt_item_to_area_map.

ENDIF.

ENDLOOP.

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Your business rule is SC items should be approved by cost responsible owners.

So level evaluation should be always X and cost responsible owners should be found by BADI.

If no agent is found, the issues is in your GET_APPROVERS_BY_AREA_GUID method.

Please note return value of level evaluation is not agent determination result. It is business rule condition that the level is valid or not.

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

Thanks for the quick reply. My problem is not with the agents of the cost centre and WBS being found it is how to in corporate the levels in the process schema. That is, if I incorporate both levels in the same process schema, one for finding the cost centre manager and one for WBS manager, one will not be found dependent on the account assignment. I was hoping that the level where the agent is not found would not be included in the Approval status details for the selected item. What I am finding is the level is being shown as processor 'system' agent determination 'SYSTEM'. Can you help? is it possible to include both agent determinations in the same process schema or do I have to try to dynamically change the process levels dependent on the account assignment.

Regards

Kevin

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

How about implementing BADI handles both CC and WBS?

SC:

Item 1 CC1000

Item 2 WBS1234

Item 3 CC2000

Item 4 CC1000

Process Level definition:

Level 100, Evaluation 0EV000, Resolver Z_ACC_OWNER, Decision Type 4,

AGENT BADI:

Area CC1000 (Item 1 and Item 4)

Area WBS1234 (Item 2)

Area CC2000 (Item 3)

GET_APPROVERS_BY_AREA_GUID:

CC1000 -> Approver A

WBS1234 -> Approver B

CC2000 -> Approver C

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

Thanks once again for your quick reply. I was actually investigating what you suggest prior to receiving your reply and I guess if there is no other way then it is the approach I wil take.

Regards

Kevin

Answers (0)