Skip to Content
Product Information
Author's profile photo Dinesh D

Procurement: BAdi for Agent Determination in Flexible Workflows

Use

Using this BAdi, customers can decide the approval agents for the work item in My Inbox app for different purchasing documents.

Implementation details

App: Custom Fields and Logic

BAdi: Procurement: Agent Determination in Flexible Workflow (MM_WORKFLOW_AGENTS_V2)

Filter Criteria

This BAdi has the following filter parameters:

  • businessobject = PurchaseOrder
  • businessobject = PurchaseRequisition
  • businessobject = CentralPurchaseRequisition
  • businessobject = PurchaseContract
  • businessobject = SchedulingAgreement
  • businessobject = RequestForQuotation
  • businessobject = SupplierQuotation
  • businessobject = CentralPurchaseContract
  • businessobject = ServiceEntrySheet

Note: Only one BAdi implementation can exist per business object

Importing Parameters:

  • BUSINESSOBJECT

    • This parameter provides the business object name (like PurchaseOrder, PurchaseRequisition or SupplierQuotation, etc.)
    • Possible values are listed in the filter criteria
  • PURCHASINGDOCUMENT

    • This parameter provides the purchasing document number
  • PURCHASINGDOCUMENTITEM

    • This parameter provides the item number of purchasing document
  • WORKFLOWSCENARIO

    • This parameter provides the information about which workflow scenario is used, as there can be several scenarios for the same business object
  • PREVIOUSAPPROVERLIST

    • This parameter provides the approvers of the previous approval steps. This may be required to determine the approvers in the current approval workflow step.

Exporting Parameters:

  • APPROVERLIST

    • This parameter contains the approvers of the current approval level
    • This parameter cannot be returned empty. If it is returned empty, then this would result in workflow error

Note:

  • Like any other workflow step, if approval agents are not determined inside the BAdi implementation the work item will result in error.
  • The workflow step information is not available in this BAdi

Sample Implementation:

Requirement: Work item needs to be approved based on the net amount of the purchase requisition item as described below:

  1. Amount less than or equal to 10000 needs to be approved by the user “Manager”
  2. Net Amount in between 10000 and 20000 needs to be approved by user “Procurement Manager”
  3. Net Amount greater than 20000 needs to be approved by user “Purchasing Manager”

The above requirements are satisfied by the BAdi implementation given below:

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Mithun Kumar
      Mithun Kumar

      The correct BAdI name is MMPUR_WORKFLOW_AGENTS_V2, I suppose.

      Author's profile photo Saurabh Chikate
      Saurabh Chikate

      Hello Dinesh,

      Thanks for the sample code!

      Best Regards,

      Saurabh Chikate