2010 Aug 04 3:14 PM
Hello,
I would only change the "description" text on the header of service order.
I'm uising this bapi with these parameter, but I got this error:
IWO_BAPI2 118: Impossible to save the order because no one operation managed.
Why this error, I dant have to manage operation !!!
Any idea ?
Changement text de l'ordre - start
CLEAR it_methods.
REFRESH it_methods.
it_methods-refnumber = '1'.
it_methods-objecttype = 'HEADER'.
it_methods-method = 'CHANGE'.
it_methods-objectkey = w_aufnr.
APPEND it_methods.
it_methods-objecttype = space.
it_methods-refnumber = '2'.
it_methods-method = 'SAVE'.
APPEND it_methods.
REFRESH: it_header, it_header_up.
CLEAR it_header.
it_header-short_text = 'ubaldr test'.
it_header-orderid = w_aufnr.
APPEND it_header.
it_header_up-orderid = w_aufnr.
it_header_up-short_text = 'X'.
APPEND it_header_up.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = it_methods
it_header = it_header
it_header_up = it_header_up
return = it_return_os2.
commit etc etc
Tks.
2010 Aug 04 3:29 PM
2010 Aug 04 3:59 PM
With this:
CLEAR it_methods.
REFRESH it_methods.
it_methods-objecttype = space.
it_methods-refnumber = '1'.
it_methods-method = 'SAVE'.
APPEND it_methods.
CLEAR it_methods.
it_methods-refnumber = '2'.
it_methods-objecttype = 'HEADER'.
it_methods-method = 'CHANGE'.
it_methods-objectkey = w_aufnr.
APPEND it_methods.
REFRESH: it_header, it_header_up.
CLEAR it_header.
it_header-short_text = 'ubaldr test'.
it_header-orderid = w_aufnr.
it_header-order_type = 'CS02'.
it_header-planplant = 'CIMO'.
it_header-plant = 'CIMO'.
it_header-equipment = w_bzgsobj. "'CITMOB' "T399A
it_header-material = it_order_items_in-material.
APPEND it_header.
it_header_up-orderid = w_aufnr.
it_header_up-short_text = 'X'.
APPEND it_header_up.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = it_methods
it_header = it_header
it_header_up = it_header_up
return = it_return_os2.
now the error is:
on the 2° entry of the header table, the method change dont found !!
Any idea ?
2010 Sep 03 10:32 AM
Hey,
Go with your first approach.
Do not pass any refnumber to SAVE line in methods table.
try it once.
it_methods-objecttype = space.
it_methods-refnumber = '2'.
it_methods-method = 'SAVE'.
APPEND it_methods.
shravan
2010 Sep 03 11:14 AM
Hello ,
thank you for your reply:
The reason of error was that user name using this MF have not all authorization to create a sales order.
Regards,
Roberto.