on 2023 Oct 07 4:33 PM
Hi Experts,
I need to create follow up Work Orders(WO). I am first trying to run Se37 followed by BAPI_commit.
I am trying to create a follow-up order for an existing WO using BAPI_ALM_ORDER_MAINTAIN.
The return RETURN & ET_NUMBERS table parameters showing nothing(empty) after executing in SE37.
I am filling the IT_METHODS tab in BAPI_ALM_ORDER_MAINTAIN as below:
objecttype = 'FOLLOWUPHDR'.
method = 'CREATE'.
objectkey = %00000000001
method = 'SAVE'.
In IT_HEADER:
ORDERID = %00000000001
ORDER_TYPE = ‘OTYPE1’.
Some fields..
REFERENCE_ORDER = ‘Exis Order#’.
IT_HEADER_UP:
All above fields as applicable with ‘X’ in IT_HEADER_UP[] table.
Am i missing something here. Pls help
Request clarification before answering.
Read this OSS note: 2074666 - Create subsequent order using BAPI improvement note
(Of course I suppose you already activated Business function LOG_EAM_CI_7)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raymond,
LOG_EAM_CI_7 is activated.
The OSS note 2074666 - says it cannot be implemented.
Any other suggestions please?
ricky.shaw Did you read the explanation in the note 2074666 - Create subsequent order using BAPI improvement note, with the example code how to call the BAPI?
Read the note, compare your code with the sample
Hi Raymond, Pls see below: The methods are updated with already existing order#(0002000000221). For this order # i need to create a follow-on order.
ls_methods-refnumber = 1.
ls_methods-objecttype = 'FOLLOWUPHDR'.
ls_methods-method = 'CREATE'.
ls_methods-objectkey(12) = '0002000000221'.
APPEND ls_methods TO lt_methods.
CLEAR: ls_header.
CLEAR: ls_header_up.
Remember this method will only create the link between orders, you have also to fill parameters as for another order creation.
Hola ricky.shaw
El uso de esta bapi es un poco complejo, con respecto al número de la orden, previamente debes crear una logica en identificar cual es la última orden que existe en la tabla, y debes proponer el siguiente número de orden.
Despúes, toda orden de mantenimiento minimo debe tener una operación, porl o tanto debe llenar una linea de la tabla IT_OPERATIONS.
Tambien prueba ejecuntado de la siguiente forma:
ALM_ME_ORDER_CREATE
ALM_ME_ORD_BAPI_ORDER_POST
BAPI_ALM_ORDER_MAINTAIN
-------------------------------------------------------------------------------------
Hello Ricky
ShawThe use of this bapi is a bit complex, with respect to the order number, you must previously create a logic to identify which is the last order that exists in the table, and you must propose the next order number.Next, every minimum maintenance order must have an operation, therefore it must fill a line of the IT_OPERATIONS table.
Also try running it as follows:
ALM_ME_ORDER_CREATE
ALM_ME_ORD_BAPI_ORDER_POST
BAPI_ALM_ORDER_MAINTAIN
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why answering 50% Spanish 50% English if the question is English? If you don't speak English, trust the translator and paste English only, Spanish is just polluting. My 2 cents.
Hi Raymond & others
I implemented the code as per the oss note below:
DATA: lt_methods TYPE TABLE OF bapi_alm_order_method,
ls_methods LIKE LINE OF lt_methods,
lt_header TYPE TABLE OF bapi_alm_order_headers_i,
ls_header LIKE LINE OF lt_header,
lt_header_up TYPE TABLE OF bapi_alm_order_headers_up,
ls_header_up LIKE LINE OF lt_header_up,
lt_return TYPE STANDARD TABLE OF bapiret2,
ls_return TYPE bapiret2.
* * INITIALIZATION
REFRESH: lt_methods, lt_header, lt_header_up.
* * CHANGE HEADER TEXT (to same value - test)
CLEAR: ls_methods.
ls_methods-refnumber = 1.
ls_methods-objecttype = 'FOLLOWUPHDR'.
ls_methods-method = 'CREATE'.
ls_methods-objectkey(12) = '%00000000001'.
APPEND ls_methods TO lt_methods.
CLEAR: ls_header.
CLEAR: ls_header_up.
ls_header_up-orderid = '%00000000001'.
ls_header_up-short_text = 'X'.
APPEND ls_header_up TO lt_header_up.
* * SAVE
CLEAR: ls_methods.
ls_methods-refnumber = 1.
ls_methods-method = 'SAVE'.
APPEND ls_methods TO lt_methods.
* Appended the IT_HEADER, IT_HEADER_UP tables
mainly LS_HEADE-REFERENCE_ORDER = 'Existing Parent Order#' "2000000201
& other fields
*Filling up the IT_OPERATIONS, IT_OPERATIONS_UP<br>
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods
it_header = lt_header
it_header_up = lt_header_up
return = lt_return
et_numbers = lt_numbers
READ TABLE lt_return INTO ls_return WITH KEY type = 'E'.
IF sy-subrc NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.<br>***lt_return[] is always empty in above.
<br>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
8 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.