*交货单过账
break-point.
DATA:
hdata like BAPIOBDLVHDRCON,
hctrl like BAPIOBDLVHDRCTRLCON,
ipk like table of /SPE/BAPIOBDLVITEMCONF with header line,
ret like table of BAPIRET2 with header line ,
hdl like table of BAPIDLVDEADLN with header line.
hdata-DELIV_NUMB = delno.
hctrl-DELIV_NUMB = delno.
hctrl-POST_GI_FLG = 'X'.
"标记更更实际和计划的过账时间, 时间的值在 HEADER_DEADLINES 参数里添加(这个开始没注意看帮助,走了很多弯路,才找到)
hctrl-DELIV_DATE_FLG = 'X'.
hctrl-GDSI_DATE_FLG ='X'.
ipk-DELIV_NUMB = delno.
ipk-DELIV_ITEM = 10.
ipk-STGE_LOC = 2023.
append ipk.
“ 查 HEADER_DEADLINES 说明得到下面提示
*- WSHDRLFDAT Delivery date
*- WSHDRWADAT Goods issue date (planned)
*- WSHDRWADTI Goods issue date (actual)
*- WSHDRLDDAT Loading date
*- WSHDRTDDAT Transportation planning date
*- WSHDRKODAT Picking date
hdl-DELIV_NUMB = delno.
hdl-timetype = 'WSHDRWADTI'. "实际过账日期
hdl-timestamp_utc = date1.
append hdl.
hdl-DELIV_NUMB = delno.
hdl-timetype = 'WSHDRWADAT'. "计划日期
hdl-timestamp_utc = date1.
append hdl.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
EXPORTING
header_data = hdata
header_control = hctrl
delivery = delno
* TECHN_CONTROL =
* HEADER_DATA_SPL =
* HEADER_CONTROL_SPL =
tables
* HEADER_PARTNER =
* HEADER_PARTNER_ADDR =
HEADER_DEADLINES = hdl
* ITEM_DATA =
* ITEM_CONTROL =
* ITEM_SERIAL_NO =
* SUPPLIER_CONS_DATA =
* HANDLING_UNIT_HEADER =
* HANDLING_UNIT_ITEM =
* HANDLING_UNIT_SERNO =
* EXTENSION1 =
* EXTENSION2 =
ITEM_DATA_SPL = ipk[]
return = ret
* TOKENREFERENCE =
* HANDLING_UNIT_HEADER_CROSS =
* ITEM_DATA_SPL =
* HANDLING_UNIT_IDENTIFIERS =
* HANDLING_UNIT_ITEM_SPL =
.