DATA: lt_items TYPE STANDARD TABLE OF bapidlvreftosto,
lt_deli TYPE STANDARD TABLE OF bapishpdelivnumb,
lt_ret TYPE STANDARD TABLE OF bapiret2.
DATA: lv_vbeln TYPE bapishpdelivnumb-deliv_numb,
lv_num TYPE bapidlvcreateheader-num_deliveries.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_STO'
IMPORTING
delivery = lv_vbeln
num_deliveries = lv_num
TABLES
stock_trans_items = lt_items
deliveries = lt_deli
return = lt_ret.
READ TABLE lt_ret TRANSPORTING NO FIELDS WITH KEY type = 'E'.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ENDIF.
创建交单-BAPI_OUTB_DELIVERY_CREATE_STO
最新推荐文章于 2024-07-11 06:45:00 发布