04-26-2013 10:42 AM
Hi all,
I am trying to use a BAPI that will change int workcenter name in production order (CO02).
I tried using BAPI_PRODORD_CHANGE where is entered the order no in the NUMBER parameter.But it did not work.
I also tried using BAPI_ALM_ORDER_MAINTAIN to do this.
under IT_METHODS,I am entering the following:
OBJECTTYPE-HEADER.
METHOD-CHANGE
OBJECTKEY-100001692 (pROD ORD NO).
under IT_HEADER,I am entering the following:
ORDERID.
under IT_PARTNER & IT_PARTNER_UP,I am entering the following:
ORDERID.
Under IT_OPERATION,I am entering the following:
ACTIVITY,WORK_CNT,plant
Under IT_OPERATION,I am entering the following:
ORDERID,ACTIVITY.
On executing,I get the message "Relationship type could not be converted to the internal format".
Kindly guide me what is the correct input to be given.
04-26-2013 7:14 PM
Hi,
Please find below a sample code of data passed to the function module.
***Constants -
k_num TYPE char12 VALUE '%00000000001',
k_ocd TYPE felfd VALUE '0010',
k_odtyp TYPE aufart VALUE 'PMCL',
k_hdobj TYPE obj_typ VALUE 'HEADER',
k_ratyp TYPE ila VALUE 'RCL',
k_crmtd TYPE swo_method VALUE 'CREATE',
k_ref TYPE ifrefnum VALUE '1',
k_opobj TYPE obj_typ VALUE 'OPERATION',
* IT_METHODS - HEADER
r_methods-refnumber = k_ref.
r_methods-objecttype = k_hdobj.
r_methods-method = k_crmtd.
CLEAR:v_objkey.
* CONCATENATE k_num p_v_ordernum INTO v_objkey.
r_methods-objectkey = k_num.
* r_methods-objectkey = v_objkey.
APPEND r_methods TO i_methods.
* IT_METHODS - OPERATION
r_methods-refnumber = k_ref.
r_methods-objecttype = k_opobj.
r_methods-method = k_crmtd.
CLEAR:v_objkey.
CONCATENATE k_num k_ocd INTO v_objkey.
r_methods-objectkey = v_objkey.
APPEND r_methods TO i_methods.
* IT_HEADER
r_header-orderid = k_num.
r_header-order_type = k_odtyp.
r_header-planplant = r_ordhdr-planplant.
r_header-mn_wk_ctr = r_ordhdr-mn_wk_ctr.
r_header-priority = r_ordhdr-priority.
r_header-equipment = r_ordhdr-equipment.
r_header-pmacttype = k_ratyp.
r_header-start_date = sy-datum.
r_header-finish_date = sy-datum.
r_header-short_text = v_desc.
r_header-notif_no = r_ordhdr-notif_no.
APPEND r_header TO i_header.
* IT_HEADER_UP
r_header_up-mn_wk_ctr = k_x.
r_header_up-pmacttype = k_x.
r_header_up-start_date = k_x.
r_header_up-finish_date = k_x.
r_header_up-short_text = k_x.
r_header_up-notif_no = k_x.
APPEND r_header_up TO i_header_up.
* IT_OPERATION
r_operation-activity = k_ocd.
r_operation-work_cntr = r_ordhdr-mn_wk_ctr.
r_operation-plant = r_ordhdr-planplant.
APPEND r_operation TO i_operation.
* IT_OPERATION_UP
r_operation_up-activity = k_x.
r_operation_up-work_cntr = k_x.
r_operation_up-plant = k_x.
APPEND r_operation_up TO i_operation_up.