VL01N销售订单拣配bapi
来源:互联网 发布:滴滴打车java面试题 编辑:程序博客网 时间:2024/05/02 01:08
data:wa_items type bapidlvreftosalesorder,
begin of temp_item occurs 0,
item(2000),
end of temp_item,
begin of it_item occurs 0,
sequence,
item(6) type n,
end of it_item,
wa_item like line of it_item,
begin of item_list occurs 0,
item(6) type n,
end of 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.
at end of sequence.
refresh:l_it_orderitem .
loop at sales_order_items where ref_item <= wa_item-item.
l_it_orderitem = sales_order_items.
append l_it_orderitem.
clear:l_it_orderitem.
delete sales_order_items.
endloop.
call function 'BAPI_OUTB_DELIVERY_CREATE_SLS'
exporting
ship_point = ship_point
due_date = due_date
debug_flg = debug_flg
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 key type = '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'.
*& 拣配数量
it_vbpok-pikmg = l_it_orderitem-dlv_qty.
append it_vbpok.
endloop.
*&更改拣配数量,当不自动过帐时,需要更改参数如下,并且需要再提交一次
call 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销售订单拣配bapi
- VL01N销售订单拣配bapi
- vl01n bapi
- BAPI:BAPI_SALESORDER_CREATEFROMDAT2 创建销售订单
- BAPI:BAPI_SALESORDER_CREATEFROMDAT2 创建销售订单
- JAVA调用BAPI创建销售订单
- VA02修改销售订单的BAPI举例
- BAPI_SALESORDER_CREATEFROMDAT2 BAPI创建VA01 销售订单
- JAVA调用BAPI创建销售订单
- ABAP模块-根据销售订单创建交货单BAPI
- SAP--用BAPI-实现销售订单修改-Cond-Value
- 关于通过使用BAPI创建销售订单(抬头信息中:含增强字段)
- 利用BAPI(BAPI_GOODSMVT_CREATE)投料消耗(261)销售订单E库存
- 关于通过使用BAPI创建销售订单(抬头信息中:含增强字段)
- 关于通过使用BAPI创建销售订单(抬头信息中:含增强字段)
- 订单确认bapi co15
- 创建生产订单bapi
- 生成内部订单BAPI
- 球钟问题
- Ubuntu中如何根据端口查看进程
- android 添加新的键值,自定义按键
- C++ Builder中加载ini文件
- HttpClient 4.3.X教程(转载)
- VL01N销售订单拣配bapi
- Graphics2D 绘制图形
- C++ static、const、auto、explicit关键字作用
- 井字棋游戏
- 批量生成销售订单、退货订单
- MongoDB 分片技术
- Jenkins+Maven+SVN快速搭建持续集成环境
- [leetcode-371]Sum of Two Integers(java)
- 同IP不同端口Session冲突问题