on ‎2023 Dec 07 8:14 AM
Hello Everyone,
i try to create RFC delete maintenance order using BAPI_ALM_ORDER_MAINTENANCE, but i got error "Operation number does not exist (check entry)". what is missing from my code?
my code:
FUNCTION ZFM_CHANGE_ORDER.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(NO_ORDER) TYPE AUFNR OPTIONAL
*" VALUE(NO_ITEM) TYPE RSPOS OPTIONAL
*" VALUE(NO_MATERIAL) TYPE MATNR OPTIONAL
*" TABLES
*" GT_ADD_COMPONENTS STRUCTURE ZST_COMPONENTS_CO OPTIONAL
*" GT_EDIT_COMPONENTS STRUCTURE ZST_COMPONENTS_CO OPTIONAL
*"----------------------------------------------------------------------
DATA: it_methods TYPE STANDARD TABLE OF bapi_alm_order_method,
it_header TYPE STANDARD TABLE OF bapi_alm_order_headers_i WITH HEADER LINE,
wa_header LIKE LINE OF it_header,
it_header_up TYPE STANDARD TABLE OF bapi_alm_order_headers_up,
wa_header_up LIKE LINE OF it_header_up,
wa_methods LIKE LINE OF it_methods,
et_numbers TYPE STANDARD TABLE OF bapi_alm_numbers,
wa_numbers LIKE LINE OF et_numbers,
return TYPE STANDARD TABLE OF bapiret2,
it_operation type bapi_alm_order_operation occurs 0 with header line,
it_component type bapi_alm_order_component occurs 0 with header line,
wa_component LIKE LINE OF it_component,
wa_return LIKE LINE OF return.
CLEAR wa_methods.
wa_methods-refnumber = '000001'.
wa_methods-objecttype = 'COMPONENT'.
wa_methods-method = 'DELETE'.
CONCATENATE NO_ORDER NO_ITEM INTO wa_methods-objectkey.
APPEND wa_methods TO it_methods.
CLEAR wa_methods.
wa_methods-refnumber = '000001'.
wa_methods-objecttype = ''.
wa_methods-method = 'SAVE'.
CONCATENATE NO_ORDER NO_ITEM INTO wa_methods-objectkey.
APPEND wa_methods TO it_methods.
it_component-res_item = '0010'.
APPEND it_component.
it_operation-ACTIVITY = '0010'.
APPEND it_operation.
it_header-orderid = no_order.
APPEND it_header.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = it_methods
it_operation = it_operation
it_component = it_component
it_header = it_header
return = return
et_numbers = et_numbers.
ENDFUNCTION.
The suggestions or answers you gave really helped me 🙂
Request clarification before answering.
i found solution for this issue, if you have some issue about change/delete/add operations or components with bapi_alm_order_maintain, contact me in this forum 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Execute a small test with SE37 on BAPI_ALM_ORDER_GET_DETAIL to check actual values of Operation Number returned by the BAPI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 39 | |
| 26 | |
| 21 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.