SAP Knowledge Base Article - Public

2633130 - BADI - Workflow Agent determination MM_WORKFLOW_AGENTS_V2


You want to use the BADI  'Workflow Agent determination' (MM_WORKFLOW_AGENTS_V2 ) and you need  a sample code.


S4HC 1802

The previous BADI  "BADI workflow agents" MM_WORKFLOW_AGENTS is obsolete. Please do not use the same.

Reproducing the Issue

In S4HC 1802 you want to use the BADI - 'Workflow Agent determination' (MM_WORKFLOW_AGENTS_V2 ).

In this release there isn´t a sample code in the Custom Logic App.

See below the parameters and a sample code for this release.

From the release 1805 the sample code will be included in the App and  a new import parameter will be added :

PreviousApproverList (This parameter provides the approvers of the previous approval steps)


Parameters used in the BADI:

businessobject -->

Business object type for header - BUS2105001

Business object type for item - BUS2009001

purchasingdocument --> Document number ( PR Number )

purchasingdocuemntitem --> Document Item number ( PR Item number)

Worflow Scenario -->

Header - WS00800157

Item - WS00800173


Sample BADI implementation:



  ls_badi_approver     TYPE if_mmpur_workflow_agents_v2=>bd_mmpur_s_badi_approver,

  lt_badi_approver     TYPE if_mmpur_workflow_agents_v2=>bd_mmpur_t_badi_approver,

  ls_new_approver      TYPE if_mmpur_workflow_agents_v2=>bd_mmpur_s_badi_approver.


DATA: lv_costcenter    TYPE string.


** define the list of BADI approvers

**  -----  Approval Level 1

SELECT SINGLE costcenter FROM i_purreqnacctassgmt_api01 INTO @data(lv_purchasereqcostcenter)

    WHERE purchaserequisition = @purchasingdocument.


If lv_purchasereqcostcenter EQ 17101201.

    APPEND 'CB9980002321' TO approverlist.




KBA , MM-FIO-PUR-REL , Fiori UI for Purchasing Approval , Problem


SAP S/4HANA Cloud 1802