写一段abap代码:调用bapi实现采购订单的创建
时间: 2024-06-01 14:11:26 浏览: 167
销售订单创建BAPI批导程序源码.txt
这里是一段ABAP代码,用于调用BAPI实现采购订单的创建。
DATA: it_poitems TYPE STANDARD TABLE OF bapimepoitem,
wa_poitem TYPE bapimepoitem,
it_return TYPE STANDARD TABLE OF bapiret2,
wa_return TYPE bapiret2.
wa_poitem-matnr = 'MATERIAL NUMBER'.
wa_poitem-plant = 'PLANT'.
wa_poitem-quantity = 'QUANTITY'.
APPEND wa_poitem TO it_poitems.
CALL FUNCTION 'BAPI_PO_CREATE'
EXPORTING
purchaseorderheader = wa_poheader
TABLES
purchaseorderitem = it_poitems
return = it_return.
LOOP AT it_return INTO wa_return.
WRITE: / wa_return-type, wa_return-id, wa_return-number, wa_return-message.
ENDLOOP.
阅读全文