zoukankan      html  css  js  c++  java
  • 添加生产订单组件——CO_XT_COMPONENT_ADD

    效果:

    代码:

    *&---------------------------------------------------------------------*
    *& Report ZPPRTEST4
    *&---------------------------------------------------------------------*
    *&
    *&---------------------------------------------------------------------*
    REPORT ZPPRTEST4.
    
    DATA: ls_requ TYPE coxt_s_quantity,
          ls_storage TYPE coxt_s_storage_location,
          ls_storagex TYPE coxt_s_storage_locationx,
          ls_return TYPE coxt_bapireturn,
          lt_return TYPE coxt_t_bapireturn,
          l_msg(100) TYPE c.
    
    TYPES: BEGIN OF ts_resb_bt.
      INCLUDE TYPE resbb.
    TYPES: indold LIKE sy-tabix,
    no_req_upd LIKE sy-datar,
    END OF ts_resb_bt.
    
    TYPES: tt_resb_bt TYPE TABLE OF ts_resb_bt.
    FIELD-SYMBOLS: <lt_resb_bt> TYPE tt_resb_bt,
                   <ls_resb_bt> TYPE ts_resb_bt.
    
    ls_requ-quantity = 228.
    ls_requ-uom = 'PCS'.
    
    ls_storage-werks = '2000'.
    ls_storage-lgort = '2101'.
    
    ls_storagex-werks = 'X'.
    ls_storagex-lgort = 'X'.
    
    CALL FUNCTION 'CO_XT_COMPONENT_ADD'
      EXPORTING
        is_order_key               = '000020030749'  "生产订单
        i_material                 = 'CTXB0056-S2V-1' "子件
        is_requ_quan               = ls_requ  "子件需求数量和单位
        i_operation                = '00000007' "工艺工序节点计数器
        is_storage_location        = ls_storage "工厂和仓库
        is_storage_locationx       = ls_storagex
        i_postp                    = 'L'  "项目种类
        i_posno                    = '000000' "BOM项目计数器
     IMPORTING
       es_bapireturn              = ls_return.
    
    ASSIGN ('(SAPLCOBC)RESB_BT[]') TO <lt_resb_bt>.
    LOOP AT <lt_resb_bt> ASSIGNING <ls_resb_bt>.
      <ls_resb_bt>-posnr = '0020'.  "组件项目编号
    ENDLOOP.
    
    IF ls_return-type NE 'E'.
      CALL FUNCTION 'CO_XT_ORDER_PREPARE_COMMIT'
        TABLES
           et_bapireturn          = lt_return.
      IF sy-subrc = 0.
        COMMIT WORK AND WAIT.
        l_msg = '添加成功'.
        cl_demo_output=>write( l_msg ).
      ELSE.
        cl_demo_output=>write( lt_return ).
      ENDIF.
    ELSE.
      cl_demo_output=>write( ls_return ).
    ENDIF.
    cl_demo_output=>display(  ).
  • 相关阅读:
    线程中常见的方法
    停止线程方式
    线程间的通信_多生产者多消费者问题_JDK1.5新特性_Lock
    1-为什么java的main方法必须是静态的
    45-机器设计问题(深搜)
    44-最大差值三角形
    23-吝啬的国度(vector+深搜)
    43-八数码
    41-安排车辆
    41-邮差送信(dfs)
  • 原文地址:https://www.cnblogs.com/StephenAmell/p/13040412.html
Copyright © 2011-2022 走看看