on 2012 Jun 22 9:51 AM
Hi Team
we are in SRM7.1 & using application controlled workflow .
In the shopping cart using Display/Edit agents link we are able to change the additional approver/New approver.
The problem is system does not check the approval limits of the approver
do we need to validate the approval limits through DOC_CHECK BADI?
please lets us know your thoughts
Thanks
Madhav
Request clarification before answering.
Hello Madhav,
If you are adding Ad-hoc approver then why do you need to check the Approval authority? As i understood you already have N-Step BADI workflow implemented where you must be checking the dollar amount authority and workflow derived from that hierarchy. Thus, SAP do not check dollar amount of that add ad-hoc approver.
How ever if business would like to check whether person they are adding is actually approver or not then you can utilize BBP_DOC_CHECK_BADI to validate whether approver have the correct authority or not. You have to use multiple Function modules first BBP_PDH_WFL_APPROVAL_SIMULATE which will give you workflow ID, from there BBP_WFL_DIN_APPR_CONTAINER_GET function module to get the list of approver and then once you find approver then validate their approval limit by checking person attribute with BBP_READ_ATTRIBUTES with following;
READ TABLE i_attr_tab WITH KEY attr_id = 'SPEND_LIM' INTO r_attr.
IF sy-subrc = 0.
READ TABLE r_attr-vlist INDEX 1 INTO r_attr_app_lim.
IF sy-subrc = 0.
FIELD-SYMBOLS <spending_limit> LIKE r_aplimit.
ASSIGN r_attr_app_lim-value TO <spending_limit> CASTING.
r_splimit = <spending_limit>.
v_limit = r_splimit-spending_limit.
ENDIF.
Hope this helps.
Thank you
Ritesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ritesh
Thanks for your reply
We have planned to validate the approver using CHECK_BADI .Currently we are not able to get the approver ID in the run time using the BBP_PDH_WFL_APPROVAL_SIMULATE & BBP_WFL_DIN_APPR_CONTAINER_GET.
Can you please let us know how to get the approver ID in runtime? any other function modules we need to use before the above mentioned function modules
Thanks in advance
Thanks & Regards
Madhav
Hi Madhav,
Please try using FM BBP_WFL_DIN_APPR_FINALLIST_GET in Doc Check BADI. This function module return value run-time, by passing shopping cart number its guid and object type it should return value in table LT_APPROVAL_BUFDB_AGENTS[] with all the workflow agents. In this table TYPE which is 1 character you should able to identify the Inserted agent with "I" and then run the attribute check on that.
Hope this helps.
Thank you
Ritesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.