DATA: lw_header TYPE bapiobdlvhdrcon,
lw_header_control TYPE bapiobdlvhdrctrlcon,
lw_delivery TYPE bapiobdlvhdrcon-deliv_numb,
lw_header_deadlines TYPE bapidlvdeadln,
lt_header_deadlines TYPE TABLE OF bapidlvdeadln,
lw_return TYPE bapiret2,
lt_return TYPE TABLE OF bapiret2.
*根据销售单查找
SELECT SINGLE a~vbeln
FROM likp AS a INNER JOIN lips AS b ON a~ vbeln = b~ vbeln
INTO lw_delivery
WHERE b~vgbel =l_vbeln.
lw_header-deliv_numb = lw_delivery.
lw_header_control-deliv_numb = lw_delivery.
lw_header_control-post_gi_flg = 'X'.
lw_header_control-gdsi_date_flg = 'X'.
*过账
CALL FUNCTION ‘BAPI_OUTB_DELIVERY_CONFIRM_DEC’
EXPORTING
header_data = lw_header
header_control = lw_header_control
delivery = lw_delivery
TABLES
return = lt_return.