生产订单工序新增、修改、删除——CO_SE_PRODORD_OPR_CREATE、CO_SE_PRODORD_OPR_CHANGE、CO_SE_PRODORD_OPR_DELETE

ps:使用这些函数时,需注意生产订单组件分配的工序号

 

生产订单初始工序

 

 1、CO_SE_PRODORD_OPR_CREATE新增

 

DATA: lv_aufnr   TYPE aufnr,
      ls_return  TYPE bapiret2,
      lt_routing TYPE cose_t_opr_create,
      ls_routing TYPE cose_s_opr_create.

lv_aufnr = '000021067183'.
ls_routing-vornr = '0030'.
ls_routing-arbpl = 'DP2020'.
ls_routing-steus = 'ZP02'.
ls_routing-ltxa1 = '壓鑄加工'.
ls_routing-vgw01 = 66.
ls_routing-vge01 = 'S'.
APPEND ls_routing TO lt_routing.

CALL FUNCTION 'CO_SE_PRODORD_OPR_CREATE'
  EXPORTING
    iv_order_number = lv_aufnr
    it_opr_create   = lt_routing
*   it_user_stat    =
    iv_refresh      = 'X'
    iv_order_post   = 'X'
    iv_commit       = 'X'
  IMPORTING
    es_return       = ls_return.

WRITE ls_return-message.

 

2、CO_SE_PRODORD_OPR_CHANGE修改

 

DATA: lv_aufnr   TYPE aufnr,
      lt_routing TYPE cose_t_opr_change,
      ls_routing TYPE cose_s_opr_change,
      ls_return  TYPE bapiret2.

lv_aufnr = '000021067183'.
ls_routing-vornr = '0030'.
ls_routing-arbpl = 'DP2010'.
ls_routing-arbpl_x = 'X'.
ls_routing-ltxa1 = '壓鑄成形'.
ls_routing-ltxa1_x = 'X'.
ls_routing-vgw01 = 70.
ls_routing-vgw01_x = 'X'.
APPEND ls_routing TO lt_routing.

CALL FUNCTION 'CO_SE_PRODORD_OPR_CHANGE'
  EXPORTING
    iv_order_number = lv_aufnr
    it_opr_change   = lt_routing
*   it_user_stat    =
    iv_refresh      = 'X'
    iv_order_post   = 'X'
    iv_commit       = 'X'
  IMPORTING
    es_return       = ls_return.

WRITE ls_return-message.

 

3、CO_SE_PRODORD_OPR_DELETE删除

 

DATA: lv_aufnr   TYPE aufnr,
      ls_return  TYPE bapiret2,
      lt_routing TYPE cose_t_opr_delete,
      ls_routing TYPE cose_s_opr_delete.

lv_aufnr = '000021067183'.
ls_routing-vornr = '0030'.
APPEND ls_routing TO lt_routing.

CALL FUNCTION 'CO_SE_PRODORD_OPR_DELETE'
  EXPORTING
    iv_order_number = lv_aufnr
    it_opr_delete   = lt_routing
*   it_user_stat    =
    iv_refresh      = 'X'
    iv_order_post   = 'X'
    iv_commit       = 'X'
  IMPORTING
    es_return       = ls_return.

WRITE ls_return-message.

 

posted @ 2021-09-17 10:26  鲸与海  阅读(2240)  评论(2编辑  收藏  举报