261 migo过账--工单发料 demo

261 migo过账–工单发料 demo

    goodsmvt_code = '03'.
    move_type = '261'.

    LOOP AT req_item.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = req_item-aufnr
        IMPORTING
          output = pro_no
        EXCEPTIONS
          OTHERS = 1.
      goodsmvt_item-item_text = tr_code.
      CLEAR tr_code.
      goodsmvt_item-material  = req_item-matnr. "物料号
      goodsmvt_item-plant          =  req_item-werks. "工厂
      goodsmvt_item-stge_loc       = req_item-lgort."库存地点
      goodsmvt_item-move_type       = '261'.
      goodsmvt_item-reserv_no       = req_item-rsnum.  "预留号 RESB~RSNUM,加上后可以冲销提货数
      goodsmvt_item-res_item        = req_item-rspos.  "预留行号
      goodsmvt_item-orderid         = pro_no. " 生产订单
      goodsmvt_item-spec_stock      = req_item-sobkz. " 特殊库存标识
      goodsmvt_item-entry_qnt      = req_item-menge. "数量
  •      goodsmvt_item-batch          = req_item-charg. "批次
    
  •      goodsmvt_item-entry_uom = req_item-bprme.         "单位
    
        " 通过预留判断是否走销售库存
    
  •      SELECT resb~sobkz FROM resb  INTO stocktype
    
  •         WHERE  resb~rsnum = req_item-rsnum AND resb~rspos = req_item-rspos.
    
  •      ENDSELECT.
    
        IF req_item-sobkz EQ 'E'. " 销售库存
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = req_item-vbeln
            IMPORTING
              output = req_item-vbeln
            EXCEPTIONS
              OTHERS = 1.
    
    
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = req_item-posnr
            IMPORTING
              output = req_item-posnr
            EXCEPTIONS
              OTHERS = 1.
    
          goodsmvt_item-val_sales_ord = req_item-vbeln.
          goodsmvt_item-val_s_ord_item = req_item-posnr.
    
  •      ELSE.
    
  •        goodsmvt_item-spec_stock = ''.
        ENDIF.
        APPEND goodsmvt_item.
        CLEAR goodsmvt_item.
        CLEAR stocktype.
      ENDLOOP.
    
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值