zl程序教程

您现在的位置是:首页 >  其他

当前栏目

[BAPI]如何修改工单状态-BAPI_ALM_ORDER_MAINTAIN详解编程语言

状态编程语言 如何 详解 修改 order BAPI 工单
2023-06-13 09:11:51 时间
1,BAPI简介

可以通过调用BAPI BAPI_ALM_ORDER_MAINTAI来更改工单的状态,具体使用到的参数是IT_METHODS。

[BAPI]如何修改工单状态-BAPI_ALM_ORDER_MAINTAIN详解编程语言


img >

IT_METHODS的定义如下:

[BAPI]如何修改工单状态-BAPI_ALM_ORDER_MAINTAIN详解编程语言


img >

各个字段含义如下:

REFNUMBER:是objecttype参数中填入的相关对象对应的内表行数,
OBJECTTYPE:对象类型,类型如下:

HEADER Order header

METHOD:方法,可以实现创建、修改、删除、保存等功能以及工单的状态-lock、unlock、TECHNICALCOMPLETE等,具体代码如下:

CREATE :Create objects
DO_NOT_EXEC_NOTIF_CLOSE :Do not execute and complete notifications
Note: This also automatically completes any outstanding tasks in the notifications.
DO_NOT_EXEC_NOTIF_DEALLOC :Do not execute and remove assigned notifications from order
Note: Notifications assigned to the order header are not removed, but rather automatically completed.
TECO_WITH_NOTIF :Technically complete with notifications
Note: If a reference date is transferred, the notification with the reference date is also completed. The tasks of the notification are not automatically completed.
CANCEL_TECO_WITH_NOTIF : Reset technical completion and put assigned notifications in process again
RESET_DLFL_WITH_NOTIF :Reset deletion flag and put assigned notifications in process again

OBJECTKEY: 外部对象码,详细如下:

0-12 Order number 工单号
CREATE, CHANGE, RELEASE, ATPCHECK, CALCUALTE, SCHEDULE, CREATETONOTIF, DO_NOT_EXECUTE, LOCK, UNLOCK, TECHNICALCOMPLETE, CANCEL_TECHNICAL_COMPLETION, COMPLETE_BUSINESS, CANCEL_BUSINESS_COMPLETION, SET_DEL_FLAG, RESET_DEL_FLAG
lt_methods TYPE TABLE OF bapi_alm_order_method, ls_methods TYPE bapi_alm_order_method, lt_return TYPE bapiret2_t, ls_return TYPE bapiret2. lv_aufnr = 200000000123.
CALL FUNCTION BAPI_TRANSACTION_ROLLBACK. MESSAGE ls_return-message TYPE S DISPLAY LIKE E. ELSE. CALL FUNCTION BAPI_TRANSACTION_COMMIT EXPORTING wait = X. MESSAGE 工单状态更新成功 TYPE S. ENDIF. ENDIF.

程序运行前,tcode IW33查看工单状态为释放REL

[BAPI]如何修改工单状态-BAPI_ALM_ORDER_MAINTAIN详解编程语言


img >

程序运行后,工单状态为技术完成TECO

[BAPI]如何修改工单状态-BAPI_ALM_ORDER_MAINTAIN详解编程语言


img >

其他,工单的技术完成状态可以通过IW32撤销,

[BAPI]如何修改工单状态-BAPI_ALM_ORDER_MAINTAIN详解编程语言


img >

以上。

19314.html

cgojava