[Home] [Help]
4571: l_old_oks_cp_rec OKS_IBINT_PUB.CP_REC_TYPE;
4572: l_new_oks_cp_rec OKS_IBINT_PUB.CP_REC_TYPE;
4573: l_ctr_grp_id_template NUMBER;
4574: l_ctr_grp_id_instance NUMBER;
4575: l_ctr_id_template csi_counter_template_pub.ctr_template_autoinst_tbl;
4576: l_ctr_id_instance csi_counter_template_pub.counter_autoinstantiate_tbl;
4577: l_msg_count NUMBER;
4578: l_msg_data VARCHAR2(100);
4579: l_msg_index NUMBER;
4572: l_new_oks_cp_rec OKS_IBINT_PUB.CP_REC_TYPE;
4573: l_ctr_grp_id_template NUMBER;
4574: l_ctr_grp_id_instance NUMBER;
4575: l_ctr_id_template csi_counter_template_pub.ctr_template_autoinst_tbl;
4576: l_ctr_id_instance csi_counter_template_pub.counter_autoinstantiate_tbl;
4577: l_msg_count NUMBER;
4578: l_msg_data VARCHAR2(100);
4579: l_msg_index NUMBER;
4580: l_line_count NUMBER;
6176: -- by rtalluri for the enh. 2308703
6177: IF NOT((l_serial_control IN (1,6)) AND
6178: (p_instance_rec.location_type_code = 'INVENTORY')) THEN
6179:
6180: -- Since the replacement API CSI_COUNTER_TEMPLATE_PUB does not
6181: -- for CS_Counters_PUB.Ctr_Grp_Template_Exists
6182: -- does not provide a function Ctr_Grp_Template_Exists,
6183: -- Hence writing the following code...
6184: --l_counter_group_id := NULL;
6200: CS_Counters_PUB.AutoInstantiate_Counters */
6201: IF l_counter_group_id <> 0
6202: THEN
6203: -- CS_Counters_PUB.AutoInstantiate_Counters
6204: csi_counter_template_pub.autoinstantiate_counters
6205: ( p_api_version => 1.0
6206: ,p_init_msg_list => FND_API.G_FALSE
6207: ,p_commit => FND_API.G_FALSE
6208: ,x_return_status => x_return_status
6219:
6220: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS)
6221: THEN
6222: FND_MESSAGE.SET_NAME('CSI','CSI_API_NO_COUNTER_ASSOCIATION');
6223: FND_MESSAGE.SET_TOKEN('COUNTER','CSI_COUNTER_TEMPLATE_PUB.AUTOINSTANTIATE_COUNTERS');
6224: FND_MSG_PUB.Add;
6225: RAISE FND_API.G_EXC_ERROR;
6226: END IF;
6227: -- srramakr Bug # 2255391. In CTO, since the configured item is created as a part of Sales Order
6259: l_ctr_item_associations_rec.associated_to_group := ctr_rec.associated_to_group;-- Added for bug 9142776
6260: END IF;
6261:
6262: --CS_Counters_PUB.Create_Ctr_Association
6263: csi_counter_template_pub.create_item_association
6264: (p_api_version => 1.0
6265: ,p_commit => fnd_api.g_false
6266: ,p_init_msg_list => fnd_api.g_false
6267: ,p_validation_level => p_validation_level
6276: --
6277: --IF CS_Counters_PUB.Ctr_Grp_Template_Exists(p_instance_rec.inventory_item_id) THEN
6278: IF l_counter_group_id <> 0 THEN
6279:
6280: csi_counter_template_pub.autoinstantiate_counters
6281: ( p_api_version => 1.0
6282: ,p_init_msg_list => FND_API.G_FALSE
6283: ,p_commit => FND_API.G_FALSE
6284: ,x_return_status => x_return_status
6293: ,p_organization_id => l_last_vld_organization_id -- srramakr. should pass the organization_id
6294: );
6295: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
6296: FND_MESSAGE.SET_NAME('CSI','CSI_API_NO_COUNTER_ASSOCIATION');
6297: FND_MESSAGE.SET_TOKEN('COUNTER','CSI_COUNTER_TEMPLATE_PUB.AUTOINSTANTIATE_COUNTERS');
6298: FND_MSG_PUB.Add;
6299: RAISE FND_API.G_EXC_ERROR;
6300: END IF; -- return status
6301: END IF; -- ctr. grp template exists1
11717: l_exists_flag VARCHAR2(1);
11718: l_valid_flag VARCHAR2(1);
11719: l_ctr_grp_id_template NUMBER;
11720: l_ctr_grp_id_instance NUMBER;
11721: l_ctr_id_template csi_counter_template_pub.ctr_template_autoinst_tbl;
11722: l_ctr_id_instance csi_counter_template_pub.counter_autoinstantiate_tbl;
11723: l_base_item_id NUMBER;
11724: l_ctr_association_id NUMBER;
11725: l_association_type VARCHAR2(30) := 'PROD_ITEM';
11718: l_valid_flag VARCHAR2(1);
11719: l_ctr_grp_id_template NUMBER;
11720: l_ctr_grp_id_instance NUMBER;
11721: l_ctr_id_template csi_counter_template_pub.ctr_template_autoinst_tbl;
11722: l_ctr_id_instance csi_counter_template_pub.counter_autoinstantiate_tbl;
11723: l_base_item_id NUMBER;
11724: l_ctr_association_id NUMBER;
11725: l_association_type VARCHAR2(30) := 'PROD_ITEM';
11726: -- l_desc_flex CS_COUNTERS_EXT_PVT.DFF_Rec_Type;
14817: (p_instance_rec.accounting_class_code = 'CUST_PROD' AND
14818: p_instance_rec.accounting_class_code <> l_curr_instance_rec.accounting_class_code) ) THEN
14819: IF NOT((l_serial_control IN (1,6)) AND
14820: (l_get_instance_rec.location_type_code = 'INVENTORY')) THEN
14821: -- Since the replacement API CSI_COUNTER_TEMPLATE_PUB
14822: -- for CS_Counters_PUB.Ctr_Grp_Template_Exists
14823: -- does not provide a function Ctr_Grp_Template_Exists,
14824: -- Hence writing the following code...
14825: --l_counter_group_id := NULL;
14856: FND_File.Put_Line(Fnd_File.LOG,'Calling counter instantiate');
14857:
14858: csi_gen_utility_pvt.put_line('Calling Autoinstantiate counters');
14859:
14860: csi_counter_template_pub.autoinstantiate_counters
14861: ( p_api_version => 1.0
14862: ,p_init_msg_list => FND_API.G_FALSE
14863: ,p_commit => FND_API.G_FALSE
14864: ,x_return_status => x_return_status
14875:
14876: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS)
14877: THEN
14878: FND_MESSAGE.SET_NAME('CSI','CSI_API_NO_COUNTER_ASSOCIATION');
14879: FND_MESSAGE.SET_TOKEN('COUNTER','CSI_COUNTER_TEMPLATE_PUB.AUTOINSTANTIATE_COUNTERS');
14880: FND_MSG_PUB.Add;
14881: RAISE FND_API.G_EXC_ERROR;
14882: END IF;
14883: END IF;
14916: IF(ctr_rec.associated_to_group = 'Y') THEN
14917: l_ctr_item_associations_rec.associated_to_group := ctr_rec.associated_to_group;-- Added for bug 9142776
14918: END IF;
14919:
14920: csi_counter_template_pub.create_item_association
14921: (p_api_version => 1.0
14922: ,p_commit => fnd_api.g_false
14923: ,p_init_msg_list => fnd_api.g_false
14924: ,p_validation_level => p_validation_level
14934: -- IF CS_Counters_PUB.Ctr_Grp_Template_Exists(l_get_instance_rec.inventory_item_id) THEN
14935: IF l_counter_group_id <> 0
14936: THEN
14937:
14938: csi_counter_template_pub.autoinstantiate_counters
14939: ( p_api_version => 1.0
14940: ,p_init_msg_list => FND_API.G_FALSE
14941: ,p_commit => FND_API.G_FALSE
14942: ,x_return_status => x_return_status
14951: ,p_organization_id => l_last_vld_organization_id -- srramakr. should pass the organization_id
14952: );
14953: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
14954: FND_MESSAGE.SET_NAME('CSI','CSI_API_NO_COUNTER_ASSOCIATION');
14955: FND_MESSAGE.SET_TOKEN('COUNTER','CSI_COUNTER_TEMPLATE_PUB.AUTOINSTANTIATE_COUNTERS');
14956: FND_MSG_PUB.Add;
14957: RAISE FND_API.G_EXC_ERROR;
14958: END IF;
14959: END IF; -- COunter template existance check for the new item