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

DELETE order component using BAPI 'BAPI_ALM_ORDER_MAINTAIN'

Former Member
0 Likes
2,232

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.

2 REPLIES 2
Read only

mvoros
Active Contributor
0 Likes
944

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

Read only

mjchiappe
Discoverer
0 Likes
944

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