SAP MM取消采购订单审批--- BAPI_PO_RESET_RELEASE
转自:http://blog.chinaunix.net/uid-15016030-id-12238.html
REPORT Z_RESET_RELEASE_PO.
SELECTION-SCREEN BEGIN OF BLOCK BLK1
WITH FRAME TITLE TEXT-001.
PARAMETERS:P_EBELN TYPE EBELN,
P_FRGCO TYPE FRGCO.
SELECTION-SCREEN END OF BLOCK BLK1.
CALL FUNCTION 'BAPI_PO_RESET_RELEASE'
EXPORTING
purchaseorder = P_EBELN
po_rel_code = P_FRGCO
USE_EXCEPTIONS = 'X'
* IMPORTING
* REL_STATUS_NEW =
* REL_INDICATOR_NEW =
* TABLES
* RETURN =
EXCEPTIONS
AUTHORITY_CHECK_FAIL = 1
DOCUMENT_NOT_FOUND = 2
ENQUEUE_FAIL = 3
PREREQUISITE_FAIL = 4
RELEASE_ALREADY_POSTED = 5
RESPONSIBILITY_FAIL = 6
NO_RELEASE_ALREADY = 7
NO_NEW_RELEASE_INDICATOR = 8
OTHERS = 9
.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE:'取消审批成功!'.
ENDIF.
微信号:JINYULIN_SH_