2020: p_revised_item_rec.updated_revised_item_revision =
2021: FND_API.G_MISS_CHAR
2022: AND
2023: p_revised_item_rec.alternate_bom_code IS NULL AND
2024: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
2025: THEN
2026: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
2027: THEN
2028: Error_Handler.Add_Error_Token
2385: IF (p_control_rec.caller_type = 'SSWA')
2386: THEN
2387: l_plm_or_erp_change := 'PLM';
2388: ELSE
2389: l_plm_or_erp_change := Eng_Globals.Get_PLM_Or_ERP_Change(p_revised_item_rec.eco_name, p_rev_item_unexp_rec.organization_id);
2390: END IF;
2391: /*********************************************************************************
2392: ** Added by MK on 08/25/2000.
2393: ** Check Entity for New ECO Effectivities and ECO Routing.
2398: -- Lot Number and Cum Qty must be null
2399: -- Added by MK 08/25/2000
2400: **********************************************************************/
2401: IF l_is_item_unit_controlled AND
2402: ((p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE OR
2403: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE)
2404: AND
2405: ( p_revised_item_rec.lot_number IS NOT NULL OR
2406: p_revised_item_rec.from_cumulative_quantity IS NOT NULL OR
2399: -- Added by MK 08/25/2000
2400: **********************************************************************/
2401: IF l_is_item_unit_controlled AND
2402: ((p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE OR
2403: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE)
2404: AND
2405: ( p_revised_item_rec.lot_number IS NOT NULL OR
2406: p_revised_item_rec.from_cumulative_quantity IS NOT NULL OR
2407: p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL OR
2429: -- If MRP Active is not No and Update WIP is not Yes, From Work Order,
2430: -- To Work Order Lot Number and Cum Qty must be null
2431: -- Added by MK 08/25/2000
2432: **********************************************************************/
2433: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2434: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2435: AND ( p_revised_item_rec.mrp_active <> 2 OR
2436: p_revised_item_rec.update_wip <> 1 )
2437: AND
2430: -- To Work Order Lot Number and Cum Qty must be null
2431: -- Added by MK 08/25/2000
2432: **********************************************************************/
2433: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2434: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2435: AND ( p_revised_item_rec.mrp_active <> 2 OR
2436: p_revised_item_rec.update_wip <> 1 )
2437: AND
2438: ( p_revised_item_rec.lot_number IS NOT NULL OR
2467: /*****************************************************************
2468: -- If From Work Order is not Null then Lot Number must be Null
2469: -- Added by MK 08/25/2000
2470: ******************************************************************/
2471: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2472: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2473: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2474: AND p_revised_item_rec.lot_number IS NOT NULL
2475: THEN
2468: -- If From Work Order is not Null then Lot Number must be Null
2469: -- Added by MK 08/25/2000
2470: ******************************************************************/
2471: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2472: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2473: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2474: AND p_revised_item_rec.lot_number IS NOT NULL
2475: THEN
2476: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
2494: -- If To Work Order is not Null then
2495: -- From Work Order must not be null
2496: -- Added by MK 08/25/2000
2497: ******************************************************************/
2498: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2499: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2500: AND p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL
2501: AND p_rev_item_unexp_rec.from_wip_entity_id IS NULL
2502: THEN
2495: -- From Work Order must not be null
2496: -- Added by MK 08/25/2000
2497: ******************************************************************/
2498: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2499: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2500: AND p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL
2501: AND p_rev_item_unexp_rec.from_wip_entity_id IS NULL
2502: THEN
2503: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
2519: -- If To Work Order is not Null then
2520: -- To Work Order must be greater than From Work Order
2521: -- Added by MK 08/25/2000
2522: ******************************************************************/
2523: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2524: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2525: AND p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL
2526: AND ( p_revised_item_rec.from_work_order > p_revised_item_rec.to_work_order
2527: OR p_rev_item_unexp_rec.from_wip_entity_id IS NULL)
2520: -- To Work Order must be greater than From Work Order
2521: -- Added by MK 08/25/2000
2522: ******************************************************************/
2523: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2524: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2525: AND p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL
2526: AND ( p_revised_item_rec.from_work_order > p_revised_item_rec.to_work_order
2527: OR p_rev_item_unexp_rec.from_wip_entity_id IS NULL)
2528: THEN
2546: -- If From Work Order and To Work Order is not Null then
2547: -- Cumulative Quantity must be null.
2548: -- Added by MK 08/25/2000
2549: ******************************************************************/
2550: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2551: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2552: AND p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL
2553: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2554: AND p_revised_item_rec.from_cumulative_quantity IS NOT NULL
2547: -- Cumulative Quantity must be null.
2548: -- Added by MK 08/25/2000
2549: ******************************************************************/
2550: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2551: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2552: AND p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL
2553: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2554: AND p_revised_item_rec.from_cumulative_quantity IS NOT NULL
2555: THEN
2573: -- If Cumulative Quantity is not null then
2574: -- From Work Order must not be null and To Work Order must be null.
2575: -- Added by MK 08/25/2000
2576: ******************************************************************/
2577: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2578: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2579: AND ( p_rev_item_unexp_rec.from_wip_entity_id IS NULL
2580: OR p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL )
2581: AND p_revised_item_rec.from_cumulative_quantity IS NOT NULL
2574: -- From Work Order must not be null and To Work Order must be null.
2575: -- Added by MK 08/25/2000
2576: ******************************************************************/
2577: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2578: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2579: AND ( p_rev_item_unexp_rec.from_wip_entity_id IS NULL
2580: OR p_rev_item_unexp_rec.to_wip_entity_id IS NOT NULL )
2581: AND p_revised_item_rec.from_cumulative_quantity IS NOT NULL
2582: THEN
2601: -- If From Work Order is not null then
2602: -- To Work Order or Cumulative Quantity must not be null.
2603: -- Added by MK 08/25/2000
2604: ******************************************************************/
2605: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2606: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2607: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2608: AND p_rev_item_unexp_rec.to_wip_entity_id IS NULL
2609: AND p_revised_item_rec.from_cumulative_quantity IS NULL
2602: -- To Work Order or Cumulative Quantity must not be null.
2603: -- Added by MK 08/25/2000
2604: ******************************************************************/
2605: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2606: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2607: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2608: AND p_rev_item_unexp_rec.to_wip_entity_id IS NULL
2609: AND p_revised_item_rec.from_cumulative_quantity IS NULL
2610: THEN
2629: -- If Lot Number is not null then
2630: -- From Work Order, To Work Order and Cum Quantity must be null.
2631: -- Added by MK 08/25/2000
2632: ******************************************************************/
2633: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2634: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2635: AND p_revised_item_rec.lot_number IS NOT NULL
2636: THEN
2637:
2630: -- From Work Order, To Work Order and Cum Quantity must be null.
2631: -- Added by MK 08/25/2000
2632: ******************************************************************/
2633: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2634: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2635: AND p_revised_item_rec.lot_number IS NOT NULL
2636: THEN
2637:
2638: IF ( p_revised_item_rec.from_cumulative_quantity IS NOT NULL OR
2692: -- From Cum Qty must be smaller or equal than Wip Job's Start Qty
2693: -- Rev Item Effective Date msut be past than WIP Job's start date
2694: -- Added by MK 08/25/2000
2695: ******************************************************************/
2696: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2697: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2698: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2699: AND p_revised_item_rec.from_cumulative_quantity IS NOT NULL
2700: AND p_revised_item_rec.lot_number IS NULL
2693: -- Rev Item Effective Date msut be past than WIP Job's start date
2694: -- Added by MK 08/25/2000
2695: ******************************************************************/
2696: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2697: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2698: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2699: AND p_revised_item_rec.from_cumulative_quantity IS NOT NULL
2700: AND p_revised_item_rec.lot_number IS NULL
2701: AND p_rev_item_unexp_rec.to_wip_entity_id IS NULL
2770: -- must be unreleased order.
2771: -- Rev Item Effective Date msut be past than WIP Job's start date
2772: -- Added by MK 08/25/2000
2773: ******************************************************************/
2774: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2775: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2776: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2777: AND p_revised_item_rec.from_cumulative_quantity IS NULL
2778: AND p_revised_item_rec.lot_number IS NULL
2771: -- Rev Item Effective Date msut be past than WIP Job's start date
2772: -- Added by MK 08/25/2000
2773: ******************************************************************/
2774: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2775: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2776: AND p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2777: AND p_revised_item_rec.from_cumulative_quantity IS NULL
2778: AND p_revised_item_rec.lot_number IS NULL
2779: AND p_revised_item_rec.from_work_order <= p_revised_item_rec.to_work_order
2826: -- Modified by MK 01/29/2001
2827: -- Eco for produciton must be Yes when Eco type is Eco by Prod
2828: -- also Eco for production must be No when Eco Type is not Eco by Prod.
2829: ******************************************************************/
2830: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2831: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2832: AND p_revised_item_rec.eco_for_production = 1 -- Yes
2833: AND
2834: ( p_revised_item_rec.lot_number IS NULL AND
2827: -- Eco for produciton must be Yes when Eco type is Eco by Prod
2828: -- also Eco for production must be No when Eco Type is not Eco by Prod.
2829: ******************************************************************/
2830: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2831: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2832: AND p_revised_item_rec.eco_for_production = 1 -- Yes
2833: AND
2834: ( p_revised_item_rec.lot_number IS NULL AND
2835: p_rev_item_unexp_rec.from_wip_entity_id IS NULL
2847: END IF;
2848: l_return_status := FND_API.G_RET_STS_ERROR;
2849:
2850: ELSIF
2851: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2852: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2853: AND p_revised_item_rec.eco_for_production = 2 -- No
2854: AND
2855: ( p_revised_item_rec.lot_number IS NOT NULL OR
2848: l_return_status := FND_API.G_RET_STS_ERROR;
2849:
2850: ELSIF
2851: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2852: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2853: AND p_revised_item_rec.eco_for_production = 2 -- No
2854: AND
2855: ( p_revised_item_rec.lot_number IS NOT NULL OR
2856: p_rev_item_unexp_rec.from_wip_entity_id IS NOT NULL
2873: -- Added by MK on 08/26/2000.
2874: -- If revised item is unit controlled, the user must not update
2875: -- modifiy current routing
2876: **********************************************************************/
2877: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2878: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2879: AND l_is_item_unit_controlled
2880: AND ( p_revised_item_rec.completion_subinventory IS NOT NULL OR
2881: p_revised_item_rec.new_routing_revision IS NOT NULL OR
2874: -- If revised item is unit controlled, the user must not update
2875: -- modifiy current routing
2876: **********************************************************************/
2877: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE OR
2878: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE )
2879: AND l_is_item_unit_controlled
2880: AND ( p_revised_item_rec.completion_subinventory IS NOT NULL OR
2881: p_revised_item_rec.new_routing_revision IS NOT NULL OR
2882: p_revised_item_rec.updated_routing_revision IS NOT NULL OR
2929: -- Cannot update alternate routing designator
2930: **********************************************************************/
2931: IF p_revised_item_rec.alternate_bom_code IS NOT NULL AND
2932: p_revised_item_rec.alternate_bom_code <> p_old_revised_item_rec.alternate_bom_code AND -- R12:LKASTURI:7/11/2005
2933: p_revised_item_rec.transaction_type = ENG_Globals.G_OPR_UPDATE AND
2934: ( NVL(p_rev_item_unexp_rec.routing_sequence_id, 0) <>
2935: NVL(p_old_rev_item_unexp_rec.routing_sequence_id, 0) OR
2936: NVL(p_rev_item_unexp_rec.bill_sequence_id, 0) <>
2937: NVL(p_old_rev_item_unexp_rec.bill_sequence_id, 0)
2978: END LOOP;
2979:
2980: IF l_alternate_rtg_designator IS NOT NULL AND
2981: p_revised_item_rec.alternate_bom_code <> l_alternate_rtg_designator AND
2982: p_revised_item_rec.transaction_type = ENG_Globals.G_OPR_UPDATE
2983: THEN
2984: l_token_tbl.DELETE;
2985: l_token_tbl(1).token_name := 'REVISED_ITEM_NAME';
2986: l_token_tbl(1).token_value :=
3030: OR p_revised_item_rec.completion_location_name IS NOT NULL
3031: OR p_revised_item_rec.priority IS NOT NULL
3032: OR p_revised_item_rec.routing_comment IS NOT NULL
3033: )
3034: AND p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3035: THEN
3036:
3037: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3038: THEN
3057: -- Cannot have routing revision, if routing is an alternate.
3058: **********************************************************************/
3059: IF p_revised_item_rec.new_routing_revision IS NOT NULL AND
3060: p_revised_item_rec.alternate_bom_code IS NOT NULL AND
3061: p_revised_item_rec.transaction_type = ENG_Globals.G_OPR_CREATE
3062: THEN
3063: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3064: THEN
3065: Error_Handler.Add_Error_Token
3070: );
3071:
3072: END IF;
3073: l_return_status := FND_API.G_RET_STS_ERROR;
3074: ELSIF p_revised_item_rec.transaction_type = ENG_Globals.G_OPR_UPDATE AND
3075: p_revised_item_rec.alternate_bom_code IS NOT NULL AND
3076: p_revised_item_rec.updated_routing_revision IS NOT NULL
3077: THEN
3078: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3186: **********************************************************************/
3187:
3188: IF ( p_revised_item_rec.updated_routing_revision <>
3189: p_old_revised_item_rec.new_routing_revision AND
3190: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3191: ) OR
3192: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3193: THEN
3194: --
3188: IF ( p_revised_item_rec.updated_routing_revision <>
3189: p_old_revised_item_rec.new_routing_revision AND
3190: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3191: ) OR
3192: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3193: THEN
3194: --
3195: -- if the transaction type is create, the check new_routing_revision
3196: --
3193: THEN
3194: --
3195: -- if the transaction type is create, the check new_routing_revision
3196: --
3197: IF p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3198: THEN
3199: l_new_revision_status :=
3200: Validate_New_Rtg_Revision
3201: ( p_revised_item_id => p_rev_item_unexp_rec.revised_item_id
3241: l_token_tbl(1).token_name := 'REVISED_ITEM_NAME';
3242: l_token_tbl(1).token_value := p_revised_item_rec.revised_item_name;
3243:
3244: -- Added by MK on 11/05/00
3245: IF p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3246: THEN
3247: l_token_tbl(2).token_name := 'NEW_RTG_REVISION';
3248: l_token_tbl(2).token_value := p_revised_item_rec.new_routing_revision;
3249: ELSE
3294: -- Added by MK 08/26/2000
3295: -- if the transaction type is create or update, the check ctp_flag
3296: **********************************************************************/
3297: IF ( p_revised_item_rec.ctp_flag <> p_old_revised_item_rec.ctp_flag AND
3298: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3299: ) OR
3300: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
3301: p_revised_item_rec.ctp_flag = 1
3302: THEN
3296: **********************************************************************/
3297: IF ( p_revised_item_rec.ctp_flag <> p_old_revised_item_rec.ctp_flag AND
3298: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3299: ) OR
3300: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
3301: p_revised_item_rec.ctp_flag = 1
3302: THEN
3303: IF NOT Check_CTP_Flag
3304: ( p_revised_item_id => p_rev_item_unexp_rec.revised_item_id
3329: -- Added by MK 08/26/2000
3330: -- if the transaction type is create or update, the check priority
3331: **********************************************************************/
3332: IF ( p_revised_item_rec.priority <> p_old_revised_item_rec.priority AND
3333: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3334: ) OR
3335: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
3336: p_revised_item_rec.priority IS NOT NULL
3337: THEN
3331: **********************************************************************/
3332: IF ( p_revised_item_rec.priority <> p_old_revised_item_rec.priority AND
3333: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3334: ) OR
3335: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
3336: p_revised_item_rec.priority IS NOT NULL
3337: THEN
3338: IF NOT Check_Priority
3339: ( p_revised_item_id => p_rev_item_unexp_rec.revised_item_id
3369: || p_revised_item_rec.completion_subinventory ) ;
3370: Error_Handler.Write_Debug('Old Completion_subinv is:'||p_old_revised_item_rec.completion_subinventory );
3371: END IF;
3372:
3373: IF (( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3374: AND
3375: NVL(p_revised_item_rec.completion_subinventory, '0') <>
3376: NVL(p_old_revised_item_rec.completion_subinventory, '0')
3377: )
3374: AND
3375: NVL(p_revised_item_rec.completion_subinventory, '0') <>
3376: NVL(p_old_revised_item_rec.completion_subinventory, '0')
3377: )
3378: OR p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3379: )
3380: AND ( p_revised_item_rec.completion_subinventory IS NULL
3381: OR p_revised_item_rec.completion_subinventory = FND_API.G_MISS_CHAR)
3382: THEN
3405: END IF;
3406:
3407: -- Check if Subinventory exists
3408: ELSIF
3409: (( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3410: AND NVL(p_revised_item_rec.completion_subinventory, '0') <>
3411: NVL(p_old_revised_item_rec.completion_subinventory, '0')
3412: )
3413: OR p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3409: (( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3410: AND NVL(p_revised_item_rec.completion_subinventory, '0') <>
3411: NVL(p_old_revised_item_rec.completion_subinventory, '0')
3412: )
3413: OR p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3414: )
3415: AND ( p_revised_item_rec.completion_subinventory IS NOT NULL
3416: OR p_revised_item_rec.completion_subinventory <> FND_API.G_MISS_CHAR)
3417: THEN
3694: Null;
3695: Else
3696: IF p_control_rec.caller_type <> 'FORM'
3697: AND p_revised_item_rec.completion_subinventory is not null -- Bug 2871420 added this condition
3698: AND (( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3699: AND NVL(p_rev_item_unexp_rec.completion_locator_id , 0) <>
3700: NVL(p_old_rev_item_unexp_rec.completion_locator_id , 0)
3701: )
3702: OR (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3698: AND (( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3699: AND NVL(p_rev_item_unexp_rec.completion_locator_id , 0) <>
3700: NVL(p_old_rev_item_unexp_rec.completion_locator_id , 0)
3701: )
3702: OR (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3703: AND p_revised_item_rec.completion_subinventory is not null
3704: AND p_revised_item_rec.completion_subinventory <> FND_API.G_MISS_CHAR)
3705: )
3706: AND NOT Check_Locators( p_organization_id => p_rev_item_unexp_rec.organization_id
3817: -- Added by MK 08/26/2000
3818: -- Check Mixed_Model_Map_Flag for future release
3819:
3820: IF ( p_revised_item_rec.mixed_model_map <> p_old_revised_item_rec.mixed_model_map AND
3821: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3822: ) OR
3823: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
3824: p_revised_item_rec.mixed_model_map = 1
3825: THEN
3819:
3820: IF ( p_revised_item_rec.mixed_model_map <> p_old_revised_item_rec.mixed_model_map AND
3821: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
3822: ) OR
3823: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
3824: p_revised_item_rec.mixed_model_map = 1
3825: THEN
3826: IF NOT Check_Mixed_Model_Map THEN
3827: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR)
3848: -- Added by AS on 07/06.
3849: -- If revised item is unit controlled, the user must enter a
3850: -- From End Item Unit Number
3851: **********************************************************************/
3852: IF p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
3853: l_plm_or_erp_change <> 'PLM' AND -- not required for plm
3854: l_is_item_unit_controlled AND
3855: p_revised_item_rec.from_end_item_unit_number IS NULL
3856: THEN
3876: not chosen.
3877:
3878: IF p_revised_item_rec.use_up_plan_name IS NOT NULL AND
3879: p_revised_item_rec.use_up_item_name IS NULL AND
3880: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3881: THEN
3882: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3883: THEN
3884: Error_Handler.Add_Error_Token
3891: l_return_status := FND_API.G_RET_STS_ERROR;
3892:
3893: ELSIF p_revised_item_rec.use_up_plan_name IS NULL AND
3894: p_revised_item_rec.use_up_item_name IS NOT NULL AND
3895: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
3896: THEN
3897: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3898: THEN
3899: Error_Handler.Add_Error_Token
4007: -- (a process and Approval Status of 'Approval Requested')
4008: -- or is cancelled or implemented
4009: --
4010: *********************************************************************/
4011: IF ENG_Globals.ECO_Cannot_Update
4012: ( p_change_notice => p_revised_item_rec.Eco_Name
4013: , p_organization_id => p_rev_item_unexp_rec.organization_id
4014: )
4015: AND p_control_rec.caller_type <> 'SSWA' -- not required for plm
4031: --
4032: -- Creating a record with status of Cancelled should get an error.
4033: --
4034: *********************************************************************/
4035: IF p_revised_item_rec.Transaction_Type = ENG_Globals.G_OPR_CREATE AND
4036: p_revised_item_rec.status_type = 5
4037: THEN
4038: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4039: THEN
4058: FOR x_count IN c_CheckItemProductFamily LOOP
4059: l_product_family := TRUE;
4060: END LOOP;
4061:
4062: IF p_revised_item_rec.Transaction_Type = ENG_Globals.G_OPR_CREATE AND
4063: l_product_family
4064: THEN
4065: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4066: THEN
4079: -- entered
4080: **********************************************************************/
4081: -- removed for solving conflicting with unique check in ENGSVIDB.pls
4082: /* IF l_is_item_unit_controlled AND
4083: ((p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
4084: p_revised_item_rec.start_effective_date IS NOT NULL)
4085: OR
4086: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
4087: p_revised_item_rec.new_effective_date IS NOT NULL))
4082: /* IF l_is_item_unit_controlled AND
4083: ((p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
4084: p_revised_item_rec.start_effective_date IS NOT NULL)
4085: OR
4086: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
4087: p_revised_item_rec.new_effective_date IS NOT NULL))
4088: THEN
4089: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4090: THEN
4104: -- If revised item is not unit controlled, no unit number must be
4105: -- entered
4106: **********************************************************************/
4107: IF NOT l_is_item_unit_controlled AND
4108: ((p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
4109: p_revised_item_rec.from_end_item_unit_number IS NOT NULL)
4110: OR
4111: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
4112: p_revised_item_rec.new_from_end_item_unit_number IS NOT NULL))
4107: IF NOT l_is_item_unit_controlled AND
4108: ((p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
4109: p_revised_item_rec.from_end_item_unit_number IS NOT NULL)
4110: OR
4111: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
4112: p_revised_item_rec.new_from_end_item_unit_number IS NOT NULL))
4113: THEN
4114: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4115: THEN
4189: --
4190: **********************************************************************/
4191:
4192: IF p_revised_item_rec.new_effective_date = FND_API.G_MISS_DATE AND
4193: p_revised_item_rec.transaction_type = Eng_Globals.G_OPR_UPDATE
4194: THEN
4195: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4196: THEN
4197: Error_Handler.Add_Error_Token
4273: THEN
4274: l_assembly_type := p_control_rec.eco_assembly_type ;
4275: ELSE
4276: l_assembly_type :=
4277: ENG_Globals.Get_ECO_Assembly_Type
4278: ( p_change_notice => p_revised_item_rec.eco_name
4279: , p_organization_id => p_rev_item_unexp_rec.organization_id
4280: );
4281: END IF ;
4293: --
4294: *********************************************************************/
4295:
4296: IF p_control_rec.caller_type <> 'FORM' AND
4297: p_revised_item_rec.Transaction_Type = ENG_GLOBALS.G_OPR_CREATE AND
4298: NOT Compatible_Item_Type
4299: ( p_assembly_type => l_assembly_type
4300: , p_revised_item_id => p_rev_item_unexp_rec.revised_item_id
4301: , p_organization_id => p_rev_item_unexp_rec.organization_id
4327: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Start effective Date: ' ||
4328: to_char(p_revised_item_rec.start_effective_date));
4329: END IF;
4330: IF NOT l_is_item_unit_controlled AND
4331: ((p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
4332: trunc(p_revised_item_rec.earliest_effective_date) >
4333: trunc(p_revised_item_rec.start_effective_date))
4334: OR
4335: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
4331: ((p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
4332: trunc(p_revised_item_rec.earliest_effective_date) >
4333: trunc(p_revised_item_rec.start_effective_date))
4334: OR
4335: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
4336: trunc(p_revised_item_rec.earliest_effective_date) >
4337: NVL(trunc(p_revised_item_rec.new_effective_date),
4338: p_revised_item_rec.start_effective_date)))
4339: THEN
4367: IF p_revised_item_rec.use_up_plan_name IS NOT NULL AND
4368: p_rev_item_unexp_rec.use_up_item_id IS NOT NULL AND -- Added by MK on 10/31/00
4369: p_revised_item_rec.start_effective_date IS NOT NULL AND
4370: p_revised_item_rec.start_effective_date <> FND_API.G_MISS_DATE AND
4371: ( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE OR
4372: ( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
4373: AND
4374: ( p_revised_item_rec.new_effective_date IS NOT NULL AND
4375: p_revised_item_rec.new_effective_date <> FND_API.G_MISS_DATE
4368: p_rev_item_unexp_rec.use_up_item_id IS NOT NULL AND -- Added by MK on 10/31/00
4369: p_revised_item_rec.start_effective_date IS NOT NULL AND
4370: p_revised_item_rec.start_effective_date <> FND_API.G_MISS_DATE AND
4371: ( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE OR
4372: ( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
4373: AND
4374: ( p_revised_item_rec.new_effective_date IS NOT NULL AND
4375: p_revised_item_rec.new_effective_date <> FND_API.G_MISS_DATE
4376: )
4377: )
4378: )
4379: THEN
4380: l_IsDateValid := FALSE;
4381: IF p_revised_item_rec.transaction_type=ENG_GLOBALS.G_OPR_CREATE
4382: THEN
4383: l_IsDateValid :=
4384: Check_Date
4385: ( p_revised_item_id =>
4446: --
4447: ***********************************************************************/
4448:
4449: IF ( ( p_rev_item_unexp_rec.use_up_item_id IS NOT NULL AND
4450: p_revised_item_rec.Transaction_Type = ENG_Globals.G_OPR_CREATE
4451: ) OR
4452: ( p_revised_item_rec.Transaction_Type = ENG_Globals.G_OPR_UPDATE
4453: AND
4454: p_rev_item_unexp_rec.use_up_item_id <>
4448:
4449: IF ( ( p_rev_item_unexp_rec.use_up_item_id IS NOT NULL AND
4450: p_revised_item_rec.Transaction_Type = ENG_Globals.G_OPR_CREATE
4451: ) OR
4452: ( p_revised_item_rec.Transaction_Type = ENG_Globals.G_OPR_UPDATE
4453: AND
4454: p_rev_item_unexp_rec.use_up_item_id <>
4455: NVL(p_old_rev_item_unexp_rec.use_up_item_id, 0)
4456: )
4518: error_handler.write_debug('Assem Type : ' || to_char(l_assembly_type) );
4519: END IF;
4520:
4521:
4522: IF p_revised_item_rec.Transaction_Type = ENG_Globals.G_OPR_CREATE AND
4523: p_revised_item_rec.alternate_bom_code IS NOT NULL AND
4524: ( NOT Eng_Primary_Bill_Exists
4525: ( p_Revised_Item_Id => p_rev_item_unexp_rec.revised_item_id
4526: , p_Organization_Id => p_rev_item_unexp_rec.organization_id
4559: END IF;
4560:
4561: /*********************************************************************
4562: -- Added by MK on 08/26/2000
4563: IF p_revised_item_rec.transaction_type = ENG_Globals.G_OPR_CREATE AND
4564: p_revised_item_rec.alternate_bom_code IS NOT NULL AND
4565: NOT Eng_Primary_Routing_Exists
4566: ( p_revised_Item_Id => p_rev_item_unexp_rec.revised_item_id
4567: , p_organization_Id => p_rev_item_unexp_rec.organization_id
4636: -- or if the ECO has an approval status of 'Approval Requested'
4637: --
4638: -- The below condition was modified by MK on 11/13/00
4639: **********************************************************************/
4640: IF p_revised_item_rec.Transaction_Type = ENG_Globals.G_OPR_UPDATE
4641: AND
4642: ( -- (p_control_rec.caller_type = 'FORM' AND
4643: -- p_control_rec.validation_controller = 'SCHEDULED_DATE')
4644: -- OR
4700: -- Revised item scheduled_date cannot be greater than the disable date
4701: -- of any of its revised operations with acd_type of Add or Change
4702: -- Modified below condition by MK on 11/13/00
4703: **********************************************************************/
4704: IF p_revised_item_rec.transaction_type = ENG_Globals.G_OPR_UPDATE
4705: AND
4706: ( -- (p_control_rec.caller_type = 'FORM' AND
4707: -- p_control_rec.validation_controller = 'SCHEDULED_DATE')
4708: -- OR
4748: --
4749: **********************************************************************/
4750:
4751: IF p_control_rec.caller_type <> 'FORM' AND
4752: (( p_revised_item_rec.transaction_type=ENG_Globals.G_OPR_UPDATE AND
4753: NVL( p_revised_item_rec.status_type, 0) <>
4754: p_old_revised_item_rec.status_type
4755: )
4756: )
4795: -- cancel because in that case ECO is not updateable.
4796: --
4797: ********************************************************************/
4798: IF p_control_rec.caller_type <> 'FORM' AND
4799: p_revised_item_rec.transaction_type = Eng_Globals.G_OPR_CREATE
4800: AND l_plm_or_erp_change = 'ERP' -- Added for bug 3618676
4801: THEN
4802: BEGIN
4803: SELECT 1
4840: -- is set to 'Approval Requested'
4841: --
4842: **********************************************************************/
4843:
4844: IF p_revised_item_rec.transaction_type = ENG_Globals.G_OPR_UPDATE AND
4845: NVL(p_revised_item_rec.status_type, 0) <>
4846: p_old_revised_item_rec.status_type
4847: AND p_control_rec.caller_type <> 'SSWA'
4848: AND
4890: IF l_alternate_bom_designator IS NOT NULL AND
4891: (p_revised_item_rec.alternate_bom_code <>
4892: l_alternate_bom_designator
4893: ) AND
4894: p_revised_item_rec.transaction_type = Eng_globals.G_OPR_UPDATE
4895: THEN
4896: l_token_tbl.DELETE;
4897: l_token_tbl(1).token_name := 'REVISED_ITEM_NAME';
4898: l_token_tbl(1).token_value :=
4916:
4917:
4918: IF p_revised_item_rec.new_revised_item_revision IS NOT NULL AND
4919: p_revised_item_rec.alternate_bom_code IS NOT NULL AND
4920: p_revised_item_rec.transaction_type = Eng_Globals.G_OPR_CREATE
4921: AND l_plm_or_erp_change <> 'PLM'
4922: THEN
4923: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4924: THEN
4929: , p_Token_Tbl => l_Token_Tbl
4930: );
4931: END IF;
4932: l_return_status := FND_API.G_RET_STS_ERROR;
4933: ELSIF p_revised_item_rec.transaction_type = Eng_Globals.G_OPR_UPDATE AND
4934: p_revised_item_rec.alternate_bom_code IS NOT NULL AND
4935: p_revised_item_rec.updated_revised_item_revision IS NOT NULL
4936: AND l_plm_or_erp_change <> 'PLM'
4937: THEN
4958: , p_organization_id => p_rev_item_unexp_rec.organization_id
4959: , p_revision_date => SYSDATE
4960: );
4961: IF l_current_item_revision IS NULL AND
4962: p_Revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
4963: THEN
4964: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4965: THEN
4966: Error_Handler.Add_Error_Token
4987: -- profile ENG: Require Revised Item New Revision is set to Yes.
4988: **********************************************************************/
4989:
4990: IF l_new_rev_required = 1 AND
4991: (( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
4992: p_revised_item_rec.new_revised_item_revision = l_current_item_revision)
4993: OR
4994: ( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
4995: p_revised_item_rec.updated_revised_item_revision = l_current_item_revision))
4990: IF l_new_rev_required = 1 AND
4991: (( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
4992: p_revised_item_rec.new_revised_item_revision = l_current_item_revision)
4993: OR
4994: ( p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
4995: p_revised_item_rec.updated_revised_item_revision = l_current_item_revision))
4996: THEN
4997: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4998: THEN
5017: **********************************************************************/
5018:
5019: IF ( p_revised_item_rec.updated_revised_item_revision <>
5020: p_old_revised_item_rec.new_revised_item_revision AND
5021: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
5022: ) OR
5023: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
5024: p_revised_item_rec.new_revised_item_revision IS NOT NULL)
5025: THEN
5019: IF ( p_revised_item_rec.updated_revised_item_revision <>
5020: p_old_revised_item_rec.new_revised_item_revision AND
5021: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
5022: ) OR
5023: (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
5024: p_revised_item_rec.new_revised_item_revision IS NOT NULL)
5025: THEN
5026:
5027: -- 11.5.10E
5046: -- if the operation is create, the check new_revised_item_rev
5047: -- else check updated_revised_item_revision
5048: --
5049:
5050: IF p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
5051: THEN
5052: l_new_revision_status :=
5053: Validate_New_Item_Revision
5054: ( p_revised_item_id => p_rev_item_unexp_rec.revised_item_id
5098: THEN
5099: l_token_tbl.delete;
5100:
5101: -- Added by MK on 11/05/00
5102: IF p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
5103: THEN
5104: l_token_tbl(1).token_name := 'NEW_UPD_ITEM_REVISION';
5105: l_token_tbl(1).token_value := p_revised_item_rec.new_revised_item_revision;
5106: ELSE
5148: THEN
5149: Error_Handler.Write_Debug('Validate if the revisions and effectivity dates in ascending order. . . . ');
5150: END IF;
5151:
5152: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
5153: AND p_revised_item_rec.new_revised_item_revision IS NOT NULL
5154: AND p_control_rec.caller_type <> 'FORM' AND p_control_rec.caller_type <> 'SSWA')
5155: THEN
5156: l_is_revision_invalid := High_Date_Low_Revision (
5158: , p_organization_id => p_rev_item_unexp_rec.organization_id
5159: , p_new_item_revision => p_revised_item_rec.new_revised_item_revision
5160: , p_scheduled_date => p_revised_item_rec.Start_Effective_Date
5161: , p_rev_item_seq_id => p_rev_item_unexp_rec.revised_item_sequence_id);
5162: ELSIF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
5163: AND p_revised_item_rec.updated_revised_item_revision IS NOT NULL
5164: AND ((p_revised_item_rec.new_revised_item_revision IS NOT NULL
5165: AND p_revised_item_rec.updated_revised_item_revision <> p_revised_item_rec.new_revised_item_revision)
5166: OR (p_revised_item_rec.new_revised_item_revision IS NULL))
5196: -- End changes for bug 3618662
5197:
5198: -- 11.5.10E
5199: -- The scheduled date must be greater than the effectivity date of the from revision
5200: IF (p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE
5201: AND p_revised_item_rec.new_revised_item_revision IS NULL
5202: AND p_control_rec.caller_type <> 'FORM' AND p_control_rec.caller_type <> 'SSWA'
5203: AND p_revised_item_rec.from_item_revision IS NOT NULL
5204: AND p_revised_item_rec.from_item_revision <> FND_API.G_MISS_CHAR)
5232: -- If the user is trying to add Revised Items to the ECO and the Catalogue Catagory associated at the Subject Level
5233: -- to the header type of the ECO is not same as that of the Revised items the item should not get added as revised item.
5234: --
5235: **********************************************************************/
5236: IF p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND p_control_rec.caller_type <> 'SSWA'
5237: THEN
5238: IF BOM_Globals.get_debug = 'Y' THEN
5239: error_handler.write_debug('Verifying the subject level security for PLM ' );
5240: END IF;
5451:
5452:
5453: END IF;
5454:
5455: IF p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_CREATE AND
5456: (p_revised_item_rec.from_end_item_unit_number IS NOT NULL
5457: AND
5458: p_revised_item_rec.from_end_item_unit_number <> FND_API.G_MISS_CHAR)
5459: THEN
5480: END IF;
5481: END IF;
5482: END IF;
5483:
5484: IF p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE AND
5485: (p_revised_item_rec.new_from_end_item_unit_number IS NOT NULL
5486: AND
5487: p_revised_item_rec.new_from_end_item_unit_number <> FND_API.G_MISS_CHAR)
5488: THEN
5721: END IF;
5722:
5723: -- Missing Eco For Production Added by MK on 10/06/2000
5724: IF p_revised_item_rec.eco_for_production = FND_API.G_MISS_NUM AND
5725: p_revised_item_rec.transaction_type = ENG_GLOBALS.G_OPR_UPDATE
5726: THEN
5727: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5728: THEN
5729: Error_Handler.Add_Error_Token
6165: , x_revised_item_rec => x_old_revised_item_rec
6166: , x_rev_item_unexp_rec => x_old_rev_item_unexp_rec
6167: , x_Return_status => l_return_status
6168: );
6169: IF l_return_status = Eng_Globals.G_RECORD_FOUND AND
6170: p_revised_item_rec.transaction_type = Eng_Globals.G_OPR_CREATE
6171: THEN
6172: Error_Handler.Add_Error_Token
6173: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
6166: , x_rev_item_unexp_rec => x_old_rev_item_unexp_rec
6167: , x_Return_status => l_return_status
6168: );
6169: IF l_return_status = Eng_Globals.G_RECORD_FOUND AND
6170: p_revised_item_rec.transaction_type = Eng_Globals.G_OPR_CREATE
6171: THEN
6172: Error_Handler.Add_Error_Token
6173: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
6174: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6175: , p_message_name => 'ENG_REV_ITEM_ALREADY_EXISTS'
6176: , p_token_tbl => l_token_tbl
6177: );
6178: l_return_status := FND_API.G_RET_STS_ERROR;
6179: ELSIF l_return_status = Eng_Globals.G_RECORD_NOT_FOUND AND
6180: p_revised_item_rec.transaction_type IN
6181: (Eng_Globals.G_OPR_UPDATE, Eng_Globals.G_OPR_DELETE)
6182: THEN
6183: Error_Handler.Add_Error_Token
6177: );
6178: l_return_status := FND_API.G_RET_STS_ERROR;
6179: ELSIF l_return_status = Eng_Globals.G_RECORD_NOT_FOUND AND
6180: p_revised_item_rec.transaction_type IN
6181: (Eng_Globals.G_OPR_UPDATE, Eng_Globals.G_OPR_DELETE)
6182: THEN
6183: Error_Handler.Add_Error_Token
6184: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
6185: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6510: (p_ritem_impl => FALSE);
6511: END IF;
6512: -- Bug 4276451
6513: -- Check if the revised item is updateable for PLM ECOs
6514: IF ENG_Globals.Get_PLM_Or_ERP_Change(p_change_notice, p_organization_id) = 'PLM'
6515: AND ENG_GLOBALS.G_ENG_LAUNCH_IMPORT <> 2 -- should not be checked for propagation
6516: THEN
6517: l_status_valid := TRUE;
6518: IF revised_item.status_type NOT in( 1, 4) THEN
6511: END IF;
6512: -- Bug 4276451
6513: -- Check if the revised item is updateable for PLM ECOs
6514: IF ENG_Globals.Get_PLM_Or_ERP_Change(p_change_notice, p_organization_id) = 'PLM'
6515: AND ENG_GLOBALS.G_ENG_LAUNCH_IMPORT <> 2 -- should not be checked for propagation
6516: THEN
6517: l_status_valid := TRUE;
6518: IF revised_item.status_type NOT in( 1, 4) THEN
6519: l_status_valid := FALSE;
7048: BOM_Globals.Set_Debug('N');
7049: END IF;
7050: END IF;
7051: -- Initialize System_Information
7052: ENG_GLOBALS.Init_System_Info_Rec(
7053: x_mesg_token_tbl => l_mesg_token_tbl
7054: , x_return_status => l_return_status
7055: );
7056: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
7060: -- Initialize Unit_Effectivity flag
7061: IF PJM_UNIT_EFF.Enabled = 'Y'
7062: THEN
7063: BOM_Globals.Set_Unit_Effectivity (TRUE);
7064: ENG_Globals.Set_Unit_Effectivity (TRUE);
7065: ELSE
7066: BOM_Globals.Set_Unit_Effectivity (FALSE);
7067: ENG_Globals.Set_Unit_Effectivity (FALSE);
7068: END IF;
7063: BOM_Globals.Set_Unit_Effectivity (TRUE);
7064: ENG_Globals.Set_Unit_Effectivity (TRUE);
7065: ELSE
7066: BOM_Globals.Set_Unit_Effectivity (FALSE);
7067: ENG_Globals.Set_Unit_Effectivity (FALSE);
7068: END IF;
7069: --
7070: BOM_Globals.Set_Unit_Controlled_Item(
7071: p_inventory_item_id => p_revised_item_id
7071: p_inventory_item_id => p_revised_item_id
7072: , p_organization_id => p_organization_id
7073: );
7074: BOM_Globals.Set_Require_Item_Rev(FND_PROFILE.VALUE('ENG:ECO_REVISED_ITEM_REVISION'));
7075: Eng_Globals.Set_Bo_Identifier( p_bo_identifier => p_bo_identifier);
7076: Eng_Globals.Set_Org_Id( p_org_id => p_organization_id);
7077:
7078: l_return_status := 'S';
7079:
7072: , p_organization_id => p_organization_id
7073: );
7074: BOM_Globals.Set_Require_Item_Rev(FND_PROFILE.VALUE('ENG:ECO_REVISED_ITEM_REVISION'));
7075: Eng_Globals.Set_Bo_Identifier( p_bo_identifier => p_bo_identifier);
7076: Eng_Globals.Set_Org_Id( p_org_id => p_organization_id);
7077:
7078: l_return_status := 'S';
7079:
7080: -- Start processing