‎2010 Jun 19 1:34 PM
Hi,
I am trying to delete component from work order. my logic below:
wa_method-refnumber = 000001.
wa_method-objecttype = 'COMPONENT'.
wa_method-method = 'DELETE'.
wa_method-objectkey = p_order.
APPEND wa_method TO int_method.
wa_method-refnumber = 000001.
wa_method-objecttype = ''.
wa_method-method = 'SAVE'.
wa_method-objectkey = p_order.
APPEND wa_method TO int_method.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = int_method
return = int_return.
after this FM call I am getting these messages returned from "return table"
"Entry 1 in table COMPONENT (method DELETE) was not found"
"Error during processing of BAPI methods"
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ''
IMPORTING
return = wa_return.
your help is appreciated ...
thanks.
‎2010 Jun 21 12:59 AM
Hi,
you have to fill table IT_COMPONENT. Here is a quote from BAPI documentation.
However, as this is not the unique component key, you can only access the components to change them, delete them, or add long texts by using the reservation number/item, which is only given after saving.
In your record for method DELETE you correctly point to the first component but there is no first component. Try to add a record to table IT_COMPONENT with correct reservation number/item.
Cheers
‎2021 Oct 26 5:29 PM
Hello, i'm having the same issue but deleting an operation that already have components assigned.
@MartinVoros, can you please tellme where can i find that documentation you're talking about?
Have a link?
Thanks in advance
Mariano