Skip to Content
0

Issue Permit with BAPI_ALM_ORDER_MAINTAIN (or other)?

Nov 11, 2016 at 01:08 PM

200

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Nic Teunckens Nov 11, 2016 at 10:54 PM
2

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi, Nick,

It works - perfect!

Thanks!

Igor

0

Hello Igor

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

Regards

Nic T.

0