Hello,
We are using Apps 10, UPD13.
We have sales parts in SITE1 (approx. 500K) and are trying to create the same sales parts in SIT99 using the script below but are getting an error message that the part already exists. They already exist as inventory parts in both SITE1 and SIT99.
Is anyone able to help us with resolving the error and creating the sales parts in SIT99 that already exist in SITE1?
Thank you,
Joann
DECLARE
p0 VARCHAR2(32) := NULL;
p1 VARCHAR2(32) := NULL;
p2 VARCHAR2(32) := NULL;
attr_ VARCHAR2(32000);
action_ VARCHAR2(30) := 'DO';
CURSOR get_part_info_ IS
SELECT i.CONTRACT, i.PART_NO, p.CF$_SALES_GROUP
FROM inventory_part i
left outer join sales_part s
on i.part_no = s.part_no
and i.contract = s.contract
left outer join
PRODUCT_CODE_X_REF_CLV p
on i.second_commodity = p.cf$_comm_group_2
and i.part_product_code = p.cf$_product_code
where
i.contract = 'SIT99'
and i.part_no like '%2'
and length(i.part_no) = 11
and s.part_no is null
and p.CF$_SALES_GROUP is not null
;
part_ get_part_info_%rowtype;
BEGIN
OPEN get_part_info_ ;
FETCH get_part_info_ INTO part_;
CLOSE get_part_info_ ;
FOR rec_ IN get_part_info_ LOOP
-- Client_SYS.Clear_Attr( attr_);
-- Client_SYS.Add_To_Attr('CONTRACT', part_.CONTRACT, attr_);
-- Client_SYS.Add_To_Attr('COMPANY', '99', attr_);
-- Client_SYS.Add_To_Attr('CATALOG_NO', part_.PART_NO, attr_);
-- Client_SYS.Add_To_Attr('PART_NO', part_.PART_NO, attr_);
-- Client_SYS.Add_To_Attr('CONV_FACTOR', 1, attr_);
-- Client_SYS.Add_To_Attr('INVERTED_CONV_FACTOR', 1, attr_);
-- Client_SYS.Add_To_Attr('PRICE_CONV_FACTOR', 1, attr_);
-- Client_SYS.Add_To_Attr('LIST_PRICE', 0, attr_);
-- Client_SYS.Add_To_Attr('CATALOG_GROUP', part_.CF$_SALES_GROUP, attr_);
-- Client_SYS.Add_To_Attr('CATALOG_TYPE_DB', 'INV', attr_);
-- Client_SYS.Add_To_Attr('CLOSE_TOLERANCE', 0, attr_);
-- Client_SYS.Add_To_Attr('TAXABLE', 'True', attr_);
-- Client_SYS.Add_To_Attr('SOURCING_OPTION_DB', 'INVENTORYORDER', attr_);
-- Client_SYS.Add_To_Attr('SALES_UNIT_MEAS', 'EA', attr_);
-- Client_SYS.Add_To_Attr('PRICE_UNIT_MEAS', 'EA', attr_);
-- Client_SYS.Add_To_Attr('SALES_PRICE_UNIT_ID', '*', attr_);
-- Client_SYS.Add_To_Attr('SALES_PRICE_UNIT_ID', '*', attr_);
-- Client_SYS.Add_To_Attr('SALES_PRICE_GROUP_ID', '*', attr_);
-- Client_SYS.Add_To_Attr('USE_PRICE_INCL_TAX', 'False', attr_);
-- SALES_PART_API.new__(p0, p1, p2, attr_, action_);
sales_part_api.create_sales_part (
part_.contract, -- contract_ IN VARCHAR2,
part_.part_no, -- catalog_no_ IN VARCHAR2,
1, -- conv_factor_ IN NUMBER,
1, -- inverted_conv_factor_ IN NUMBER,
1, -- price_conv_factor_ IN NUMBER,
0, -- list_price_ IN NUMBER,
0, -- expected_average_price_ IN NUMBER,
0, -- minimum_qty_ IN NUMBER,
0, -- close_tolerance_ IN NUMBER,
NULL, -- date_of_replacement_ IN DATE,
'Inventory Order', -- sourcing_option_ IN VARCHAR2,
'Active part', -- activeind_ IN VARCHAR2,
'True', -- taxable_ IN VARCHAR2,
'False', -- export_to_external_app_ IN VARCHAR2,
'Do not create SM object', -- create_sm_object_option_ IN VARCHAR2,
NULL, -- rule_id_ IN VARCHAR2,
'EA', -- sales_unit_meas_ IN VARCHAR2,
'EA', -- price_unit_meas_ IN VARCHAR2,
'*', -- sales_price_group_id_ IN VARCHAR2,
part_.CF$_SALES_GROUP, -- catalog_group_ IN VARCHAR2,
NULL, -- discount_group_ IN VARCHAR2,
NULL, -- tax_code_ IN VARCHAR2,
NULL, -- replacement_part_no_ IN VARCHAR2,
NULL, -- delivery_type_ IN VARCHAR2,
NULL, -- sales_part_rebate_group_ IN VARCHAR2,
NULL -- tax_class_id_ IN VARCHAR2 DEFAULT NULL
);
END LOOP;
END;
Error report -
ORA-20112: SalesPart.FND_RECORD_EXIST: The Sales Part already exists.
ORA-06512: at "NORT1APP.ERROR_SYS", line 140
ORA-06512: at "NORT1APP.ERROR_SYS", line 422
ORA-06512: at "NORT1APP.SALES_PART_API", line 2605
ORA-06512: at "NORT1APP.SALES_PART_API", line 2609
ORA-06512: at "NORT1APP.SALES_PART_API", line 8170
ORA-06512: at "NORT1APP.SALES_PART_API", line 8255
ORA-06512: at "NORT1APP.SALES_PART_API", line 8270
ORA-06512: at "NORT1APP.SALES_PART_API", line 6226
ORA-06512: at "NORT1APP.SALES_PART_API", line 6231
ORA-06512: at line 64
ORA-06512: at line 64