Skip to Content

Issue Permit with BAPI_ALM_ORDER_MAINTAIN (or other)?

Hi,

I am trying to issue an existing permit of a PM Order programatically (manual equivalent: IW32). The FM BAPI_ALM_ORDER_MAINTAIN has a parameter IT_PERMIT_ISSUE, but also a statement in documentation: "Permits cannot be processed". Did anyone succeed in issuing a permit? If not by this BAPI, is there another way? If yes, preferably share an example.

Thanks!

KR,

Igor

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 11, 2016 at 10:54 PM

    Hello Igor

    Yes the Issueing of Permits should work via the BAPI "BAPI_ALM_ORDER_MAINTAIN" ...

    See the following Sample-code :

    CLEAR ls_method.
    MOVE '1' TO ls_method-refnumber.
    MOVE 'PERMIT_ISSUE' TO ls_method-objecttype.
    MOVE 'CREATE' TO ls_method-method.
    MOVE <order_id> TO ls_method-objectkey.
    APPEND ls_method TO lt_methods.
    
    CLEAR ls_permit_issue.
    ls_permit_issue-permit    = <permit_id>
    ls_permit_issue-issued_by = <username>.
    APPEND ls_permit_issue TO lt_permit_issue.
    
    CLEAR ls_method.
    ls_method-refnumber  = '1'.
    ls_method-method     = 'SAVE'.
    APPEND ls_method TO lt_methods.
    
    CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
    *  DESTINATION 'NONE'
       TABLES
          it_methods      = lt_methods
          return          = lt_return
          it_permit_issue = lt_permit_issue.

    This sample only has the 'essentials' but this should work ... Followed by Check ReturnParams and Commit or Rollback ofcourse ...

    Add comment
    10|10000 characters needed characters exceeded