on ‎2011 Jun 03 10:25 PM
Hi,
We are in SRM7.0 , EC Scenario
In SAP SRM system am experiencing a workflow issue , second level approver is not able to approve/receive the workitem of a changed PO. Moment 1st approver approve it and when requester try to open the PO (changed version) and navigate to Approval tab, the approval flow is missing and showing the error as
PDO Layer Error
An Exception has occured
Every time we must restart the workflow due to which the approval needs to be done again from 1st approver.
We have raised an OSS Message and following is the response from SAP
" The second approver does not get a workitem because the workflow got the status error. The cause of this error is your BADI implementation ZCL_SRMWF_AGENT_PO_BUYER method
/SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_AREA_TO_ITEM_MAP. This method returns an initial table LT_AREA_TO_ITEM_MAP.
Run method CREATE_DECISION_SETS (/SAPSRM/CL_WF_PROCESS_MGR_SBWF) with
parameter IV_PROCESS_GUID = change version guid xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
When i executed this method CREATE_DECISION_SETS (/SAPSRM/CL_WF_PROCESS_MGR_SBWF) with
parameter IV_PROCESS_GUID = Changed version PO GUID , i got the following error
Exception CX_BO_ABORT triggered
Termination triggered in '' - Rollback required
Can anyone please help !!
Thanks & Regards,
Venkat
Request clarification before answering.
Hi,
It seems like your badi implementation Z*PO_Buyer is error out due to some reason.. Can you please share your code to identify the reason?
Kind Regards,
Saravanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarvanan,
Please find the code for the class ZCL_SRMWF_AGENT_PO_BUYER as follows
METHOD /sapsrm/if_ex_wf_resp_resolver~get_area_to_item_map.
DATA : ls_header TYPE bbp_pds_po_header_d,
lw_item TYPE bbp_pds_po_item_d,
lt_item TYPE TABLE OF bbp_pds_po_item_d,
lw_item_to_area_map TYPE /sapsrm/s_bd_wf_item_to_area,
lt_approver_item TYPE TABLE OF zgswf_item_buyer_map,
lw_approver_item TYPE zgswf_item_buyer_map.
*IS_CURRENT_PROCESS_LEVEL-RESOLVER_PARAM WILL CONTAIN THE ITEM GUID OF THE
*1ST ITEM AMONG THE GROUP OF ITEM HAVING SAME APPROVER
*DOCUMENT STORED FOR USE IN OTHER METHODS
me->doc_guid = is_document-document_guid.
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
i_guid = is_document-document_guid
i_without_header_totals = ' '
i_read_from_archive = 'X'
IMPORTING
e_header = ls_header
TABLES
e_item = lt_item.
DELETE lt_item WHERE del_ind = 'X'.
*GET ALL BUYERS OF ALL LINE ITEMS OF A PO
CALL METHOD zcl_srmwf_prc_conf_buyer_po=>get_buyer_approvers
EXPORTING
iv_doc_guid = is_document-document_guid
RECEIVING
rt_approver_item = lt_approver_item.
*GET THE APPROVER USING THE ITEM GUID
READ TABLE lt_approver_item INTO lw_approver_item
WITH KEY itm_guid = is_current_process_level-resolver_param.
CHECK sy-subrc = 0.
*FILL AREA GUID AS ITEM GUID OF 1ST ITEM AMONG GROUP OF ITEMS AND
*AND ITEM GUID AS ITEM GUID
lw_item_to_area_map-area_guid = lw_approver_item-itm_guid.
LOOP AT lt_item INTO lw_item
WHERE category_id = lw_approver_item-matkl.
lw_item_to_area_map-item_guid = lw_item-guid.
APPEND lw_item_to_area_map TO rt_item_to_area_map.
ENDLOOP.
ENDMETHOD.
Thanks in advance
Venkat
Hi Sarvanan,
We have defined the buyer logic in such a way that, buyer will be picked from the custom ztable in which product category and company code are checked and based on the amount mentioned over there, buyer will be added in the approval flow.
FYI, when we add a new line item below the clip amount maintained in the buyer table for the change version PO, and order it then buyer will not be added in the approval flow and account coder and cost center owner will be added in the approval.
In this case, the moment 1st approver approve the workitem then cost center owner is not receiving the workitem and when we check the approval flow follow error is being displayed
Strategy ZCOST_OBJECT didn't determine any approver
I believe the problem is in defining the 2nd level of approver. Could you please assist
Regards
Venkat
Hi,
It seems like AREA_GUID is not getting create for each buyer...
*GET ALL BUYERS OF ALL LINE ITEMS OF A PO
CALL METHOD zcl_srmwf_prc_conf_buyer_po=>get_buyer_approvers
EXPORTING
iv_doc_guid = is_document-document_guid
RECEIVING
rt_approver_item = lt_approver_item.
*GET THE APPROVER USING THE ITEM GUID
READ TABLE lt_approver_item INTO lw_approver_item
WITH KEY itm_guid = is_current_process_level-resolver_param.
CHECK sy-subrc = 0.
*FILL AREA GUID AS ITEM GUID OF 1ST ITEM AMONG GROUP OF ITEMS AND
*AND ITEM GUID AS ITEM GUID
lw_item_to_area_map-area_guid = lw_approver_item-itm_guid.
HERE YOU ARE PASSING THE ITEM_GUID INTO AREA_GUID WHICH YOU GOT FROM THIS METHOD 'zcl_srmwf_prc_conf_buyer_po=>get_buyer_approvers'.. CAN YOU PLEASE THIS METHOD CODE AS WELL.. YOU CAN REFER THE ENHANCEMENT IMPLEMENTATION /SAPSRM/BD_WF_AGENTS_PO WITH ANY OF THE BADI IMPLEMENTATION EXCEPT /SAPSRM/BD_WF_PO_RR_SL..
i think the same issue for Strategy ZCOST_OBJECT didn't determine any approver.. you can debug this issue through executing the class /SAPSRM/CL_WF_PDO_PO enter the PO change version guid id and execute the method HANDLE_PROCESS_FINISHED.. make sure you change the sy-uname into WF-BATCH WHILE YOU DEBUG THIS METHOD..
YOU CAN ALSO USE GET_FALLBACK_AGENTS METHOD TO ADD SRM ADMINISTRTOR AS APPROVER IF THE PROCESS LEVEL COULD NOT FIND THE APPROVER..
PLEASE LET ME KNOW IF YOU NEED MORE INFORMATION..
Kind Regards,
Saravanan
Hi Sarvanan,
I am a functional consultant and completely unaware of this technical stuff. Since this is SRM BRF workflows, none of our workflow consultants also are able to help me out on this issue. So, if possible could you please let me your contact number to so that i can contact you directly on this issue.
This is the issue which i am facing from last 7 months and none of the person is able to help me out. So, i kindly request you to please help me out on this issue.
As requested following is the code for the process level class
ZCL_SRMWF_PRC_CONF_BUYER_PO --> GET_BUYER_APPROVERS
METHOD get_buyer_approvers.
DATA : ls_header TYPE bbp_pds_po_header_d,
lt_item TYPE TABLE OF bbp_pds_po_item_d,
lw_item TYPE bbp_pds_po_item_d,
lt_buyer TYPE TABLE OF zgtm_buyer,
lw_buyer TYPE zgtm_buyer,
lt_limit TYPE TABLE OF bbp_pds_limit,
lw_approver_item TYPE zgswf_item_buyer_map,
lv_requester_mgr TYPE uname,
lv_requester TYPE uname,
lv_appr_reqd TYPE c.
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
i_guid = iv_doc_guid
IMPORTING
e_header = ls_header
TABLES
e_item = lt_item
e_limit = lt_limit.
DELETE lt_item WHERE del_ind = 'X'.
DELETE lt_limit WHERE del_ind = 'X'.
CHECK lt_item IS NOT INITIAL.
SELECT * FROM zgtm_buyer
INTO TABLE lt_buyer
FOR ALL ENTRIES IN lt_item
WHERE bukrs = ls_header-co_code
AND matkl = lt_item-category_id.
LOOP AT lt_item INTO lw_item.
*CHECK IF APPROVAL IS REQUIRED
CALL METHOD approval_level_required
EXPORTING
is_header = ls_header
is_item = lw_item
it_buyer = lt_buyer
it_limit = lt_limit
RECEIVING
rv_reqd_ind = lv_appr_reqd.
CHECK lv_appr_reqd IS NOT INITIAL.
*IF APPROVAL IS REQUIRED FIND THE BUYER
READ TABLE lt_buyer INTO lw_buyer
WITH KEY bukrs = ls_header-co_code
matkl = lw_item-category_id.
IF sy-subrc = 0.
lw_approver_item-owner = lw_buyer-bname.
ELSE.
CLEAR lw_approver_item-owner.
ENDIF.
lw_approver_item-itm_no = lw_item-number_int.
lw_approver_item-co_code = ls_header-co_code.
lw_approver_item-matkl = lw_item-category_id.
lw_approver_item-itm_guid = lw_item-guid.
APPEND lw_approver_item TO rt_approver_item.
CLEAR lw_approver_item.
ENDLOOP.
ENDMETHOD.
KINDLY HELP ME OUT AND DO LET ME KNOW IF ANYTHING NEEDED FURTHER FROM MY END.
THANKS IN ADVANCE,
VENKAT
Hi,
you have to change the code before statement 'lw_approver_item-itm_guid = lw_item-guid' in the ZCL_SRMWF_PRC_CONF_BUYER_PO --> GET_BUYER_APPROVERS
DATA lo_area TYPE REF TO /sapsrm/if_wf_area.
DATA ls_area_to_item_map TYPE /sapsrm/s_wf_item_to_area.
lo_area = /sapsrm/cl_wf_area=>/sapsrm/if_wf_area~create_instance(
iv_area_type = /sapsrm/if_wf_process_c=>gc_area_type_purch_grp
iv_leading_object_id = lw_item-category_id.
).
'lw_approver_item-itm_guid = lo_area->get_guid( ).
once you add the above code then remove this statement ''lw_approver_item-itm_guid'.. but keep in mind.. if you implement the above code.. if your SC has same category and CC then system generate each area guid for each item.. so discuss with your deleloper to use event with in the item loop to create the area guid only if there a change in product_id and CC...
and try.... you can reach me at saravanan.dharmarajatsealconsult.com
Saravanan..
Hi,
Can anyone please help on this problem ?
Many thanks in advance.
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.