BAPI取消采购申请审批
* Program Name : ZGER_BAPI_1 *
* describe: *
* Created by : *
* Created on : *
* *
*------------------------------------------------------------*
REPORT zger_bapi_1.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE TEXT-001.
PARAMETERS: p_banfn TYPE banfn, "采购凭证号
p_frgco TYPE frgco. "代码
SELECTION-SCREEN END OF BLOCK blk1.
CALL FUNCTION 'BAPI_PO_RELEASE'
EXPORTING
purchaseorder = p_banfn
po_rel_code = p_frgco
use_exceptions = 'X'
* NO_COMMIT = ' '
* IMPORTING
* REL_STATUS_NEW =
* REL_INDICATOR_NEW =
* RET_CODE =
* TABLES
* RETURN =
EXCEPTIONS
authority_check_fail = 1
document_not_found = 2
enqueue_fail = 3
prerequisite_fail = 4
release_already_posted = 5
responsibility_fail = 6
OTHERS = 7.
IF sy-subrc <> 0.
* Implement suitable error handling here
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
WRITE: '取消审批成功' .
ENDIF.