cancel
Showing results for 
Search instead for 
Did you mean: 

Issue Permit with BAPI_ALM_ORDER_MAINTAIN (or other)?

former_member185943
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

NTeunckens
Active Contributor

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 ...

former_member185943
Participant
0 Kudos

Hi, Nick,

It works - perfect!

Thanks!

Igor

NTeunckens
Active Contributor
0 Kudos

Hello Igor

Please Close the Question when answered. Glad your problem is solved.

Regards

Nic T.

Answers (0)