首页 > 其他分享 >修改生产订单组件——CO_XT_COMPONENT_CHANGE

修改生产订单组件——CO_XT_COMPONENT_CHANGE

时间:2024-03-10 17:11:48浏览次数:37  
标签:CO storage COMPONENT coxt lv ls 组件 TYPE CHANGE

转载地址

https://www.cnblogs.com/StephenAmell/p/16742366.html

 

修改组件仓库的范例

DATA: lv_po        TYPE coxt_ord_key,
      ls_component TYPE coxt_s_ord_comp_key,
      ls_requ      TYPE coxt_s_quantity,
      ls_requx     TYPE coxt_s_quantityx,
      ls_conf      TYPE coxt_s_quantity,
      ls_confx     TYPE coxt_s_quantityx,
      lv_matnr     TYPE coxt_material,
      lv_matnrx    TYPE coxt_materialx,
      ls_oper      TYPE coxt_s_ord_opr_key,
      ls_operx     TYPE coxt_s_ord_opr_keyx,
      ls_storage   TYPE coxt_s_storage_location,
      ls_storagex  TYPE coxt_s_storage_locationx,
      lv_charg     TYPE coxt_batch,
      lv_chargx    TYPE coxt_batchx,
      lv_cuobj     TYPE coxt_config_object,
      lv_cuobjx    TYPE coxt_config_objectx,
      ls_return    TYPE coxt_bapireturn.

"生产订单
lv_po = '000022016565'.

"预留单项次
ls_component-rsnum = '0001065926'.
ls_component-rspos = '0001'.

"组件
lv_matnr = 'CTCN0009-XQ'.
lv_matnrx = 'X'.

"组件领料仓库
ls_storage-werks = '2000'.
ls_storage-lgort = '2173'.

ls_storagex-werks = 'X'.
ls_storagex-lgort = 'X'.

CALL FUNCTION 'CO_XT_COMPONENT_CHANGE'
  EXPORTING
    is_order_key               = lv_po          "生产订单
    is_order_component_key     = ls_component   "组件
    is_requirement_quantity    = ls_requ        "组件需求数量
    is_requirement_quantityx   = ls_requx
    is_confirmed_quantity      = ls_conf        "生产数量
    is_confirmed_quantityx     = ls_confx
    i_material                 = lv_matnr       "组件物料
    i_materialx                = lv_matnrx
    is_order_operation_key     = ls_oper        "组件指派工序
    is_order_operation_keyx    = ls_operx
    is_storage_location        = ls_storage     "组件领料仓库
    is_storage_locationx       = ls_storagex
    i_batch                    = lv_charg       "批次
    i_batchx                   = lv_chargx
    i_mi_configuration_object  = lv_cuobj       "内置对象号码
    i_mi_configuration_objectx = lv_cuobjx
  IMPORTING
    es_bapireturn              = ls_return.

IF ls_return-type NE 'E'.
  CALL FUNCTION 'CO_XT_ORDER_PREPARE_COMMIT'
    IMPORTING
      es_bapireturn = ls_return.
  IF ls_return NE 'E'.
    COMMIT WORK AND WAIT.
    WRITE '修改成功'.
  ELSE.
    ROLLBACK WORK.
    WRITE '修改失败'.
  ENDIF.
ELSE.
  ROLLBACK WORK.
  WRITE '修改失败'.
ENDIF.

  修改组件的工序范例

DATA: lv_po        TYPE coxt_ord_key,
      ls_component TYPE coxt_s_ord_comp_key,
      ls_requ      TYPE coxt_s_quantity,
      ls_requx     TYPE coxt_s_quantityx,
      ls_conf      TYPE coxt_s_quantity,
      ls_confx     TYPE coxt_s_quantityx,
      lv_matnr     TYPE coxt_material,
      lv_matnrx    TYPE coxt_materialx,
      ls_oper      TYPE coxt_s_ord_opr_key,
      ls_operx     TYPE coxt_s_ord_opr_keyx,
      ls_storage   TYPE coxt_s_storage_location,
      ls_storagex  TYPE coxt_s_storage_locationx,
      lv_charg     TYPE coxt_batch,
      lv_chargx    TYPE coxt_batchx,
      lv_cuobj     TYPE coxt_config_object,
      lv_cuobjx    TYPE coxt_config_objectx,
      ls_return    TYPE coxt_bapireturn.

DATA: lt_resb_get TYPE TABLE OF resbdget,
      ls_resb_get TYPE resbdget.

"生产订单
lv_po = '000022016565'.

"预留单项次
ls_component-rsnum = '0001065926'.
ls_component-rspos = '0001'.

"组件
lv_matnr = 'CTCN0009-XQ'.
lv_matnrx = 'X'.

"工厂
ls_storage-werks = '2000'.

CALL FUNCTION 'CO_XT_COMPONENT_CHANGE'
  EXPORTING
    is_order_key               = lv_po          "生产订单
    is_order_component_key     = ls_component   "组件
    is_requirement_quantity    = ls_requ        "组件需求数量
    is_requirement_quantityx   = ls_requx
    is_confirmed_quantity      = ls_conf        "生产数量
    is_confirmed_quantityx     = ls_confx
    i_material                 = lv_matnr       "组件物料
    i_materialx                = lv_matnrx
    is_order_operation_key     = ls_oper        "组件指派工序
    is_order_operation_keyx    = ls_operx
    is_storage_location        = ls_storage     "组件领料仓库
    is_storage_locationx       = ls_storagex
    i_batch                    = lv_charg       "批次
    i_batchx                   = lv_chargx
    i_mi_configuration_object  = lv_cuobj       "内置对象号码
    i_mi_configuration_objectx = lv_cuobjx
  IMPORTING
    es_bapireturn              = ls_return.

