cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the ad-hoc approver when release SRM contract?

Former Member
0 Kudos

Hi,

I would like to check whether the contract document has any ad-hoc approver added when user checks or saves the contract.

Currently, I m using the below codes to retrieve the ad-hoc approver.

CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
      EXPORTING
        workitem_id      = lv_wiid
          TABLES
        simple_container = lt_simple_cont

    LOOP AT lt_simple_cont INTO ls_simple_cont.

       *   Ad-hoc approver has been assigned
      IF ls_simple_cont-element = 'AGENT_0001'.
        EXIT.
      ELSE.
        *  No approver has been assigned
        *  Display Error message

But, I still got he Error message even after I added an Ad-hoc Approver to the contract and clicked at the Check button.

What's wrong with my codes? Appreciate helps! Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Managed to solve this using global memory

former_member206968
Active Contributor
0 Kudos

Hi

You can try using FM 'BBP_PDH_WFL_APPROVAL_SIMULATE'.

Regards,

Sanjeev

Former Member
0 Kudos

Hi,

I tried BBP_PDH_WFL_APPROVAL_SIMULATE and BBP_PDH_WFL_APPROVER_GET to get the selected ad-hoc approvers before saving the document but I can't get them to return me any agents when I clicked at the Release or Check button.

These FM will only return the approver after the Contract Document has been saved. However I need to check the approver added by the user before save.

I can't work out how to get the current selected approvers.

Does anyone have any ideas how to get this to work?

Any help would be appreciated,

Thanks!