[函数]如何取得生产订单下的工序(operation)-[PM_ORDER_DATA_READ]

1, 前台操作

在前台可以通过tcode:CO03查看生产订单工序。

选择order entered 选项,输入生产订单

<img class="alignnone size-full wp-image-5606" src="http://www.baidusap.com/wp-content/uploads/2017-11-10_16-27-20.png" alt="" width="515" height="301" />

进入到工序的详细屏幕:

<img class="alignnone size-full wp-image-5607" src="http://www.baidusap.com/wp-content/uploads/2017-11-10_16-13-02.png" alt="" width="735" height="353" />

2, 例子代码

可以通过函数 PM_ORDER_DATA_READ来读取生产订单下的工序(operation),包括子工序(sub-operation),值得注意的是在调用函数 PM_ORDER_DATA_READ之前要先调用 CO_IT_SET_FLG_ITAB_NEW来reset一些内表。

下面例子读取了1中订单 ‘000100003145’下的工序和子工序。

REPORT ztest_get_operation.

DATA: lit_afvgd TYPE afvgd_t,
      lwa_afvgd LIKE LINE OF lit_afvgd.

* Reset data before calling to PM_ORDER_DATA_READ
CALL FUNCTION 'CO_IT_SET_FLG_ITAB_NEW' .

* Get operations
CALL FUNCTION 'PM_ORDER_DATA_READ'
  EXPORTING
    order_number    = '000100003145'
*   CALL_FROM_NOTIF =
* IMPORTING
*   WCAUFVD         =
*   WILOA           =
*   WRIWO1          =
  TABLES
*   IAFFHD          =
    iafvgd          = lit_afvgd
*   IRESBD          =
*   IRIPW0          =
*   OP_PRINT_TAB    =
*   IHPAD_TAB       =
*   IHSG_TAB        =
*   IHGNS_TAB       =
*   KBEDP_TAB       =
  EXCEPTIONS
    order_not_found = 1
    OTHERS          = 2.
IF sy-subrc = 0.
  LOOP AT lit_afvgd INTO lwa_afvgd.
    WRITE:/ lwa_afvgd-vornr, "operation
            lwa_afvgd-uvorn. "sub-operation
  ENDLOOP.
ENDIF.

运行结果与CO03中的结果一致。

<img class="alignnone size-full wp-image-5608" src="http://www.baidusap.com/wp-content/uploads/2017-11-10_16-36-08.png" alt="" width="431" height="240" />

以上。

转载于:https://www.cnblogs.com/datie/p/11433545.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值