10-10-2008 3:19 AM
Hi, experts, I have such requirement that change quantity of a component or add a component, add a operation into current routing.
I have look up answer, but can not find the right one.
BAPI_PRODORD_CHANGE only can change header data.
BAPI_ALM_ORDER_MAINTAIN seems can not change production orders, it is for service orders.
CO_XT_ORDER_CHANGE will assign a new routing number and a new bom number.
Could somebody give me some FM and BAPI for reference? Thanks in advance.
10-10-2008 4:42 AM
Hi,
BAPI_ALM_ORDER_MAINTAIN : Can be used to change production orders also, i have used it.
Thanks & Regards,
Navneeth K.
10-10-2008 4:42 AM
Hi,
BAPI_ALM_ORDER_MAINTAIN : Can be used to change production orders also, i have used it.
Thanks & Regards,
Navneeth K.
10-10-2008 4:47 AM
10-10-2008 4:47 AM
10-14-2008 3:03 AM
10-14-2008 7:12 AM
Hey Rick,
Even I'm stucked up with the same issue. Do let me know if you have found any solution. I'm trying out with the FM BAPI_ALM_ORDER_MAINTAIN to alter the components data. But being popped out with error messages.
Regards,
Naresh.
10-14-2008 7:24 AM
I have no solution until now, I get error message 'Order type cannot be used for maintenance orders', I think production orders can not be processed by this BAPI, maybe we need to find another way to change component/routing of production order, for example BDC, but it has poor performance. Anyway, if i found any solution except BDC, i will show it.
10-14-2008 10:36 AM
Rick,
we can process the Production Orders with the function module. I tested it and it seems to be working fine.
But, I'm unable to change the 'Requirement Quantity' of the components data. Though the FM is returning a Success message saying the Order has been saved but the quantity is not changing.
I'm debugging the FM now to see wats exactly happening.
You try it with other test cases.
Cheers!!!
Naresh
10-14-2008 10:46 AM
Hi Rick,
Sorry for the delayed response, check this link :
http://www.sapfans.com/forums/viewtopic.php?f=13&t=182938
I have already worked on changing the component, component quantity and all using the bapi. Trying to put you the perfect code soon.
Mean time you can check the above link, it is for service orders but same will apply for the production orders also just be careful when you are giving the "Objectkey", to know how to put objectkey check the bapi documenation, its given in the best way.
Thanks & Regards,
Navneeth K.
10-15-2008 6:54 AM
Hi Rick,
Have you found the solution ?
Thanks & Regards,
Navneeth K.
10-15-2008 9:43 AM
Rick,
The function module works out. Call Bapi_transaction_commit immediately after calling the FM BAPI_ALM_ORDER_MAINTAIN.
Navneet, Thanks for your inputs. I have another query regarding this. Do we need to call the FM twice in order to change Muliple components data? Coz, when I try to change Two Components data of a Production Order, only the First component's data is being changed but the second one remains the same.
let me know your comments
Cheers!!!
Naresh
10-15-2008 10:33 AM
Not yet, I still get the message ''Order type cannot be used for maintenance orders' despite I follow others' source code.
10-15-2008 10:38 AM
Hi, Naresh, could you show your source code to me? Thanks in advance. I get error message, so i think it is no matter with Bapi_transaction_commit.
10-15-2008 11:38 AM
Hi Rick,
Follow the below sample steps for changing component quantity:
DATA:
l_methods TYPE bapi_alm_order_method,
it_boperations TYPE STANDARD TABLE OF bapi_alm_order_operation_e WITH HEADER LINE,
it_components TYPE STANDARD TABLE OF bapi_alm_order_component_e WITH HEADER LINE,
it_components1 TYPE STANDARD TABLE OF bapi_alm_order_component WITH HEADER LINE.
1. Call BAPI :BAPI_ALM_ORDER_GET_DETAIL , it will give existing order component details.
CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
EXPORTING
number = <production order number>
TABLES
et_operations = it_boperations
et_components = it_components
return = it_bapiret2.
2. Move it_components to components table compatibel to BAPI "BAPI_ALM_ORDER_MAINTAIN".
LOOP AT it_components.
MOVE-CORRESPONDING it_components TO it_components1.
_*"Note here while moving change the component quantity"*_
APPEND it_components1.
CLEAR it_components1.
ENDLOOP.
3. Build the methods table for change production order :
it_methods-refnumber = v_refnumber.
it_methods-objecttype = 'COMPONENT'.
it_methods-method = 'CHANGE'.
it_methods-objectkey = v_objectkey.
APPEND it_methods.
"Note v_refnumber has 1 to 1 relation ship with the components table, if you want to change First component in it_components1 then you have to enter value '1' here for v_refnumber.
it_methods-method = 'SAVE'.
APPEND it_methods.
4 . Call
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = it_methods
it_component = it_components1
return = it_bapiret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
10-15-2008 11:40 AM
Naresh, we need not call the BAPI twice you can append all componments in the same table and make sure you populate methods table perfectly, it has a one to one relationship with the compoents and operation table
10-15-2008 12:43 PM
Navneeth,
In the example given, if my requirement is to change the 1st and the last component in the table i_components1 then what should be the reference number v_ref ? and do I need to fillin the methods twice?
Naresh!!
10-28-2008 3:21 AM
HI,all, thanks for all of your replies, the bapi only can change the orders with order category = '30', but not '10.