237: END IF;
238:
239: -- check for the profile value
240: IF (l_org_id IS NULL) THEN
241: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_ORG_PRFL_NULL'); -- Profile 'AHL: Enigma Sourced Item Org' can't be NULL. (new message)
242: FND_MSG_PUB.ADD;
243: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
244: END IF;
245:
253: l_item_group_rec.operation_flag := 'C';
254: ELSIF ((l_item_group_rec.operation_flag <> 'M' AND l_item_group_rec.operation_flag <> 'D') OR
255: l_item_group_rec.operation_flag IS NULL) THEN
256: -- invalid operation flag
257: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
258: FND_MESSAGE.Set_Token('OPR_FLAG', l_item_group_rec.operation_flag);
259: FND_MSG_PUB.ADD;
260: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
261: END IF;
254: ELSIF ((l_item_group_rec.operation_flag <> 'M' AND l_item_group_rec.operation_flag <> 'D') OR
255: l_item_group_rec.operation_flag IS NULL) THEN
256: -- invalid operation flag
257: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
258: FND_MESSAGE.Set_Token('OPR_FLAG', l_item_group_rec.operation_flag);
259: FND_MSG_PUB.ADD;
260: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
261: END IF;
262:
270: FND_LOG.string(l_log_statement, l_full_name, 'no items for association');
271: END IF;
272: -- items table can't be empty for creation - it needs at least one item
273: IF (l_item_group_rec.operation_flag = 'C') THEN
274: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_AIG_NO_ITEMS'); -- At least one association item is required to create the Item Group. (new message)
275: FND_MSG_PUB.ADD;
276: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
277: END IF;
278: END IF;
286: FETCH get_ig_id_csr INTO l_item_group_rec.item_group_id;
287: IF (get_ig_id_csr%NOTFOUND) THEN
288: CLOSE get_ig_id_csr;
289: -- item group name is invalid
290: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ITEMGRP_INVALID'); -- Item Group ITEM_GRP is invalid.
291: FND_MESSAGE.Set_Token('ITEM_GRP', l_item_group_rec.name);
292: FND_MSG_PUB.ADD;
293: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
294: END IF;
287: IF (get_ig_id_csr%NOTFOUND) THEN
288: CLOSE get_ig_id_csr;
289: -- item group name is invalid
290: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ITEMGRP_INVALID'); -- Item Group ITEM_GRP is invalid.
291: FND_MESSAGE.Set_Token('ITEM_GRP', l_item_group_rec.name);
292: FND_MSG_PUB.ADD;
293: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
294: END IF;
295: CLOSE get_ig_id_csr;
331: FETCH chk_ig_type_code_csr INTO l_dummy;
332: IF (chk_ig_type_code_csr%NOTFOUND) THEN
333: CLOSE chk_ig_type_code_csr;
334: -- item group type is invalid
335: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_IG_TYPE_INVALID'); -- Item Group Type is invalid.
336: FND_MSG_PUB.ADD;
337: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
338: END IF;
339: CLOSE chk_ig_type_code_csr;
347: l_items_tbl(i).operation_flag := 'C';
348: ELSIF ((l_items_tbl(i).operation_flag <> 'M' AND l_items_tbl(i).operation_flag <> 'D') OR
349: l_items_tbl(i).operation_flag IS NULL) THEN
350: -- invalid operation flag
351: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
352: FND_MESSAGE.Set_Token('OPR_FLAG', l_items_tbl(i).operation_flag);
353: FND_MSG_PUB.ADD;
354: END IF;
355:
348: ELSIF ((l_items_tbl(i).operation_flag <> 'M' AND l_items_tbl(i).operation_flag <> 'D') OR
349: l_items_tbl(i).operation_flag IS NULL) THEN
350: -- invalid operation flag
351: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
352: FND_MESSAGE.Set_Token('OPR_FLAG', l_items_tbl(i).operation_flag);
353: FND_MSG_PUB.ADD;
354: END IF;
355:
356: -- set the inventory org id
360: OPEN get_item_id_csr (l_items_tbl(i).inventory_item_name, l_items_tbl(i).inventory_org_id);
361: FETCH get_item_id_csr INTO l_items_tbl(i).inventory_item_id;
362: IF (get_item_id_csr%NOTFOUND) THEN
363: -- item is invalid
364: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
365: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
366: FND_MSG_PUB.ADD;
367: END IF;
368: CLOSE get_item_id_csr;
361: FETCH get_item_id_csr INTO l_items_tbl(i).inventory_item_id;
362: IF (get_item_id_csr%NOTFOUND) THEN
363: -- item is invalid
364: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
365: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
366: FND_MSG_PUB.ADD;
367: END IF;
368: CLOSE get_item_id_csr;
369:
371: OPEN chk_interchg_type_code_csr (l_items_tbl(i).interchange_type_code);
372: FETCH chk_interchg_type_code_csr INTO l_dummy;
373: IF (chk_interchg_type_code_csr%NOTFOUND) THEN
374: -- item group type is invalid
375: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INTER_INVALID'); -- Interchangeability Type (INTER_CODE) for Item (INV_ITEM) is invalid.
376: FND_MESSAGE.Set_Token('INTER_CODE', l_items_tbl(i).interchange_type_code);
377: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
378: FND_MSG_PUB.ADD;
379: END IF;
372: FETCH chk_interchg_type_code_csr INTO l_dummy;
373: IF (chk_interchg_type_code_csr%NOTFOUND) THEN
374: -- item group type is invalid
375: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INTER_INVALID'); -- Interchangeability Type (INTER_CODE) for Item (INV_ITEM) is invalid.
376: FND_MESSAGE.Set_Token('INTER_CODE', l_items_tbl(i).interchange_type_code);
377: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
378: FND_MSG_PUB.ADD;
379: END IF;
380: CLOSE chk_interchg_type_code_csr;
373: IF (chk_interchg_type_code_csr%NOTFOUND) THEN
374: -- item group type is invalid
375: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INTER_INVALID'); -- Interchangeability Type (INTER_CODE) for Item (INV_ITEM) is invalid.
376: FND_MESSAGE.Set_Token('INTER_CODE', l_items_tbl(i).interchange_type_code);
377: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
378: FND_MSG_PUB.ADD;
379: END IF;
380: CLOSE chk_interchg_type_code_csr;
381: END LOOP;
460: FETCH get_ig_id_csr INTO l_item_group_rec.item_group_id;
461: IF (get_ig_id_csr%NOTFOUND) THEN
462: CLOSE get_ig_id_csr;
463: -- item group name is invalid
464: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ITEMGRP_INVALID'); -- Item Group ITEM_GRP is invalid.
465: FND_MESSAGE.Set_Token('ITEM_GRP', l_item_group_rec.name);
466: FND_MSG_PUB.ADD;
467: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
468: END IF;
461: IF (get_ig_id_csr%NOTFOUND) THEN
462: CLOSE get_ig_id_csr;
463: -- item group name is invalid
464: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ITEMGRP_INVALID'); -- Item Group ITEM_GRP is invalid.
465: FND_MESSAGE.Set_Token('ITEM_GRP', l_item_group_rec.name);
466: FND_MSG_PUB.ADD;
467: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
468: END IF;
469: CLOSE get_ig_id_csr;
473: FETCH chk_ig_type_code_csr INTO l_dummy;
474: IF (chk_ig_type_code_csr%NOTFOUND) THEN
475: CLOSE chk_ig_type_code_csr;
476: -- item group type is invalid
477: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_IG_TYPE_INVALID'); -- Item Group Type is invalid.
478: FND_MSG_PUB.ADD;
479: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
480: END IF;
481: CLOSE chk_ig_type_code_csr;
489: l_items_tbl(i).operation_flag := 'C';
490: ELSIF ((l_items_tbl(i).operation_flag <> 'M' AND l_items_tbl(i).operation_flag <> 'D') OR
491: l_items_tbl(i).operation_flag IS NULL) THEN
492: -- invalid operation flag
493: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
494: FND_MESSAGE.Set_Token('OPR_FLAG', l_items_tbl(i).operation_flag);
495: FND_MSG_PUB.ADD;
496: END IF;
497:
490: ELSIF ((l_items_tbl(i).operation_flag <> 'M' AND l_items_tbl(i).operation_flag <> 'D') OR
491: l_items_tbl(i).operation_flag IS NULL) THEN
492: -- invalid operation flag
493: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
494: FND_MESSAGE.Set_Token('OPR_FLAG', l_items_tbl(i).operation_flag);
495: FND_MSG_PUB.ADD;
496: END IF;
497:
498: -- set the inventory org id
502: OPEN get_item_id_csr (l_items_tbl(i).inventory_item_name, l_items_tbl(i).inventory_org_id);
503: FETCH get_item_id_csr INTO l_items_tbl(i).inventory_item_id;
504: IF (get_item_id_csr%NOTFOUND) THEN
505: -- item is invalid
506: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
507: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
508: FND_MSG_PUB.ADD;
509: END IF;
510: CLOSE get_item_id_csr;
503: FETCH get_item_id_csr INTO l_items_tbl(i).inventory_item_id;
504: IF (get_item_id_csr%NOTFOUND) THEN
505: -- item is invalid
506: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
507: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
508: FND_MSG_PUB.ADD;
509: END IF;
510: CLOSE get_item_id_csr;
511:
515: l_items_tbl(i).revision, l_items_tbl(i).inventory_org_id);
516: FETCH get_ia_id_csr INTO l_items_tbl(i).item_association_id;
517: IF (get_ia_id_csr%NOTFOUND) THEN
518: -- item association is invalid
519: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_IA_INVALID'); -- Invalid association of item ITEM. (new message)
520: FND_MESSAGE.Set_Token('ITEM', l_items_tbl(i).inventory_item_name);
521: FND_MSG_PUB.ADD;
522: END IF;
523: CLOSE get_ia_id_csr;
516: FETCH get_ia_id_csr INTO l_items_tbl(i).item_association_id;
517: IF (get_ia_id_csr%NOTFOUND) THEN
518: -- item association is invalid
519: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_IA_INVALID'); -- Invalid association of item ITEM. (new message)
520: FND_MESSAGE.Set_Token('ITEM', l_items_tbl(i).inventory_item_name);
521: FND_MSG_PUB.ADD;
522: END IF;
523: CLOSE get_ia_id_csr;
524: END IF;
530: OPEN chk_interchg_type_code_csr (l_items_tbl(i).interchange_type_code);
531: FETCH chk_interchg_type_code_csr INTO l_dummy;
532: IF (chk_interchg_type_code_csr%NOTFOUND) THEN
533: -- item group type is invalid
534: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INTER_INVALID'); -- Interchangeability Type (INTER_CODE) for Item (INV_ITEM) is invalid.
535: FND_MESSAGE.Set_Token('INTER_CODE', l_items_tbl(i).interchange_type_code);
536: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
537: FND_MSG_PUB.ADD;
538: END IF;
531: FETCH chk_interchg_type_code_csr INTO l_dummy;
532: IF (chk_interchg_type_code_csr%NOTFOUND) THEN
533: -- item group type is invalid
534: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INTER_INVALID'); -- Interchangeability Type (INTER_CODE) for Item (INV_ITEM) is invalid.
535: FND_MESSAGE.Set_Token('INTER_CODE', l_items_tbl(i).interchange_type_code);
536: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
537: FND_MSG_PUB.ADD;
538: END IF;
539: CLOSE chk_interchg_type_code_csr;
532: IF (chk_interchg_type_code_csr%NOTFOUND) THEN
533: -- item group type is invalid
534: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INTER_INVALID'); -- Interchangeability Type (INTER_CODE) for Item (INV_ITEM) is invalid.
535: FND_MESSAGE.Set_Token('INTER_CODE', l_items_tbl(i).interchange_type_code);
536: FND_MESSAGE.Set_Token('INV_ITEM', l_items_tbl(i).inventory_item_name);
537: FND_MSG_PUB.ADD;
538: END IF;
539: CLOSE chk_interchg_type_code_csr;
540: END LOOP;
768: IF (l_log_statement >= l_log_current_level) THEN
769: FND_LOG.string(l_log_statement, l_full_name, 'no nodes for the MC');
770: END IF;
771: -- nodes table can't be empty - it needs at least the root node
772: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_NO_NODES'); -- At least one position is required to create the Master Configuration. (new message)
773: FND_MSG_PUB.ADD;
774: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
775: END IF;
776:
780: FETCH chk_model_code_csr INTO l_dummy;
781: IF (chk_model_code_csr%NOTFOUND) THEN
782: CLOSE chk_model_code_csr;
783: -- model code is invalid
784: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_MODEL_INVALID'); -- Model "MODEL_MEANING" is invalid.
785: FND_MESSAGE.Set_Token('MODEL_MEANING', l_mc_header_rec.model_code);
786: FND_MSG_PUB.ADD;
787: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
788: END IF;
781: IF (chk_model_code_csr%NOTFOUND) THEN
782: CLOSE chk_model_code_csr;
783: -- model code is invalid
784: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_MODEL_INVALID'); -- Model "MODEL_MEANING" is invalid.
785: FND_MESSAGE.Set_Token('MODEL_MEANING', l_mc_header_rec.model_code);
786: FND_MSG_PUB.ADD;
787: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
788: END IF;
789: CLOSE chk_model_code_csr;
796: OPEN get_pos_ref_csr (l_nodes_tbl(i).position_ref_code);
797: FETCH get_pos_ref_csr INTO l_nodes_tbl(i).position_ref_meaning;
798: IF (get_pos_ref_csr%NOTFOUND) THEN
799: -- position reference code is invalid
800: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_POSREF_INVALID'); -- Position reference (POSREF) is invalid.
801: FND_MESSAGE.Set_Token('POSREF', l_nodes_tbl(i).position_ref_code);
802: FND_MSG_PUB.ADD;
803: END IF;
804: CLOSE get_pos_ref_csr;
797: FETCH get_pos_ref_csr INTO l_nodes_tbl(i).position_ref_meaning;
798: IF (get_pos_ref_csr%NOTFOUND) THEN
799: -- position reference code is invalid
800: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_POSREF_INVALID'); -- Position reference (POSREF) is invalid.
801: FND_MESSAGE.Set_Token('POSREF', l_nodes_tbl(i).position_ref_code);
802: FND_MSG_PUB.ADD;
803: END IF;
804: CLOSE get_pos_ref_csr;
805:
817: OPEN chk_ata_code_csr (l_nodes_tbl(i).ata_code);
818: FETCH chk_ata_code_csr INTO l_dummy;
819: IF (chk_ata_code_csr%NOTFOUND) THEN
820: -- model code is invalid
821: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ATASEQ_INVALID'); -- ATA Code "ATAMEANING" is invalid
822: FND_MESSAGE.Set_Token('ATAMEANING', l_nodes_tbl(i).ata_code);
823: FND_MSG_PUB.ADD;
824: END IF;
825: CLOSE chk_ata_code_csr;
818: FETCH chk_ata_code_csr INTO l_dummy;
819: IF (chk_ata_code_csr%NOTFOUND) THEN
820: -- model code is invalid
821: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ATASEQ_INVALID'); -- ATA Code "ATAMEANING" is invalid
822: FND_MESSAGE.Set_Token('ATAMEANING', l_nodes_tbl(i).ata_code);
823: FND_MSG_PUB.ADD;
824: END IF;
825: CLOSE chk_ata_code_csr;
826: END IF;
896: END LOOP;
897:
898: -- if no match found, raise exception
899: IF (l_mc_pos_stack.under_flow) THEN
900: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_PARENT_INVALID'); -- Parent position PAR_POS_REF for the position POS_REF is invalid. (new message)
901: FND_MESSAGE.Set_Token('PAR_POS_REF', l_nodes_tbl(i).parent_position_ref_code);
902: FND_MESSAGE.Set_Token('POS_REF', l_nodes_tbl(i).position_ref_code);
903: FND_MSG_PUB.ADD;
904: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
897:
898: -- if no match found, raise exception
899: IF (l_mc_pos_stack.under_flow) THEN
900: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_PARENT_INVALID'); -- Parent position PAR_POS_REF for the position POS_REF is invalid. (new message)
901: FND_MESSAGE.Set_Token('PAR_POS_REF', l_nodes_tbl(i).parent_position_ref_code);
902: FND_MESSAGE.Set_Token('POS_REF', l_nodes_tbl(i).position_ref_code);
903: FND_MSG_PUB.ADD;
904: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
905: END IF;
898: -- if no match found, raise exception
899: IF (l_mc_pos_stack.under_flow) THEN
900: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_PARENT_INVALID'); -- Parent position PAR_POS_REF for the position POS_REF is invalid. (new message)
901: FND_MESSAGE.Set_Token('PAR_POS_REF', l_nodes_tbl(i).parent_position_ref_code);
902: FND_MESSAGE.Set_Token('POS_REF', l_nodes_tbl(i).position_ref_code);
903: FND_MSG_PUB.ADD;
904: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
905: END IF;
906:
941: IF (NOT l_mc_pos_stack.over_flow) THEN
942: l_mc_pos_stack.push(l_mc_pos_ref);
943: ELSE
944: -- Position stack AHL_MC_POS_STACK object has exceeded its max_size. Please increase it to an appropriate value. (new message)
945: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_STACK_OVRFLW');
946: FND_MSG_PUB.ADD;
947: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
948: END IF;
949: END LOOP;
1128: END IF;
1129:
1130: -- check for the profile value
1131: IF (l_org_id IS NULL) THEN
1132: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_ORG_PRFL_NULL'); -- Profile 'AHL: Enigma Sourced Item Org' can't be NULL. (new message)
1133: FND_MSG_PUB.ADD;
1134: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1135: END IF;
1136:
1148: l_ic_header_rec.operation_flag := 'C';
1149: ELSIF ((l_ic_header_rec.operation_flag <> 'M' AND l_ic_header_rec.operation_flag <> 'D') OR
1150: l_ic_header_rec.operation_flag IS NULL) THEN
1151: -- invalid operation flag
1152: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
1153: FND_MESSAGE.Set_Token('OPR_FLAG', l_ic_header_rec.operation_flag);
1154: FND_MSG_PUB.ADD;
1155: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1156: END IF;
1149: ELSIF ((l_ic_header_rec.operation_flag <> 'M' AND l_ic_header_rec.operation_flag <> 'D') OR
1150: l_ic_header_rec.operation_flag IS NULL) THEN
1151: -- invalid operation flag
1152: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
1153: FND_MESSAGE.Set_Token('OPR_FLAG', l_ic_header_rec.operation_flag);
1154: FND_MSG_PUB.ADD;
1155: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1156: END IF;
1157:
1165: FND_LOG.string(l_log_statement, l_full_name, 'no items for the composition');
1166: END IF;
1167: -- items table can't be empty for creation and update - it needs at least one item
1168: IF (l_ic_header_rec.operation_flag <> 'D') THEN
1169: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_CL_NO_ITEMS'); -- At least one composition item is required to create or update the Composition List. (new message)
1170: FND_MSG_PUB.ADD;
1171: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1172: END IF;
1173: END IF;
1181: FETCH get_ic_id_csr INTO l_ic_header_rec.item_composition_id, l_ic_header_rec.object_version_number;
1182: IF (get_ic_id_csr%NOTFOUND) THEN
1183: CLOSE get_ic_id_csr;
1184: -- item composition header is invalid
1185: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_COMP_HEADER_MISMATCH'); -- Item Composition header is invalid.
1186: FND_MSG_PUB.ADD;
1187: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1188: END IF;
1189: CLOSE get_ic_id_csr;
1226: FETCH get_item_id_csr INTO l_ic_header_rec.inventory_item_id;
1227: IF (get_item_id_csr%NOTFOUND) THEN
1228: CLOSE get_item_id_csr;
1229: -- header item is invalid
1230: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
1231: FND_MESSAGE.Set_Token('INV_ITEM', l_ic_header_rec.inventory_item_name);
1232: FND_MSG_PUB.ADD;
1233: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1234: END IF;
1227: IF (get_item_id_csr%NOTFOUND) THEN
1228: CLOSE get_item_id_csr;
1229: -- header item is invalid
1230: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
1231: FND_MESSAGE.Set_Token('INV_ITEM', l_ic_header_rec.inventory_item_name);
1232: FND_MSG_PUB.ADD;
1233: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1234: END IF;
1235: CLOSE get_item_id_csr;
1243: l_det_tbl(i).operation_flag := 'C';
1244: ELSIF ((l_det_tbl(i).operation_flag <> 'M' AND l_det_tbl(i).operation_flag <> 'D') OR
1245: l_det_tbl(i).operation_flag IS NULL) THEN
1246: -- invalid operation flag
1247: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
1248: FND_MESSAGE.Set_Token('OPR_FLAG', l_det_tbl(i).operation_flag);
1249: FND_MSG_PUB.ADD;
1250: END IF;
1251:
1244: ELSIF ((l_det_tbl(i).operation_flag <> 'M' AND l_det_tbl(i).operation_flag <> 'D') OR
1245: l_det_tbl(i).operation_flag IS NULL) THEN
1246: -- invalid operation flag
1247: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
1248: FND_MESSAGE.Set_Token('OPR_FLAG', l_det_tbl(i).operation_flag);
1249: FND_MSG_PUB.ADD;
1250: END IF;
1251:
1252: -- set the inventory org id, and the master org id
1257: OPEN get_item_id_csr (l_det_tbl(i).inventory_item_name, l_org_id);
1258: FETCH get_item_id_csr INTO l_det_tbl(i).inventory_item_id;
1259: IF (get_item_id_csr%NOTFOUND) THEN
1260: -- item is invalid
1261: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
1262: FND_MESSAGE.Set_Token('INV_ITEM', l_det_tbl(i).inventory_item_name);
1263: FND_MSG_PUB.ADD;
1264: END IF;
1265: CLOSE get_item_id_csr;
1258: FETCH get_item_id_csr INTO l_det_tbl(i).inventory_item_id;
1259: IF (get_item_id_csr%NOTFOUND) THEN
1260: -- item is invalid
1261: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
1262: FND_MESSAGE.Set_Token('INV_ITEM', l_det_tbl(i).inventory_item_name);
1263: FND_MSG_PUB.ADD;
1264: END IF;
1265: CLOSE get_item_id_csr;
1266: END LOOP;
1345: FETCH get_ic_id_csr INTO l_ic_header_rec.item_composition_id, l_ic_header_rec.object_version_number;
1346: IF (get_ic_id_csr%NOTFOUND) THEN
1347: CLOSE get_ic_id_csr;
1348: -- item composition header is invalid
1349: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_COMP_HEADER_MISMATCH'); -- Item Composition header is invalid.
1350: FND_MSG_PUB.ADD;
1351: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1352: END IF;
1353: CLOSE get_ic_id_csr;
1361: l_det_tbl(i).operation_flag := 'C';
1362: ELSIF ((l_det_tbl(i).operation_flag <> 'M' AND l_det_tbl(i).operation_flag <> 'D') OR
1363: l_det_tbl(i).operation_flag IS NULL) THEN
1364: -- invalid operation flag
1365: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
1366: FND_MESSAGE.Set_Token('OPR_FLAG', l_det_tbl(i).operation_flag);
1367: FND_MSG_PUB.ADD;
1368: END IF;
1369:
1362: ELSIF ((l_det_tbl(i).operation_flag <> 'M' AND l_det_tbl(i).operation_flag <> 'D') OR
1363: l_det_tbl(i).operation_flag IS NULL) THEN
1364: -- invalid operation flag
1365: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_ENIGMA_OPR_FLAG_INVALID'); -- Operation flag OPR_FLAG is invalid. (new message)
1366: FND_MESSAGE.Set_Token('OPR_FLAG', l_det_tbl(i).operation_flag);
1367: FND_MSG_PUB.ADD;
1368: END IF;
1369:
1370: -- set the inventory org id, and the master org id
1375: OPEN get_item_id_csr (l_det_tbl(i).inventory_item_name, l_org_id);
1376: FETCH get_item_id_csr INTO l_det_tbl(i).inventory_item_id;
1377: IF (get_item_id_csr%NOTFOUND) THEN
1378: -- item is invalid
1379: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
1380: FND_MESSAGE.Set_Token('INV_ITEM', l_det_tbl(i).inventory_item_name);
1381: FND_MSG_PUB.ADD;
1382: END IF;
1383: CLOSE get_item_id_csr;
1376: FETCH get_item_id_csr INTO l_det_tbl(i).inventory_item_id;
1377: IF (get_item_id_csr%NOTFOUND) THEN
1378: -- item is invalid
1379: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_INV_INVALID'); -- Inventory Item (INV_ITEM) is invalid.
1380: FND_MESSAGE.Set_Token('INV_ITEM', l_det_tbl(i).inventory_item_name);
1381: FND_MSG_PUB.ADD;
1382: END IF;
1383: CLOSE get_item_id_csr;
1384:
1387: OPEN get_ic_det_id_csr (l_ic_header_rec.item_composition_id, l_det_tbl(i).inventory_item_id, l_org_id);
1388: FETCH get_ic_det_id_csr INTO l_det_tbl(i).item_comp_detail_id;
1389: IF (get_ic_det_id_csr%NOTFOUND) THEN
1390: -- composition item is invalid
1391: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_IC_INVALID'); -- Invalid composition item ITEM. (new message)
1392: FND_MESSAGE.Set_Token('ITEM', l_det_tbl(i).inventory_item_name);
1393: FND_MSG_PUB.ADD;
1394: END IF;
1395: CLOSE get_ic_det_id_csr;
1388: FETCH get_ic_det_id_csr INTO l_det_tbl(i).item_comp_detail_id;
1389: IF (get_ic_det_id_csr%NOTFOUND) THEN
1390: -- composition item is invalid
1391: FND_MESSAGE.Set_Name('AHL', 'AHL_MC_IC_INVALID'); -- Invalid composition item ITEM. (new message)
1392: FND_MESSAGE.Set_Token('ITEM', l_det_tbl(i).inventory_item_name);
1393: FND_MSG_PUB.ADD;
1394: END IF;
1395: CLOSE get_ic_det_id_csr;
1396: