Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with TECHNICALCOMPLETE work order using BAPI_ALM_ORDER_MAINTAIN

Former Member
0 Likes
1,675

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.

1 ACCEPTED SOLUTION
Read only

chaiphon
Contributor
0 Likes
791

Try BAPI 'BAPI_ISUSMORDER_SETSTATUSTECHN'.

3 REPLIES 3
Read only

chaiphon
Contributor
0 Likes
792

Try BAPI 'BAPI_ISUSMORDER_SETSTATUSTECHN'.

Read only

Former Member
0 Likes
791

Thanks for reply. In the end it was system customization that was causing the issue.

Problem solved now.

Read only

Former Member
0 Likes
791

Hi Anh,

Can u tel me what  customization issue caused this problem...I too facing the same problem.