2013 Sep 10 9:24 AM
I try to release a serviceorder with IBAPI_ALM_ORDER_RELEASE but it's only working partially
the order seems to be released (sys status = REL) but the phase in the aufk table is not changed .
the green flag for release is still visible in the screen when I call up the order with iw32.
settlement is filled correctly.
so it seems some steps are missing in this ibapi ?
how can I set the phase of the order to set flag phase1 ?
both the serviceorder release and the ibapi go through
LCOIHF3B for release of order.
kind regards
arthur
2013 Sep 19 8:38 AM
2015 Dec 29 9:38 AM
You need to us bapi BAPI_ALM_ORDER_MAINTAIN
Here is example that works for me:
APPEND INITIAL LINE TO lt_methods ASSIGNING FIELD-SYMBOL(<ls_methods>).
<ls_methods>-refnumber = '000001'.
<ls_methods>-objecttype = 'HEAD'
<ls_methods>-method = 'RELEASE'.
<ls_methods>-objectkey = lv_aufnr.
APPEND INITIAL LINE TO lt_methods ASSIGNING <ls_methods> .
<ls_methods>-refnumber = '000001'.
<ls_methods>-method = 'SAVE'
<ls_methods>-objectkey = lv_aufnr.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods "
return = lt_return. " Return Parameter(s),
LOOP AT lt_return TRANSPORTING NO FIELDS WHERE type EQ 'E' .
MOVE 'X' TO lv_error.
ENDLOOP.
IF lv_error NE 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
READ TABLE lt_return ASSIGNING FIELD-SYMBOL(<ls_return>) WITH KEY id = zcl_tm1_constants=>cs_order_bapiret-iwo_message number = zcl_tm1_constants=>cs_order_bapiret-succres_save_no.
IF sy-subrc = 0.
ev_order_no = <ls_return>-message_v2.
ENDIF.
ELSE.
et_return = lt_return.
ENDIF.