zoukankan      html  css  js  c++  java
  • SAP MM- BAPI_PO_CHANGE 更新PO version 信息(version management)

     目的 Version 信息的Complated 字段,自动打勾

    实例程序

    *&---------------------------------------------------------------------*
    *& Report Z_PO_CHANGE
    *&---------------------------------------------------------------------*
    *&
    *&---------------------------------------------------------------------*
    REPORT z_po_change.
    DATA:lv_ponumber          TYPE bapimepoheader-po_number,
         ls_version           TYPE bapimedcm,
         ls_expheader         LIKE  bapimepoheader,
         ls_exppoexpimpheader LIKE  bapieikp,
         lt_return            TYPE TABLE OF  bapiret2,
         lt_allversions       TYPE TABLE OF bapimedcm_allversions,
         lt_poitem            TYPE TABLE OF bapimepoitem,
         lt_poitemx           TYPE TABLE OF  bapimepoitemx,
         ls_poitem            TYPE bapimepoitem,
         ls_poitemx           TYPE bapimepoitemx.
    
    ls_poitem-po_item = '00010'.
    APPEND ls_poitem TO lt_poitem.
    
    ls_poitemx-po_item = '00010'.
    ls_poitemx-po_itemx = 'U'.
    APPEND ls_poitemx TO lt_poitemx.
    
    lv_ponumber            = '4551701247'.
    ls_version-post_date   = '20210510'.
    ls_version-completed   = 'X'.
    ls_version-description = 'Testing'.
    ls_version-reason      = 'CR03'.
    ls_version-req_by      = 'WANGZ94'.
    
    APPEND INITIAL LINE TO lt_allversions ASSIGNING FIELD-SYMBOL(<fs_v>).
    <fs_v>-doc_type      = 'F'.
    <fs_v>-doc_number    =  '4551701247'.
    <fs_v>-item_number   = '00000'.
    <fs_v>-version       = '00000000'.
    <fs_v>-created_by    = 'LIS72'.
    <fs_v>-cr_on         = '20210510'.
    <fs_v>-rec_time      = '094927'.
    <fs_v>-reason        = 'CR03'.
    <fs_v>-completed     = 'X'.
    *<fs_v>-net_value     = '850'.
    *<fs_v>-value_changed = '150'.
    <fs_v>-currency      = 'CNY'.
    
    CALL FUNCTION 'BAPI_PO_CHANGE'
      EXPORTING
        purchaseorder     = lv_ponumber
        versions          = ls_version
      IMPORTING
        expheader         = ls_expheader
        exppoexpimpheader = ls_exppoexpimpheader
      TABLES
        return            = lt_return
        poitem            = lt_poitem
        poitemx           = lt_poitemx
        allversions       = lt_allversions.
    
    LOOP AT lt_return TRANSPORTING NO FIELDS WHERE type CA 'AEX'.
      EXIT.
    ENDLOOP.
    
    IF sy-subrc <> 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    ENDIF.

     BAPI 程序跟踪数据流向

     

    论坛

    https://answers.sap.com/questions/6461311/update-versions-using-bapipochange.html

  • 相关阅读:
    D3js-实现图形拖拽及双击恢复
    D3js-三种图表tooltip提示框总结介绍
    D3js-API介绍【英】
    D3js-API介绍【中】
    springboot 整合 activemq 同时使用点对点模式和发布订阅模式
    docker 安装 activemq
    nginx 配置websocket 400 问题
    springboot +vue 整合websocket 403
    m3u8下载器
    linux scp 命令
  • 原文地址:https://www.cnblogs.com/JackeyLove/p/14755792.html
Copyright © 2011-2022 走看看