09-28-2007 11:57 AM
Hi,
I have to create, release and TECO a PM order using BAPI_ALM_ORDER_MAINTAIN. (see a part of code below). In addition I have to set the field "key of cycle group" (PLKO-PLNNR) that not have this BAPI.
What should I do?
Thanks a lot!!!
Paky
i_methods-refnumber = '1'.
i_methods-objecttype = 'HEADER'.
i_methods-method = 'RELEASE'.
i_methods-objectkey = p_i_orderid.
APPEND i_methods.
CLEAR i_methods.
i_methods-refnumber = '1'.
i_methods-objecttype = 'OPERATION'.
i_methods-method = 'CHANGE'.
i_methods-objectkey = p_i_orderid.
APPEND i_methods.
CLEAR i_methods.
i_methods-refnumber = '1'.
i_methods-objecttype = 'HEADER'.
i_methods-method = 'TECO'.
i_methods-objectkey = p_i_orderid.
APPEND i_methods.
CLEAR i_methods.
i_methods-refnumber = '1'.
i_methods-objecttype = ''.
i_methods-method = 'SAVE'.
i_methods-objectkey = p_i_orderid.
APPEND i_methods.
CLEAR i_methods.
MOVE-CORRESPONDING e_operation TO i_operation.
i_operation-usr04 = '03'.
i_operation-usr10 = 'X'.
APPEND i_operation.
CLEAR i_operation.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = i_methods[]
it_header = i_header[]
it_header_up = i_header_x[]
it_operation = i_operation[]
return = p_i_return[].
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
COMMIT WORK.
09-28-2007 12:46 PM
09-28-2007 12:52 PM
Try this :
i_methods-refnumber = '1'.
i_methods-objecttype = 'HEADER'.
i_methods-method = 'TECHNICALCOMPLETE'.
i_methods-objectkey = p_i_orderid.
APPEND i_methods.
CLEAR i_methods.
also, you have to pass the header info into the BAPI.
It is in the documentation.
09-28-2007 2:04 PM
ok, I pass the header info in my program but the problem is:
when I create a PM order with BAPI_ALM_ORDER_MAINTAIN it is possible to link it a particular "key of cycle group" ?
I refer at field TASK_LIST_GROUP that is present in structure BAPI_ALM_ORDER_HEADER_E in BAPI BAPI_ALM_ORDER_GET_DETAIL but not in structures of BAPI_ALM_ORDER_MAINTAIN.
Thanks