介绍一个PP模块的BAPI, “BAPI_PRODORD_GET_DETAIL”,通过这个BAPI能取得PP订单的详细信息.
具体能读取的详细信息包括:
- 抬头(Header)
- 行项目(Item)
- 工序中的Sequence
- 工序(Operation)
- 子工序(Suboperation or secondary resource)
- 触发点(Trigger point)
- 组件(Component)
- Production resource/tool
可以通过输入参数ORDER_OBJECTS指定:
其他:执行这个BAPI需要权限对象 C_AFKO_AWK有03 (display activity).
一段简单的例子代码:取得PP订单组件(Components)和工序(operations)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
DATA: lwa_object TYPE bapi_pp_order_objects, "objects
lit_components TYPE TABLE OF bapi_order_component, "components.
lit_operations TYPE TABLE OF bapi_order_operation1. "operations
lwa_object-components = abap_true.
lwa_object-operations = abap_true.
CALL FUNCTION 'BAPI_PRODORD_GET_DETAIL'
EXPORTING
number = <lfs_afpo>-aufnr
order_objects = lwa_object
TABLES
component = lit_components
operation = lit_operations.
|
生产订单可以在前台通过tcode CO03查看。
以上。