首页 > 其他 > 详细

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

时间:2019-07-13 20:33:06      阅读:345      评论:0      收藏:0      [点我收藏+]
公众号:SAP Technical
本文作者:matinal
 

技术分享图片

 

前言部分

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

正文部分

?
data: begin of i_vbkok occurs 11.
        include structure vbkok.
data: end of i_vbkok.

data: begin of i_vbpok_tab occurs 12.
        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(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  = 1
      others         = 2.
 

*---仅发货过账:

  report.

* Data Define
data: i_vbkok type vbkok.
data: begin of i_vbpok_tab occurs 12.
        include structure vbpok.
data: end of i_vbpok_tab.
data: p_vbeln type vbeln value 0080002730.

*---交货抬头数据
i_vbkok-vbeln_vl        = p_vbeln.        "Delivery number
i_vbkok-wabuc           = X.            "Automatic PGI
i_vbkok-wadat_ist       = 20110223.

*---发货过账
call function WS_DELIVERY_UPDATE
  exporting
    vbkok_wa       = i_vbkok
    commit         = X
    delivery       = p_vbeln
    update_picking = X
  exceptions
    error_message  = 1
    others         = 2.
if sy-subrc <> 0.
  write:/ 发货过账失败!.
endif.

?

 

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

原文:https://www.cnblogs.com/SAPmatinal/p/11181864.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!