交货单实际发货日期修改

REPORT  Z_POSTING_DELIVERY.

DATA: code(255) TYPE c OCCURS 0,
      prog LIKE sy-repid value 'ZCHD_ZSDR021'.
*Insert '*@#@@[SAP]' into CODE
* INDEX 13 .
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.


*  READ   REPORT prog INTO code.
*  check sy-subrc = 0.
*  insert '*@#@@[SAP]' into code index 1.
*  INSERT REPORT prog FROM code.

  READ REPORT prog INTO code.
  CHECK SY-SUBRC = 0 .
  DELETE code INDEX 1.
  INSERT REPORT prog FROM code.



  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       =  SY-DATUM .
  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.
  IF  SY-SUBRC <> 0.

  ENDIF.
  .

 

转载于:https://www.cnblogs.com/hdchen/p/9124826.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值