data:wa_items type bapidlvreftosalesorder,
begin
of temp_item occurs
0,item(2000),
endof temp_item,
begin
of it_item occurs
0,sequence,
item(6) type n,
endof it_item,
wa_item like
line
of it_item,
begin
of item_list occurs
0,item(6) type n,
endof item_list,
l_it_orderitem type
standard
table
of bapidlvreftosalesorder with
header
line.
data:lx_vbkok type vbkok,
it_prott like
table
of prott with
header
line,
it_vbpok like
table
of vbpok with
header
line.
*& 因過賬時,有行專案的限制,需要對過賬專案進行拆分,揀配的次數之間用'-'分割
*& 專案內用','
refresh:temp_item.
split item_divison at
'-'into
table temp_item.
loop
at temp_item.
clear:it_item.
it_item-sequence = sy-tabix.
refresh:item_list.
shift temp_item-item left deleting leading
''.split temp_item-item at
','into
table item_list.
loop
at item_list.
it_item-item = item_list-item.
collect it_item.
endloop.
endloop.
sort it_item by sequence item.
sort sales_order_items by ref_doc ref_item.
*& 按拆分的專案,進行建立交貨單
loop
at it_item.
wa_item = it_item.
atend
of sequence.
refresh:l_it_orderitem .
loop
function
'bapi_outb_delivery_create_sls'
exporting
ship_point = ship_point
due_date = due_date
debug_*** = debug_***
importing
delivery = delivery
num_deliveries = num_deliveries
tables
sales_order_items = l_it_orderitem
serial_numbers = serial_numbers
extension_in = extension_in
deliveries = deliveries
created_items = created_items
extension_out = extension_out
return = return.
read
table
return
with
keytype = 'e'.
if sy-subrc ne
0.call
function
'bapi_transaction_commit'
exporting
wait = 'x'.
refresh:it_vbpok.
clear:it_vbpok,lx_vbkok.
loop
at l_it_orderitem.
if sy-tabix = 1.
lx_vbkok-vbeln_vl = delivery.
lx_vbkok-vbtyp_vl = 'j' .
lx_vbkok-vbeln = l_it_orderitem-ref_doc.
lx_vbkok-wabuc = 'x'.
endif.
it_vbpok-vbeln_vl = delivery.
read
table created_items index sy-tabix.
it_vbpok-posnr_vl = created_items-deliv_item.
it_vbpok-vbeln = l_it_orderitem-ref_doc.
it_vbpok-posnn = l_it_orderitem-ref_item.
*it_vbpok-matnr = fp_afpo-matnr.
*it_vbpok-charg = fp_afpo-charg.
*it_vbpok-werks = fp_afpo-dwerk.
it_vbpok-taqui = 'x'.
*& 揀配數量
function
'ws_delivery_update'
exporting
vbkok_wa = lx_vbkok
*& synchron = 'x'
commit = 'x'
delivery = delivery
update_picking = 'x'
*& nicht_sperren = 'x'
*& if_database_update = 'x'
*& if_error_messages_send_0 = 'x'
tables
vbpok_tab = it_vbpok
prot = it_prott.
read
table it_prott with
key msgty = 'e'.
if sy-subrc <> 0.
call
function
'bapi_transaction_commit'
* exporting
* wait =
* importing
* return =
.endif.
else.
call
function
'bapi_transaction_rollback'.
endif.
endat.
endloop.
VL01N發貨過賬無法沖銷
1業務場景 sd和ewm在使用bapi bapi outb delivery confirm dec發貨過賬後,發現外向交貨單無法被沖銷,後來發現是在發貨過賬後,有乙個欄位vlstk宣告倉庫被維護上了c,所以無法沖銷 經過查詢,需要做個增強,在外向交貨單過賬時,去掉這個引數。badi le shp ...
VL02N發貨過賬BAPI
使用bapi函式 bapi outb delivery confirm dec 進行delivery的發貨過賬,可能會有如此的需求,就是修改實際的發貨日期 規劃的gi 交貨日期 裝載日期 傳輸計畫日期和撿配日期,那麼這些修改必須要通過引數header deadlines來設定,並配合header c...
N0 1每週心得
加入小組已經有幾周的時間了,今天談談我這幾周生活和學習上的改變 從暑假的每天睡懶覺到現在的準時準點到小組學習 每天都過得很充實,雖然和我步入大學之前想象中的輕鬆娛樂大學生活不太一樣,但忙碌充實也讓我感悟到了大學真正的魅力 提公升自己,成為更優秀的自己。並且這週六我們小組聚餐中,有機會能和學長學姐們深...