‎2009 Oct 21 3:19 PM
Hello,
I'm novice in ABAP and trying to implement RFC function that will technically complete work order with provided order id.
I've implemented functionality using BAPI_ALM_ORDER_MAINTAIN rfc, but when calling my RFC I get following error:
E IW 177 Order cannot be completed; account assignment not maintained
E IWO_BAPI 166 Order 000004000431 could not be technically completed
E IWO_BAPI2 113 Error during processing of BAPI methods
In same time I can 'technicaly complete' same work order using transaction IW32.
RFC complete code listing is below. Any ideas were is the problem?
Thanks in advance!
FUNCTION Z_ORDER_COMPLETE.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(ORDERID) TYPE AUFNR
*" TABLES
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
*"----------------------------------------------------------------------
data:
it_methods like BAPI_ALM_ORDER_METHOD occurs 0 with header line,
it_header like BAPI_ALM_ORDER_HEADERS_I occurs 0 with header line.
it_methods-refnumber = 1.
it_methods-method = 'TECHNICALCOMPLETE'.
it_methods-objectkey = ORDERID.
it_methods-objecttype = 'HEADER'.
append it_methods.
it_methods-method = 'SAVE'.
it_methods-objecttype = ' '.
append it_methods.
it_header-orderid = ORDERID.
append it_header.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
IT_METHODS = IT_METHODS
IT_HEADER = IT_HEADER
RETURN = RETURN
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
.
ENDFUNCTION.
‎2009 Oct 21 6:41 PM
‎2009 Oct 21 6:41 PM
‎2009 Oct 28 2:43 PM
Thanks for reply. In the end it was system customization that was causing the issue.
Problem solved now.
‎2014 Jan 21 1:18 PM
Hi Anh,
Can u tel me what customization issue caused this problem...I too facing the same problem.