Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Feb 01, 2009 at 03:38 PM

    Hi

    You can try using FM 'BBP_PDH_WFL_APPROVAL_SIMULATE'.

    Regards,

    Sanjeev

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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!

  • avatar image
    Former Member
    Feb 03, 2009 at 04:12 PM

    Managed to solve this using global memory

    Add comment
    10|10000 characters needed characters exceeded