BAPI_INCOMINGINVOICE_PARK
时间: 2023-11-20 22:07:58 浏览: 193
根据提供的引用内容,可以了解到BAPI_INCOMINGINVOICE_CREATE1是一个用于创建进货发票的标准BAPI。而BAPI_INCOMINGINVOICE_PARK是一个用于将进货发票暂存的标准BAPI。下面是一个简单的示例代码,演示如何使用BAPI_INCOMINGINVOICE_PARK:
```ABAP
DATA: lt_invoice_header TYPE STANDARD TABLE OF bapivbrk,
lt_invoice_item TYPE STANDARD TABLE OF bapivbrp,
ls_invoice_header LIKE LINE OF lt_invoice_header,
ls_invoice_item LIKE LINE OF lt_invoice_item,
ls_return LIKE bapiret2.
* 填充进货发票头信息
ls_invoice_header-companycode = '1000'.
ls_invoice_header-docdate = '20220101'.
ls_invoice_header-pstngdate = '20220101'.
ls_invoice_header-duedate = '20220131'.
ls_invoice_header-vendor = '10000001'.
APPEND ls_invoice_header TO lt_invoice_header.
* 填充进货发票行项目信息
ls_invoice_item-material = 'MATERIAL001'.
ls_invoice_item-quantity = 10.
ls_invoice_item-netvalue = 1000.
APPEND ls_invoice_item TO lt_invoice_item.
* 调用BAPI_INCOMINGINVOICE_PARK
CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
EXPORTING
headerdata = ls_invoice_header
TABLES
itemdata = lt_invoice_item
return = lt_return.
* 检查返回结果
IF lt_return IS NOT INITIAL.
LOOP AT lt_return INTO ls_return.
WRITE: / ls_return-type, ls_return-id, ls_return-number, ls_return-message.
ENDLOOP.
ENDIF.
```
上述代码中,我们首先定义了进货发票的头信息和行项目信息,并将其填充到对应的表中。然后,我们调用了BAPI_INCOMINGINVOICE_PARK,并将进货发票的头信息作为EXPORTING参数传递给该BAPI,将进货发票的行项目信息作为TABLES参数传递给该BAPI。最后,我们检查了返回结果,如果有错误信息,则将其输出。
阅读全文