1 * Program Name : ZGER_1910LK_030603 *
2 * describe: *
3 * Created by : *
4 * Created on : *
5 * *
6 *------------------------------------------------------------*
7 REPORT zger_1910lk_030603.
8 *--------------------------------------------------------------------*
9 *屏幕
10 *--------------------------------------------------------------------*
11 SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE TEXT-001.
12 PARAMETERS:p_ebeln TYPE eban-ebeln, "采购申请对应的,采购凭证号。
13 p_frgco TYPE t16fc-frgco. "审批级别。
14 SELECTION-SCREEN END OF BLOCK blk1.
15 *--------------------------------------------------------------------*
16 *BAPI函数
17 *--------------------------------------------------------------------*
18 CALL FUNCTION 'BAPI_PO_RELEASE'
19 EXPORTING
20 purchaseorder = p_ebeln "采购凭证号。
21 po_rel_code = p_frgco "审批级别。
22 use_exceptions = 'X'
23 no_commit = ''
24 * IMPORTING
25 * REL_STATUS_NEW =
26 * REL_INDICATOR_NEW =
27 * RET_CODE =
28 * TABLES
29 * RETURN =
30 EXCEPTIONS
31 authority_check_fail = 1
32 document_not_found = 2
33 enqueue_fail = 3
34 prerequisite_fail = 4
35 release_already_posted = 5
36 responsibility_fail = 6
37 no_release_already = 7
38 no_new_release_indicator = 8
39 OTHERS = 9.
40
41 IF sy-subrc <> 0.
42 * Implement suitable error handling here
43 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
44 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
45 STOP.
46 ELSE.
47 WRITE: '取消审批成功' .
48 ENDIF.