‎2008 Jul 22 3:23 PM
Hello,
I have a problem with this BAPI. It always provides an error BZN 205 if I try to change an activity in the operation table. However, the activity is available in the order. So I do not know why this method do not find this activity?
For instance if I call BAPI_ALM_OPERATION_GET_DETAIL then I get the activity from the order. Why can I do change this activitiy in the BAPI_ALM_ORDER_MAINTAIN. Can someone provide a code example how to fill the operation table of this bapi.
Kind regards,
Erkan
‎2008 Jul 23 4:30 PM
Hi,
You need to first fill the IT_METHODS internal table as to what all tables u are going to update.
For eg: for operation update
Method
CLEAR l_kount.
l_kount = l_kount + 1.
l_wa_methods-refnumber = l_kount.
l_wa_methods-objecttype = 'OPERATION'.
l_wa_methods-method = 'CHANGE'.
CONCATENATE p_orderid '0010' INTO l_wa_methods-objectkey.
APPEND l_wa_methods TO l_t_methods.
CLEAR l_wa_methods.
Then u have to fill the operation and operation_up tables
Operation
l_wa_operation-activity = '0010'.
l_wa_operation_up-activity = c_x.
APPEND l_wa_operation TO l_t_operation.
APPEND l_wa_operation_up TO l_t_operation_up.
Hope this clarifies your doubt. One thing to remember is always populate the Methods and then populate the Corresponding tables
Regards,
Hari
‎2008 Jul 24 12:12 PM
Hello Hari,
I try this also, but I get the same error as before:
TYPE ID NUM The changed activity 0010 cannot be found
E IWO_BAPI 205
Is there an other possibility to update the operation activity in the order?
Kind regards,
Erkan
‎2010 Sep 19 8:10 AM
hi,
CONCATENATE p_orderid '0010' INTO l_wa_methods-objectkey.
Edited by: pan_cailiang on Sep 19, 2010 9:11 AM
‎2012 Sep 21 6:59 PM
Please see SAP Note 1038447 Cannot change BAPI_ALM_ORDER_MAINTAIN suboperation number
‎2013 Aug 29 10:51 AM
Hi everyone,
I don't know if it will suit for everyone, but after much searching in BAPI_ALM_ORDER_MAINTAIN, I found a solution.
First I explain:
-After several tests, I found that BAPI_ALM_ORDER_MAINTAIN uses IBAPI_PROC_METHOD_TABLE_EXEC and line 180, uses LIBAPI_ALM_ORDER_PROCESSINGF05.
Now, line 29 to 31, you begin to understand how "l_wa_methods-objectKey" must be composed.
But as you can see, orderid must be composed of 12 characters.
Or, for example, my orderid's are made ​​like this: "4002261".
-So, the solution is to add the missing characters to make 12.
I take an exemple which is working for me :
DATA orderid TYPE string.
orderid = '4002261'.
CLEAR wa_methods.
wa_methods-refnumber = '000001'.
wa_methods-objecttype = 'OPERATION'.
wa_methods-method = 'CHANGE'.
CONCATENATE '00000' orderid '0010' INTO wa_methods-objectkey.
APPEND wa_methods TO it_methods.
CLEAR wa_operation.
wa_operation-activity = '0010'.
wa_operation-work_activity = 90.
wa_operation-un_work = 'MIN'.
APPEND wa_operation TO it_operation.
CLEAR wa_operation_up.
wa_operation_up-activity = 'X'.
wa_operation_up-work_activity = 'X'.
wa_operation_up-un_work = 'X'.
APPEND wa_operation_up TO it_operation_up.
CLEAR wa_methods.
wa_methods-refnumber = '000001'.
wa_methods-objecttype = ''.
wa_methods-method = 'SAVE'.
wa_methods-objectkey = orderid.
APPEND wa_methods TO it_methods.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
IT_METHODS = it_methods
IT_OPERATION = it_operation
IT_OPERATION_UP = it_operation_up
RETURN = it_return
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
CALL FUNCTION 'DEQUEUE_ALL'
EXPORTING
_SYNCHRON = 'X'.
commit work and wait.
I hope that will help some people.