0

Hello I want to change the status of a PM order to TECO. For that I am using the BAPI BAPI_ALM_ORDER_MAINTAIN.

This is my code, but it doesn't work. What am I doing wrong?

DATA: lt_alm_order_method TYPE TABLE OF bapi_alm_order_method,
      ls_alm_order_method TYPE bapi_alm_order_method.

ls_alm_order_method-refnumber = '00001'.
ls_alm_order_method-objecttype = 'HEADER'.
ls_alm_order_method-method = 'TECHNICALCOMPLETE'.
ls_alm_order_method-objectkey = '000000900085'.
APPEND ls_alm_order_method TO lt_alm_order_method.

CLEAR : ls_alm_order_method .
ls_alm_order_method-refnumber ='00001'.
ls_alm_order_method-objecttype = space.
ls_alm_order_method-method = 'SAVE'.
ls_alm_order_method-objectkey = '000000900085'.
APPEND ls_alm_order_method TO lt_alm_order_method.


CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
* EXPORTING
 *   IV_MMSRV_EXTERNAL_MAINTENACE       =
TABLES
   it_methods = lt_alm_order_method.



CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Lingo
  • 580
  • 2
  • 7
  • 26
  • How do you asess that `your code doesn't work`? Set up the return parameter and check what it returns – Suncatcher Mar 19 '18 at 11:59
  • I get this messages in the return parameter: `Order saved with number` & `BAPI control was ended` EDIT: NOW it works, don't know what was wrong... – Lingo Mar 20 '18 at 10:05
  • So everything should be fine (=changed) after the commit. Doublecheck! – Suncatcher Mar 20 '18 at 10:07
  • @Suncatcher yes now it worked. Don't know where my fault was :/ I just left the refnumber empty... – Lingo Mar 20 '18 at 10:08

0 Answers0