问题
Hello I want to change the status of a PM order to TECO.
For that I am using the BAPI BAPI_ALM_ORDER_MAINTAIN
.
This is my code, but it doesn't work. What am I doing wrong?
DATA: lt_alm_order_method TYPE TABLE OF bapi_alm_order_method,
ls_alm_order_method TYPE bapi_alm_order_method.
ls_alm_order_method-refnumber = '00001'.
ls_alm_order_method-objecttype = 'HEADER'.
ls_alm_order_method-method = 'TECHNICALCOMPLETE'.
ls_alm_order_method-objectkey = '000000900085'.
APPEND ls_alm_order_method TO lt_alm_order_method.
CLEAR : ls_alm_order_method .
ls_alm_order_method-refnumber ='00001'.
ls_alm_order_method-objecttype = space.
ls_alm_order_method-method = 'SAVE'.
ls_alm_order_method-objectkey = '000000900085'.
APPEND ls_alm_order_method TO lt_alm_order_method.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
* EXPORTING
* IV_MMSRV_EXTERNAL_MAINTENACE =
TABLES
it_methods = lt_alm_order_method.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
来源:https://stackoverflow.com/questions/49358873/pm-order-change-status-to-teco