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 IBAPI_ALM_ORDER_RELEASE

Former Member
0 Likes
1,176

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

2 REPLIES 2
Read only

Former Member
0 Likes
812

solved by using bapi_alm_order_maintain with method release

Read only

0 Likes
812

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.