公众号:SAP Technical
本文作者:matinal
 

【ABAP系列】SAP ABAP WS_DELIVERY_UPDATE 修改数量、过账日期并发货过账-LMLPHP

前言部分

大家可以关注我的公众号,公众号里的排版更好,阅读更舒适。

正文部分


data: begin of i_vbkok occurs .
include structure vbkok.
data: end of i_vbkok. data: begin of i_vbpok_tab occurs .
include structure vbpok.
data: end of i_vbpok_tab. parameters: p_vbeln type vbeln. data:g_likp like likp.
data:g_lips like lips.
data gv_14() type c. start-of-selection. select single * into g_likp from likp
where vbeln = p_vbeln. i_vbkok-vbeln_vl = p_vbeln. "Delivery number
i_vbkok-wabuc = 'X'. "Automatic PGI
i_vbkok-wadat_ist = g_likp-bldat.
append i_vbkok. select * into g_lips from lips
where vbeln = p_vbeln.
i_vbpok_tab-vbeln_vl = p_vbeln. "Delivery number
i_vbpok_tab-posnr_vl = g_lips-posnr.
i_vbpok_tab-vbeln = p_vbeln.
i_vbpok_tab-posnn = g_lips-posnr.
i_vbpok_tab-matnr = g_lips-matnr.
gv_14 = g_lips-lfimg.
condense gv_14.
i_vbpok_tab-pikmg = gv_14 .
append i_vbpok_tab.
endselect. call function 'WS_DELIVERY_UPDATE'
exporting
vbkok_wa = i_vbkok
commit = 'X'
delivery = p_vbeln
update_picking = 'X'
tables
vbpok_tab = i_vbpok_tab
exceptions
error_message =
others = . *---仅发货过账: report. * Data Define
data: i_vbkok type vbkok.
data: begin of i_vbpok_tab occurs .
include structure vbpok.
data: end of i_vbpok_tab.
data: p_vbeln type vbeln value ''. *---交货抬头数据
i_vbkok-vbeln_vl = p_vbeln. "Delivery number
i_vbkok-wabuc = 'X'. "Automatic PGI
i_vbkok-wadat_ist = ''. *---发货过账
call function 'WS_DELIVERY_UPDATE'
exporting
vbkok_wa = i_vbkok
commit = 'X'
delivery = p_vbeln
update_picking = 'X'
exceptions
error_message =
others = .
if sy-subrc <> .
write:/ '发货过账失败!'.
endif. ​
04-26 03:03