IF ls_return-type NE 'E'.
  CALL FUNCTION 'CO_XT_ORDER_PREPARE_COMMIT'
    IMPORTING
      es_bapireturn = ls_return.
  IF ls_return NE 'E'.

    "获取生产订单
    CALL FUNCTION 'CO_BC_RESBD_OF_ORDER_GET'
      EXPORTING
        aufnr_act = lv_po "生产订单
      TABLES
        resbd_get = lt_resb_get.

    LOOP AT lt_resb_get INTO ls_resb_get
      WHERE rsnum = '0001065926' AND rspos = '0001'.
      "修改组件的工序
      ls_resb_get-vornr = '0040'.
      MODIFY lt_resb_get FROM ls_resb_get.
    ENDLOOP.

    CALL FUNCTION 'CO_BC_UPDATE_CMP_OF_ORDERS'
      TABLES
        resbd_get = lt_resb_get.

    COMMIT WORK AND WAIT.

    CALL FUNCTION 'CO_XT_ORDER_INITIALIZE'.

    WRITE '修改成功'.
  ELSE.
    ROLLBACK WORK.
    WRITE '修改失败'.
  ENDIF.
ELSE.
  ROLLBACK WORK.
  WRITE '修改失败'.
ENDIF.

 

标签:CO,storage,COMPONENT,coxt,lv,ls,组件,TYPE,CHANGE
From: https://www.cnblogs.com/wangzuoer/p/18064401

相关文章

  • vscode自动注释插件的使用
    如果是工作中写代码,经常会有一些注释的规范,一次性写很多文件,就要把这部分内容复制来复制去,不太方便,因此就想着vscode是不是有什么插件可以用用,就发现了这样一个插件。插件是这个,搜索koroFileHeader这个安装完之后最好自己配一下,不然不是很符合进入设置页面,搜索FileHeader,找到......
  • [BalticOI 2017] Toll
    做法很多,本人使用线段树。原图可以看作分层DAG,每层结点有\(k\)个,而\(k\le5\)。假设每层的点编号\(0\simk-1\)。从\(l\)到\(r\)层的路径,在线段树上用区间\([l,r-1]\)表示。线段树上每个结点都存储表示最段路的矩阵,合并时使用Floyd。另外,需要特判询问中是否两个点......
  • java.net.UnknownHostException: api.weixin.qq.com解决办法
    java.net.UnknownHostException: api.weixin.qq.comat java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:175)at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)at java.net.Socket.connect(Socket.java:546)at sun.security.ssl.SSLSo......
  • NetCore 依赖注入
    .AddTransient<IFoo,Foo>()////ImplementationType根据类型.AddScoped<IBar>(_=>newBar())//ImplementationFactory通过工厂创建.AddSingleton<IBaz>(newBaz());//ImplementationInstance实现实例添加对象注册并注册不同作用域,并遍历注册到容器内。1Implementat......
  • AtCoder Beginner Contest 344
    A-Spoiler#include<bits/stdc++.h>usingnamespacestd;usingi32=int32_t;usingi64=int64_t;usingldb=longdouble;#defineinti64usingvi=vector<int>;usingpii=pair<int,int>;constintmod=998244353;constintinf......
  • RGI 德国Real Good Idea 流量计 Flocon21
    ProductspecificationEvaluationunitforflowmeasurementsystembasedonmicrowaves DescriptionThe evaluationcomputerFLOCON21forms,togetherwithoneofthesensorsDR-xxx,acontactlessflowmeasurementsystemformanyapplicationsinthe......
  • 无线表格识别模型LORE转换库:ConvertLOREToONNX
    引言总有小伙伴问到阿里的无线表格识别模型是如何转换为ONNX格式的。这个说来有些惭愧,现有的ONNX模型是很久之前转换的了,转换环境已经丢失,且没有做任何笔记。今天下定决心再次尝试转换,庆幸的是转换成功了。于是有了转换笔记:ConvertLOREToONNX。这次吸取教训,环境文件采用Anacond......
  • P2866 [USACO06NOV] Bad Hair Day S
    原题链接题解1.倒序求2.求每个点前有多少高度比自己小的3.高度函数图像是有升有降的,由于要求比自己小的,在求完之后,我们把所有点前比自己小的点缩起来放到自己身上,然后把那些点删掉,再插入自己这样序列就变成了降序,遍历的时候也只需要遍历那些降序点code#include<bits/stdc++......
  • Asyncio in Python and Concurrency tasks
    AsyncioLibraryandConcurrencytasksinPythonTheasynciolibraryisaPythonstandardlibrarymoduleusedforwritingsingle-threadedconcurrentcodeusingcoroutines,multiplexingI/Oaccess,andrunningnetworkclientsandservers.Itprovidesafram......
  • conflucen引起mysql奔溃
    主要是mysql一直奔溃,受到confluence引起奔溃的提示解决办法:直接清空表:scheduler_run_details引起错误的语句:```insertintoscheduler_run_details(job_id,start_time,duration,outcome,message,id)values('SearchAuditListener','2024-03-1010:37:49.963',227,'......