BAPI_INCOMINGINVOICE_CANCEL
时间: 2023-12-17 22:05:12 浏览: 189
如何利用BAPI_SALESORDER_CHANGE修改vbak增强字段
BAPI_INCOMINGINVOICE_CANCEL是一个SAP函数模块,用于取消已经过账的进货发票。该函数模块需要传入以下参数:
- INVOICE_DOC_NUMBER:发票号码
- FISCAL_YEAR:会计年度
- COMPANYCODE:公司代码
以下是一个使用BAPI_INCOMINGINVOICE_CANCEL取消进货发票的例子:
```abap
DATA: ls_invoice_cancel TYPE bapi_acc_invoice_cancel,
lt_return TYPE TABLE OF bapiret2.
ls_invoice_cancel-invoice_doc_number = '123456'.
ls_invoice_cancel-fiscal_year = '2021'.
ls_invoice_cancel-companycode = '1000'.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CANCEL'
EXPORTING
invoice_header = ls_invoice_cancel
TABLES
return = lt_return.
IF sy-subrc = 0.
WRITE: 'Invoice cancelled successfully.'.
ELSE.
WRITE: 'Error cancelling invoice:', lt_return.
ENDIF.
```
阅读全文