320: IF p_x_line_tbl(I).ship_model_complete_flag = 'N' AND
321: p_x_line_tbl(I).top_model_line_id IS NOT NULL AND
322: (p_x_line_tbl(I).ato_line_id IS NULL OR
323: p_x_line_tbl(I).ato_line_id <> p_x_line_tbl(I).top_model_line_id) AND
324: p_x_line_tbl(I).item_type_code = OE_GLOBALS.G_ITEM_INCLUDED THEN
325: IF NOT OE_SCH_CONC_REQUESTS.included_processed(p_x_line_tbl(I).line_id) THEN
326: IF l_debug_level > 0 THEN
327: oe_debug_pub.add( 'INCLUDED PROCESSED : ' || p_x_line_tbl(I).line_id, 3 ) ;
328: END IF;
568: WHERE header_id = p_header_id
569: AND open_flag = 'Y'
570: AND line_category_code <> 'RETURN'
571: AND item_type_code <> 'SERVICE'
572: AND source_type_code <> OE_GLOBALS.G_SOURCE_EXTERNAL
573: ORDER BY arrival_set_id,ship_set_id,line_number,shipment_number,nvl(option_number,-1);
574:
575: CURSOR l_line_inc_csr IS
576: SELECT line_id,ship_set_id,arrival_set_id, shippable_flag,
697: IF l_debug_level > 0 THEN
698: oe_debug_pub.add( 'LINE SELECTED FOR SCHEDULING **** : ' || L_LINE_REC.LINE_ID , 1 ) ;
699: END IF;
700: x_line_tbl(I) := l_line_rec;
701: x_line_tbl(I).operation := OE_GLOBALS.G_OPR_UPDATE;
702:
703: IF (x_line_tbl(I).arrival_set_id is not null) THEN
704:
705: l_set_rec := OE_ORDER_CACHE.Load_Set
906: -- code fix for 3300528
907: --FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
908: IF l_line_rec.ato_line_id IS NOT NULL AND
909: NOT ( l_line_rec.ato_line_id = l_line_rec.line_id AND
910: l_line_rec.item_type_code IN ( OE_GLOBALS.G_ITEM_OPTION,
911: OE_GLOBALS.G_ITEM_STANDARD))
912: THEN
913: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_NO_CONFIG');
914: ELSE
907: --FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
908: IF l_line_rec.ato_line_id IS NOT NULL AND
909: NOT ( l_line_rec.ato_line_id = l_line_rec.line_id AND
910: l_line_rec.item_type_code IN ( OE_GLOBALS.G_ITEM_OPTION,
911: OE_GLOBALS.G_ITEM_STANDARD))
912: THEN
913: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_NO_CONFIG');
914: ELSE
915: FND_MESSAGE.SET_NAME('ONT','ONT_SCH_NOT_RESERVABLE');
933: oe_debug_pub.add( 'LINE SELECTED FOR RESERVE **** : '|| L_LINE_REC.LINE_ID , 1 ) ;
934: END IF;
935: I := I + 1;
936: x_line_tbl(I) := l_line_rec;
937: x_line_tbl(I).operation := OE_GLOBALS.G_OPR_UPDATE;
938:
939: IF (x_line_tbl(I).arrival_set_id is not null) THEN
940: l_set_rec := OE_ORDER_CACHE.Load_Set
941: ( x_line_tbl(I).arrival_set_id);
1013:
1014: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
1015: I := I +1; -- 2327783
1016: x_line_tbl(I) := l_line_rec;
1017: -- x_line_tbl(I).operation := OE_GLOBALS.G_OPR_UPDATE;
1018:
1019: IF (x_line_tbl(I).arrival_set_id is not null) THEN
1020: l_set_rec := OE_ORDER_CACHE.Load_Set
1021: ( x_line_tbl(I).arrival_set_id);
1196: oe_debug_pub.add( 'LINE SELECTED FOR UNRES **** : ' || L_LINE_REC.LINE_ID , 1 ) ;
1197: END IF;
1198:
1199:
1200: l_line_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
1201: l_line_rec.schedule_action_code := p_sch_action;
1202: l_return_status := FND_API.G_RET_STS_SUCCESS;
1203:
1204: OE_SCHEDULE_UTIL.Validate_Line(p_line_rec => l_line_rec,
1291: ,p_source_document_type_id =>
1292: l_line_rec.source_document_type_id);
1293:
1294:
1295: l_line_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
1296: l_line_rec.schedule_action_code := p_sch_action;
1297:
1298: l_return_status := FND_API.G_RET_STS_SUCCESS;
1299: OE_SCHEDULE_UTIL.Validate_Line(p_line_rec => l_line_rec,
1417:
1418: If a line is part of SMC or ATO or if it is a TOP MODEL, selected whole model for processing. If it is a non smc class or kit, select its included items if any.
1419: ----------------------------------------------------------------- */
1420: PROCEDURE Query_Schedule_Lines
1421: ( p_selected_tbl IN OE_GLOBALS.Selected_record_Tbl, --R12.MOAC
1422: p_sch_action IN VARCHAR2,
1423: x_line_tbl IN OUT NOCOPY OE_Order_PUB.Line_Tbl_Type
1424: )
1425: IS
1517: OR l_smc_flag = 'Y') AND
1518: l_schedule_status_code is NOT NULL)
1519: OR l_line_category_code = 'RETURN'
1520: OR l_item_type_code = 'SERVICE'
1521: OR l_source_type_code = OE_GLOBALS.G_SOURCE_EXTERNAL
1522: OR nvl(l_open_flag,'Y') = 'N'
1523: THEN
1524: -- Schedule action is not required for the line.
1525: -- Populate the message on the stack.
1548: -- model will query the line.
1549:
1550: FOR K IN 1..p_selected_tbl.count LOOP -- R12.MOAC
1551: IF l_top_model_line_id = p_selected_tbl(K).id1
1552: OR (l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED AND
1553: l_link_to_line_id = p_selected_tbl(K).id1) THEN
1554: IF l_debug_level > 0 THEN
1555: oe_debug_pub.add( 'PARENT LINE IS PART OF TABLE' || P_SELECTED_TBL(K).ID1 , 2 ) ;
1556: END IF;
1614: END IF;
1615:
1616: ELSIF (l_ato_line_id is not null AND
1617: NOT (l_line_id = l_ato_line_id AND
1618: l_item_type_code IN(OE_GLOBALS.G_ITEM_STANDARD,
1619: OE_GLOBALS.G_ITEM_OPTION)))
1620: THEN
1621:
1622:
1615:
1616: ELSIF (l_ato_line_id is not null AND
1617: NOT (l_line_id = l_ato_line_id AND
1618: l_item_type_code IN(OE_GLOBALS.G_ITEM_STANDARD,
1619: OE_GLOBALS.G_ITEM_OPTION)))
1620: THEN
1621:
1622:
1623: -- Query ato model.
1794: If a line is part of SMC or ATO or if it is a TOP MODEL, selected whole model
1795: for processing. If it is a non smc class or kit, select its included items if any.
1796: ----------------------------------------------------------------- */
1797: PROCEDURE Query_Unschedule_Lines
1798: ( p_selected_tbl IN OE_GLOBALS.Selected_record_Tbl, --R12.MOAC
1799: p_sch_action IN VARCHAR2,
1800: x_line_tbl IN OUT NOCOPY OE_Order_PUB.Line_Tbl_Type
1801: )
1802: IS
1892: OE_MSG_PUB.Add;
1893: ELSIF (l_schedule_status_code IS NULL AND
1894: (l_smc_flag = 'Y' OR
1895: l_ato_line_id is not null OR
1896: l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED OR
1897: l_item_type_code = OE_GLOBALS.G_ITEM_OPTION OR
1898: l_item_type_code = OE_GLOBALS.G_ITEM_STANDARD))
1899: OR l_line_category_code = 'RETURN'
1900: OR l_item_type_code = OE_GLOBALS.G_ITEM_SERVICE
1893: ELSIF (l_schedule_status_code IS NULL AND
1894: (l_smc_flag = 'Y' OR
1895: l_ato_line_id is not null OR
1896: l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED OR
1897: l_item_type_code = OE_GLOBALS.G_ITEM_OPTION OR
1898: l_item_type_code = OE_GLOBALS.G_ITEM_STANDARD))
1899: OR l_line_category_code = 'RETURN'
1900: OR l_item_type_code = OE_GLOBALS.G_ITEM_SERVICE
1901: OR nvl(l_open_flag,'Y') = 'N'
1894: (l_smc_flag = 'Y' OR
1895: l_ato_line_id is not null OR
1896: l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED OR
1897: l_item_type_code = OE_GLOBALS.G_ITEM_OPTION OR
1898: l_item_type_code = OE_GLOBALS.G_ITEM_STANDARD))
1899: OR l_line_category_code = 'RETURN'
1900: OR l_item_type_code = OE_GLOBALS.G_ITEM_SERVICE
1901: OR nvl(l_open_flag,'Y') = 'N'
1902: THEN
1896: l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED OR
1897: l_item_type_code = OE_GLOBALS.G_ITEM_OPTION OR
1898: l_item_type_code = OE_GLOBALS.G_ITEM_STANDARD))
1899: OR l_line_category_code = 'RETURN'
1900: OR l_item_type_code = OE_GLOBALS.G_ITEM_SERVICE
1901: OR nvl(l_open_flag,'Y') = 'N'
1902: THEN
1903: -- line is part of ATO/SMC Model or an ato item which is
1904: -- not scheduled. Bipass these lines.
1924:
1925: --R12.MOAC
1926: FOR K IN 1..p_selected_tbl.count LOOP
1927: IF l_top_model_line_id =p_selected_tbl(K).id1
1928: OR (l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED AND
1929: l_link_to_line_id = p_selected_tbl(K).id1) THEN
1930: l_query := 'N';
1931: exit;
1932: END IF;
1952: -- Decided to query the line. See what to pass to query sets.
1953: IF l_smc_flag = 'Y'
1954: OR (l_ato_line_id is not null AND
1955: NOT (l_line_id = l_ato_line_id AND
1956: l_item_type_code IN(OE_GLOBALS.G_ITEM_STANDARD,
1957: OE_GLOBALS.G_ITEM_OPTION)))
1958: THEN
1959:
1960: -- query using top_model_line_id / ato line id
1953: IF l_smc_flag = 'Y'
1954: OR (l_ato_line_id is not null AND
1955: NOT (l_line_id = l_ato_line_id AND
1956: l_item_type_code IN(OE_GLOBALS.G_ITEM_STANDARD,
1957: OE_GLOBALS.G_ITEM_OPTION)))
1958: THEN
1959:
1960: -- query using top_model_line_id / ato line id
1961:
2196: If line is a top model selected all its children that are scheduled and it is a class or kit select its included items as well or else select by itself.
2197:
2198: ----------------------------------------------------------------- */
2199: PROCEDURE Query_Unreserve_Lines
2200: ( p_selected_tbl IN OE_GLOBALS.Selected_record_Tbl, --R12.MOAC
2201: p_sch_action IN VARCHAR2,
2202: x_line_tbl IN OUT NOCOPY OE_Order_PUB.Line_Tbl_Type
2203: )
2204: IS
2313:
2314: --R12.MOAC
2315: FOR K IN 1..p_selected_tbl.count LOOP
2316: IF l_top_model_line_id = p_selected_tbl(K).id1
2317: OR (l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED AND
2318: l_link_to_line_id = p_selected_tbl(K).id1) THEN
2319: l_query := 'N';
2320: exit;
2321: END IF;
2525: selected then select its included items as well.
2526:
2527: ------------------------------------------------------------------*/
2528: PROCEDURE Query_Reserve_Lines
2529: ( p_selected_tbl IN OE_GLOBALS.Selected_record_Tbl, --R12.MOAC
2530: p_sch_action IN VARCHAR2,
2531: x_line_tbl IN OUT NOCOPY OE_Order_PUB.Line_Tbl_Type
2532: )
2533: IS
2613:
2614:
2615: IF l_line_category_code = 'RETURN'
2616: OR l_item_type_code = 'SERVICE'
2617: OR l_source_type_code = OE_GLOBALS.G_SOURCE_EXTERNAL
2618: OR nvl(l_open_flag,'Y') = 'N' THEN
2619:
2620: -- populate the error message and skip the line.
2621: FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
2639: -- model will query the line.
2640: --R12.MOAC
2641: FOR K IN 1..p_selected_tbl.count LOOP
2642: IF l_top_model_line_id = p_selected_tbl(K).id1
2643: OR (l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED AND
2644: l_link_to_line_id = p_selected_tbl(K).id1) THEN
2645: l_query := 'N';
2646: exit;
2647: END IF;
2708:
2709:
2710: ELSIF (l_ato_line_id is not null AND
2711: NOT (l_line_id = l_ato_line_id AND
2712: l_item_type_code IN(OE_GLOBALS.G_ITEM_STANDARD,
2713: OE_GLOBALS.G_ITEM_OPTION)))
2714: AND l_schedule_status_code is null
2715: THEN
2716:
2709:
2710: ELSIF (l_ato_line_id is not null AND
2711: NOT (l_line_id = l_ato_line_id AND
2712: l_item_type_code IN(OE_GLOBALS.G_ITEM_STANDARD,
2713: OE_GLOBALS.G_ITEM_OPTION)))
2714: AND l_schedule_status_code is null
2715: THEN
2716:
2717: -- Query ato model.
2739: END IF;
2740:
2741: -- 2746802
2742: ELSIF l_ato_line_id = l_line_id
2743: AND l_item_type_code = OE_GLOBALS.G_ITEM_MODEL
2744: AND l_schedule_status_code is not null THEN
2745:
2746: l_config_id := Null;
2747:
3024: IF nvl(l_line_tbl(I).shippable_flag,'N') = 'N'
3025: THEN
3026: IF l_line_tbl(I).ato_line_id IS NOT NULL AND
3027: NOT ( l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id AND
3028: l_line_tbl(I).item_type_code IN ( OE_GLOBALS.G_ITEM_OPTION,
3029: OE_GLOBALS.G_ITEM_STANDARD))
3030: THEN -- check for ato
3031: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_NO_CONFIG');
3032: IF l_debug_level > 0 THEN
3025: THEN
3026: IF l_line_tbl(I).ato_line_id IS NOT NULL AND
3027: NOT ( l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id AND
3028: l_line_tbl(I).item_type_code IN ( OE_GLOBALS.G_ITEM_OPTION,
3029: OE_GLOBALS.G_ITEM_STANDARD))
3030: THEN -- check for ato
3031: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_NO_CONFIG');
3032: IF l_debug_level > 0 THEN
3033: oe_debug_pub.add( 'NON SHIPPABLE ATO LINE' , 2 ) ;
3109: If top model is selected for processing or line part of smc or ato then query whole model. If class or kit is selected then select its included items as well.If line is selected which is part of set then select whole set for processing
3110:
3111: ------------------------------------------------------------------*/
3112: PROCEDURE Query_ATP_CHECK_Lines
3113: ( p_selected_tbl IN OE_GLOBALS.Selected_record_Tbl, --R12.MOAC
3114: p_sch_action IN VARCHAR2,
3115: x_line_tbl IN OUT NOCOPY OE_Order_PUB.Line_Tbl_Type
3116: )
3117: IS
3190: ,p_source_document_type_id => l_source_document_type_id);
3191:
3192: IF l_line_category_code = 'RETURN'
3193: OR l_item_type_code = 'SERVICE'
3194: OR l_source_type_code = OE_GLOBALS.G_SOURCE_EXTERNAL
3195: OR nvl(l_open_flag,'Y') = 'N' THEN
3196:
3197: -- populate the error message and skip the line.
3198: FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
3221: -- model will query the line.
3222: --R12.MOAC
3223: FOR K IN 1..p_selected_tbl.count LOOP
3224: IF l_top_model_line_id = p_selected_tbl(K).id1
3225: OR (l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED AND
3226: l_link_to_line_id = p_selected_tbl(K).id1) THEN
3227: l_query := 'N';
3228: exit;
3229: END IF;
3251: OR l_ship_set_id is not null
3252: OR l_smc_flag = 'Y'
3253: OR (l_ato_line_id is not null AND
3254: NOT (l_line_id = l_ato_line_id AND
3255: l_item_type_code IN(OE_GLOBALS.G_ITEM_STANDARD,
3256: OE_GLOBALS.G_ITEM_OPTION)))
3257: THEN
3258:
3259: IF l_arrival_set_id is not null
3252: OR l_smc_flag = 'Y'
3253: OR (l_ato_line_id is not null AND
3254: NOT (l_line_id = l_ato_line_id AND
3255: l_item_type_code IN(OE_GLOBALS.G_ITEM_STANDARD,
3256: OE_GLOBALS.G_ITEM_OPTION)))
3257: THEN
3258:
3259: IF l_arrival_set_id is not null
3260: OR l_ship_set_id is not null
3636: query api's which will get all approprite a lines. Based on the
3637: action call process group or multi atp check.
3638: ---------------------------------------------------------------*/
3639: Procedure Schedule_Multi_lines
3640: (p_selected_line_tbl IN OE_GLOBALS.Selected_Record_Tbl, --R12.MOAC
3641: p_line_count IN NUMBER,
3642: p_sch_action IN VARCHAR2,
3643: x_atp_tbl OUT NOCOPY /* file.sql.39 change */ OE_ATP.Atp_Tbl_Type,
3644: x_return_status OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
3765:
3766: IF l_debug_level > 0 THEN
3767: oe_debug_pub.add( ' LINE ID : ' || L_LINE_TBL ( I ) .LINE_ID , 4 ) ;
3768: END IF;
3769: l_line_tbl(I).operation := OE_GLOBALS.G_OPR_UPDATE;
3770: l_line_tbl(I).schedule_action_code := p_sch_action;
3771:
3772: IF (l_line_tbl(I).arrival_set_id is not null) THEN
3773: l_set_rec := OE_ORDER_CACHE.Load_Set
3935: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3936: END Schedule_Multi_lines;
3937: /* ------------------------------------------------------------
3938: Procedure schedule_set_lines
3939: (p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
3940: p_entity_id => p_line_rec.line_id,
3941: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
3942: p_requesting_entity_id => p_line_rec.line_id,
3943: p_request_type => OE_GLOBALS.G_SCHEDULE_LINE,
3937: /* ------------------------------------------------------------
3938: Procedure schedule_set_lines
3939: (p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
3940: p_entity_id => p_line_rec.line_id,
3941: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
3942: p_requesting_entity_id => p_line_rec.line_id,
3943: p_request_type => OE_GLOBALS.G_SCHEDULE_LINE,
3944: p_param1 => l_param1,
3945: p_param2 => p_line_rec.header_id,
3939: (p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
3940: p_entity_id => p_line_rec.line_id,
3941: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
3942: p_requesting_entity_id => p_line_rec.line_id,
3943: p_request_type => OE_GLOBALS.G_SCHEDULE_LINE,
3944: p_param1 => l_param1,
3945: p_param2 => p_line_rec.header_id,
3946: p_param3 => l_action,
3947: p_param4 => p_old_line_rec.ship_from_org_id,
4095: oe_debug_pub.add( 'UPDATE SHIPPING : CHILDREN OF MODEL ' || TO_CHAR ( OPTIONREC.LINE_ID ) , 1 ) ;
4096: END IF;
4097:
4098: OE_Delayed_Requests_Pvt.Log_Request(
4099: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4100: p_entity_id => optionrec.line_id,
4101: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4102: p_requesting_entity_id => optionrec.line_id,
4103: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4097:
4098: OE_Delayed_Requests_Pvt.Log_Request(
4099: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4100: p_entity_id => optionrec.line_id,
4101: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4102: p_requesting_entity_id => optionrec.line_id,
4103: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4104: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4105: p_param1 => FND_API.G_TRUE,
4099: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4100: p_entity_id => optionrec.line_id,
4101: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4102: p_requesting_entity_id => optionrec.line_id,
4103: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4104: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4105: p_param1 => FND_API.G_TRUE,
4106: x_return_status => x_return_status);
4107:
4100: p_entity_id => optionrec.line_id,
4101: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4102: p_requesting_entity_id => optionrec.line_id,
4103: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4104: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4105: p_param1 => FND_API.G_TRUE,
4106: x_return_status => x_return_status);
4107:
4108: End loop;
4119: AND l_top_model_line_id is not null
4120: THEN
4121: FOR J IN 1..p_sch_set_tbl.count LOOP
4122: IF (l_link_to_line_id = p_sch_set_tbl(J).entity_id
4123: AND l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED)
4124: OR l_top_model_line_id = p_sch_set_tbl(J).entity_id
4125: THEN
4126: --Parent exists.
4127: IF l_debug_level > 0 THEN
4134: END IF; -- Not top
4135:
4136: ELSE -- GOP Code
4137: -- If the line is present in the table ignore the line.
4138: IF l_item_type_code = OE_GLOBALS.G_ITEM_INCLUDED
4139: THEN
4140: FOR J IN 1..p_sch_set_tbl.count LOOP
4141: IF l_link_to_line_id = p_sch_set_tbl(J).entity_id THEN
4142: --Parent exists.
4158: oe_debug_pub.add(' l_ato_line_id :' || l_ato_line_id,1);
4159: oe_debug_pub.add(' l_item_type_code :'|| l_item_type_code,1);
4160: IF l_line_exists = 'N'
4161: AND nvl(l_top_model_line_id,0) <> p_sch_set_tbl(I).entity_id
4162: AND NOT (l_item_type_code = OE_GLOBALS.G_ITEM_CLASS
4163: AND nvl(l_ato_line_id,-99) = p_sch_set_tbl(I).entity_id) THEN
4164:
4165:
4166: IF l_debug_level > 0 THEN
4247: l_line_tbl(K).change_reason := 'SYSTEM';
4248: l_line_tbl(K).change_comments := 'Delayed Request , Scheduling';
4249: /* End Audit Trail */
4250:
4251: l_line_tbl(K).operation := OE_GLOBALS.G_OPR_UPDATE;
4252:
4253: /* Commented the above line to fix the bug 2916814 */
4254: --3564302 (#1)
4255: -- Get the order date type code
4321: x_return_status => x_return_status);
4322:
4323: ELSIF (l_ato_line_id is not null AND
4324: NOT (l_ato_line_id = p_sch_set_tbl(I).entity_id AND
4325: l_item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
4326: OE_GLOBALS.G_ITEM_OPTION)))
4327: THEN
4328:
4329: OE_Config_Util.Query_ATO_Options
4322:
4323: ELSIF (l_ato_line_id is not null AND
4324: NOT (l_ato_line_id = p_sch_set_tbl(I).entity_id AND
4325: l_item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
4326: OE_GLOBALS.G_ITEM_OPTION)))
4327: THEN
4328:
4329: OE_Config_Util.Query_ATO_Options
4330: ( p_ato_line_id => l_ato_line_id
4328:
4329: OE_Config_Util.Query_ATO_Options
4330: ( p_ato_line_id => l_ato_line_id
4331: ,p_send_cancel_lines => 'Y'
4332: ,p_source_type => OE_Globals.G_SOURCE_INTERNAL
4333: ,x_line_tbl => l_iline_tbl);
4334:
4335:
4336: ELSE
4395:
4396: oe_debug_pub.add('Line is interfaced ',2);
4397:
4398: OE_Delayed_Requests_Pvt.Log_Request(
4399: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4400: p_entity_id => l_iline_tbl(I).line_id,
4401: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4402: p_requesting_entity_id => l_iline_tbl(I).line_id,
4403: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4397:
4398: OE_Delayed_Requests_Pvt.Log_Request(
4399: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4400: p_entity_id => l_iline_tbl(I).line_id,
4401: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4402: p_requesting_entity_id => l_iline_tbl(I).line_id,
4403: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4404: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4405: p_param1 => FND_API.G_TRUE,
4399: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4400: p_entity_id => l_iline_tbl(I).line_id,
4401: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4402: p_requesting_entity_id => l_iline_tbl(I).line_id,
4403: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4404: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4405: p_param1 => FND_API.G_TRUE,
4406: x_return_status => x_return_status);
4407:
4400: p_entity_id => l_iline_tbl(I).line_id,
4401: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4402: p_requesting_entity_id => l_iline_tbl(I).line_id,
4403: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4404: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4405: p_param1 => FND_API.G_TRUE,
4406: x_return_status => x_return_status);
4407:
4408: END IF;
4507: l_line_tbl(K).change_reason := 'SYSTEM';
4508: l_line_tbl(K).change_comments := 'Delayed Request , Scheduling';
4509: /* End Audit Trail */
4510:
4511: l_line_tbl(K).operation := OE_GLOBALS.G_OPR_UPDATE;
4512:
4513: IF p_sch_set_tbl(I).param8 = OE_SCHEDULE_UTIL.OESCH_ENTITY_SHIP_SET
4514: THEN
4515: -- Ship set date.
4654:
4655: IF l_debug_level > 0 THEN
4656: oe_debug_pub.add('Stng G_CASCADING_REQUEST_LOGGED to TRUE',2);
4657: END IF;
4658: OE_GLOBALS.G_CASCADING_REQUEST_LOGGED := TRUE;
4659:
4660: Schedule_Set(p_request_rec => l_request_rec,
4661: x_return_status => x_return_status);
4662:
4754:
4755: IF l_line_tbl(I).shipping_interfaced_flag = 'Y'
4756: AND l_line_tbl(I).Ordered_quantity > 0 THEN
4757: OE_Delayed_Requests_Pvt.Log_Request(
4758: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4759: p_entity_id => l_line_tbl(I).line_id,
4760: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4761: p_requesting_entity_id => l_line_tbl(I).line_id,
4762: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4756: AND l_line_tbl(I).Ordered_quantity > 0 THEN
4757: OE_Delayed_Requests_Pvt.Log_Request(
4758: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4759: p_entity_id => l_line_tbl(I).line_id,
4760: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4761: p_requesting_entity_id => l_line_tbl(I).line_id,
4762: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4763: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4764: p_param1 => FND_API.G_TRUE,
4758: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4759: p_entity_id => l_line_tbl(I).line_id,
4760: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4761: p_requesting_entity_id => l_line_tbl(I).line_id,
4762: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4763: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4764: p_param1 => FND_API.G_TRUE,
4765: x_return_status => x_return_status);
4766: END IF;
4759: p_entity_id => l_line_tbl(I).line_id,
4760: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4761: p_requesting_entity_id => l_line_tbl(I).line_id,
4762: p_request_type => OE_GLOBALS.G_UPDATE_SHIPPING,
4763: p_request_unique_key1 => OE_GLOBALS.G_OPR_UPDATE,
4764: p_param1 => FND_API.G_TRUE,
4765: x_return_status => x_return_status);
4766: END IF;
4767: END IF; -- Part of Model.
4825:
4826: /* ---------------------------------------------------------------
4827: Procedure : Schedule_Set
4828: Description:
4829: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4830: p_entity_id => p_line_rec.line_id,
4831: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4832: p_requesting_entity_id => p_line_rec.line_id,
4833: p_request_type => OE_GLOBALS.G_GROUP_SCHEDULE,
4827: Procedure : Schedule_Set
4828: Description:
4829: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4830: p_entity_id => p_line_rec.line_id,
4831: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4832: p_requesting_entity_id => p_line_rec.line_id,
4833: p_request_type => OE_GLOBALS.G_GROUP_SCHEDULE,
4834: p_param1 => l_param1,ship_set_id/arrival_set_id
4835: p_param2 => p_line_rec.header_id,
4829: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4830: p_entity_id => p_line_rec.line_id,
4831: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
4832: p_requesting_entity_id => p_line_rec.line_id,
4833: p_request_type => OE_GLOBALS.G_GROUP_SCHEDULE,
4834: p_param1 => l_param1,ship_set_id/arrival_set_id
4835: p_param2 => p_line_rec.header_id,
4836: p_param3 => l_action,
4837: p_param4 => p_old_line_rec.ship_from_org_id,
5090:
5091: FOR I IN 1..l_line_tbl.count LOOP
5092:
5093: IF l_line_tbl(I).schedule_status_code IS NULL OR
5094: (l_line_tbl(I).item_type_code <> OE_GLOBALS.G_ITEM_STANDARD AND
5095: nvl(l_line_tbl(I).model_remnant_flag,'N') = 'N') THEN
5096:
5097: IF l_debug_level > 0 THEN
5098: oe_debug_pub.add( 'UNABLE TO BYPASS' , 2 ) ;
5234: AND nvl(l_line_tbl(I).override_atp_date_code,'N') = 'N' THEN
5235:
5236: IF (l_line_tbl(I).ato_line_id is not null AND
5237: NOT (l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id AND
5238: l_line_tbl(I).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
5239: OE_GLOBALS.G_ITEM_OPTION)))
5240: THEN
5241:
5242: BEGIN
5235:
5236: IF (l_line_tbl(I).ato_line_id is not null AND
5237: NOT (l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id AND
5238: l_line_tbl(I).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
5239: OE_GLOBALS.G_ITEM_OPTION)))
5240: THEN
5241:
5242: BEGIN
5243:
5259: END;
5260: IF l_debug_level > 0 THEN
5261: oe_debug_pub.add( 'override_atp for ato :' || L_LINE_TBL ( I ) .OVERRIDE_ATP_DATE_CODE || L_LINE_TBL ( I ) .LINE_ID , 3 ) ;
5262: END IF;
5263: ELSIF l_line_tbl(I).item_type_code = OE_GLOBALS.G_ITEM_INCLUDED THEN
5264:
5265:
5266: BEGIN
5267:
5349: oe_schedule_util.OE_sch_Attrb_Tbl
5350: (l_line_tbl(I).top_model_line_id).date_attribute1;
5351: ELSIF l_line_tbl(I).ato_line_id is not null
5352: AND NOT(l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id
5353: AND l_line_tbl(I).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
5354: OE_GLOBALS.G_ITEM_OPTION))
5355: AND oe_schedule_util.OE_sch_Attrb_Tbl.EXISTS
5356: (l_line_tbl(I).ato_line_id )
5357: AND oe_schedule_util.OE_sch_Attrb_Tbl (l_line_tbl(I).ato_line_id)
5350: (l_line_tbl(I).top_model_line_id).date_attribute1;
5351: ELSIF l_line_tbl(I).ato_line_id is not null
5352: AND NOT(l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id
5353: AND l_line_tbl(I).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
5354: OE_GLOBALS.G_ITEM_OPTION))
5355: AND oe_schedule_util.OE_sch_Attrb_Tbl.EXISTS
5356: (l_line_tbl(I).ato_line_id )
5357: AND oe_schedule_util.OE_sch_Attrb_Tbl (l_line_tbl(I).ato_line_id)
5358: .date_attribute1 is not null
5359: THEN
5360: l_line_tbl(I).request_date :=
5361: oe_schedule_util.OE_sch_Attrb_Tbl
5362: (l_line_tbl(I).ato_line_id).date_attribute1;
5363: ELSIF l_line_tbl(I).item_type_code = OE_GLOBALS.G_ITEM_INCLUDED
5364: AND oe_schedule_util.OE_sch_Attrb_Tbl.EXISTS
5365: (l_line_tbl(I).link_to_line_id )
5366: AND oe_schedule_util.OE_sch_Attrb_Tbl
5367: (l_line_tbl(I).link_to_line_id).date_attribute1 is not null
5373: END IF;
5374: -- End 2787962
5375:
5376: IF (l_request_date is not null
5377: AND NOT OE_GLOBALS.Equal( l_request_date,
5378: l_old_request_date)) THEN
5379:
5380: IF NOT l_set_overridden THEN
5381: --4483035
5396: l_set_schedule_ship_date;
5397: -- 4929511 :Commented
5398: /*
5399: ELSIF (l_schedule_ship_date is not null
5400: AND NOT OE_GLOBALS.Equal( l_schedule_ship_date,
5401: l_old_schedule_ship_date)) THEN
5402: l_line_tbl(I).schedule_ship_date :=
5403: l_schedule_ship_date;
5404: */
5418: l_set_schedule_arrival_date;
5419: -- 4929511 :Commented
5420: /*
5421: ELSIF (l_schedule_arrival_date is not null
5422: AND NOT OE_GLOBALS.Equal( l_schedule_arrival_date,
5423: l_old_schedule_arrival_date)) THEN
5424: l_line_tbl(I).schedule_arrival_date :=
5425: l_schedule_arrival_date;
5426: */
5426: */
5427: END IF;
5428: -- END IF; -- 2716220
5429:
5430: l_line_tbl(I).operation := OE_GLOBALS.G_OPR_UPDATE;
5431: IF l_debug_level > 0 THEN
5432: oe_debug_pub.add('request date :' || l_line_tbl(i).request_date , 1 ) ;
5433: oe_debug_pub.add('schedule_ship_date :' || l_line_tbl(I).schedule_ship_date , 1 ) ;
5434: oe_debug_pub.add('schedule_arrival_date :' || l_line_tbl(I).schedule_arrival_date , 1 ) ;
5486: oe_schedule_util.OE_sch_Attrb_Tbl
5487: (l_line_tbl(I).top_model_line_id).date_attribute1;
5488: ELSIF l_line_tbl(I).ato_line_id is not null
5489: AND NOT(l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id
5490: AND l_line_tbl(I).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
5491: OE_GLOBALS.G_ITEM_OPTION))
5492: AND oe_schedule_util.OE_sch_Attrb_Tbl.EXISTS
5493: (l_line_tbl(I).ato_line_id )
5494: AND oe_schedule_util.OE_sch_Attrb_Tbl (l_line_tbl(I).ato_line_id)
5487: (l_line_tbl(I).top_model_line_id).date_attribute1;
5488: ELSIF l_line_tbl(I).ato_line_id is not null
5489: AND NOT(l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id
5490: AND l_line_tbl(I).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
5491: OE_GLOBALS.G_ITEM_OPTION))
5492: AND oe_schedule_util.OE_sch_Attrb_Tbl.EXISTS
5493: (l_line_tbl(I).ato_line_id )
5494: AND oe_schedule_util.OE_sch_Attrb_Tbl (l_line_tbl(I).ato_line_id)
5495: .date_attribute1 is not null
5496: THEN
5497: l_line_tbl(I).request_date :=
5498: oe_schedule_util.OE_sch_Attrb_Tbl
5499: (l_line_tbl(I).ato_line_id).date_attribute1;
5500: ELSIF l_line_tbl(I).item_type_code = OE_GLOBALS.G_ITEM_INCLUDED
5501: AND oe_schedule_util.OE_sch_Attrb_Tbl.EXISTS
5502: (l_line_tbl(I).link_to_line_id )
5503: AND oe_schedule_util.OE_sch_Attrb_Tbl
5504: (l_line_tbl(I).link_to_line_id).date_attribute1 is not null
5521: oe_schedule_util.OE_sch_Attrb_Tbl
5522: (l_line_tbl(I).top_model_line_id).attribute1;
5523: ELSIF l_line_tbl(I).ato_line_id is not null
5524: AND NOT(l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id
5525: AND l_line_tbl(I).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
5526: OE_GLOBALS.G_ITEM_OPTION))
5527: AND oe_schedule_util.OE_sch_Attrb_Tbl.EXISTS
5528: (l_line_tbl(I).ato_line_id )
5529: AND oe_schedule_util.OE_sch_Attrb_Tbl (l_line_tbl(I).ato_line_id)
5522: (l_line_tbl(I).top_model_line_id).attribute1;
5523: ELSIF l_line_tbl(I).ato_line_id is not null
5524: AND NOT(l_line_tbl(I).ato_line_id = l_line_tbl(I).line_id
5525: AND l_line_tbl(I).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
5526: OE_GLOBALS.G_ITEM_OPTION))
5527: AND oe_schedule_util.OE_sch_Attrb_Tbl.EXISTS
5528: (l_line_tbl(I).ato_line_id )
5529: AND oe_schedule_util.OE_sch_Attrb_Tbl (l_line_tbl(I).ato_line_id)
5530: .attribute1 is not null
5536:
5537: -- 2391781
5538:
5539: IF (l_request_date is not null
5540: AND NOT OE_GLOBALS.Equal( l_request_date,
5541: l_old_request_date)) THEN
5542: IF NOT l_set_overridden THEN
5543: --4483035
5544: --l_line_tbl(I).schedule_arrival_date := l_request_date;
5556: l_set_schedule_arrival_date;
5557: --4929511 : Commented
5558: /*
5559: ELSIF (l_schedule_arrival_date is not null
5560: AND NOT OE_GLOBALS.Equal( l_schedule_arrival_date,
5561: l_old_schedule_arrival_date)) THEN
5562: l_line_tbl(I).schedule_arrival_date := l_schedule_arrival_date;
5563: */
5564: END IF;
5572: l_set_schedule_ship_date;
5573: --4929511 : Commented
5574: /*
5575: ELSIF (l_schedule_ship_date is not null
5576: AND NOT OE_GLOBALS.Equal( l_schedule_ship_date,
5577: l_old_schedule_ship_date)) THEN
5578: l_line_tbl(I).schedule_ship_date :=
5579: l_schedule_ship_date;
5580: */
5585: oe_debug_pub.add( 'REQUEST ARRIVAL DATE :' || L_LINE_TBL ( I ) .SCHEDULE_ARRIVAL_DATE , 1 ) ;
5586: END IF;
5587:
5588:
5589: l_line_tbl(I).operation := OE_GLOBALS.G_OPR_UPDATE;
5590:
5591: END LOOP;
5592: END IF;
5593:
5755: IF l_debug_level > 0 THEN
5756: oe_debug_pub.add('l_operation :' || l_operation,2);
5757: oe_debug_pub.add('l_set_rec.set_status :' || l_set_rec.set_status,2);
5758: END IF;
5759: IF l_operation = OE_GLOBALS.G_OPR_CREATE
5760: AND l_set_rec.set_status = 'T' THEN
5761: -- Could not schedule the line on the set date. Let's schedule
5762: -- the whole set to see if we get another date got the whole
5763: -- set.
5898: END IF;
5899: EXCEPTION
5900: WHEN FND_API.G_EXC_ERROR THEN
5901: --3543774 If new set show the error message
5902: IF p_request_rec.request_type = OE_GLOBALS.G_GROUP_SCHEDULE
5903: AND ((l_entity_type =
5904: OE_SCHEDULE_UTIL.OESCH_ENTITY_SHIP_SET
5905: AND NOT OE_GLOBALS.equal(l_ship_set_id,l_old_ship_set_id))
5906: OR (l_entity_type =
5901: --3543774 If new set show the error message
5902: IF p_request_rec.request_type = OE_GLOBALS.G_GROUP_SCHEDULE
5903: AND ((l_entity_type =
5904: OE_SCHEDULE_UTIL.OESCH_ENTITY_SHIP_SET
5905: AND NOT OE_GLOBALS.equal(l_ship_set_id,l_old_ship_set_id))
5906: OR (l_entity_type =
5907: OE_SCHEDULE_UTIL.OESCH_ENTITY_ARRIVAL_SET
5908: AND NOT OE_GLOBALS.equal(l_arrival_set_id,l_old_arrival_set_id)))
5909: THEN
5904: OE_SCHEDULE_UTIL.OESCH_ENTITY_SHIP_SET
5905: AND NOT OE_GLOBALS.equal(l_ship_set_id,l_old_ship_set_id))
5906: OR (l_entity_type =
5907: OE_SCHEDULE_UTIL.OESCH_ENTITY_ARRIVAL_SET
5908: AND NOT OE_GLOBALS.equal(l_arrival_set_id,l_old_arrival_set_id)))
5909: THEN
5910: fnd_message.set_name('ONT','OE_SCH_SET_INS_FAILED');
5911: OE_MSG_PUB.Add;
5912: END IF;
5937: /***************************************************
5938: Procedure Group_Schedule_sets has been written to take care
5939: of set_for_each_line project.
5940:
5941: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
5942: p_entity_id => nvl(p_line_rec.ship_set_id,p_line_rec.arrival_set_
5943: id),
5944: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
5945: p_requesting_entity_id => p_line_rec.line_id,
5940:
5941: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
5942: p_entity_id => nvl(p_line_rec.ship_set_id,p_line_rec.arrival_set_
5943: id),
5944: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
5945: p_requesting_entity_id => p_line_rec.line_id,
5946: p_request_type => OE_GLOBALS.G_GROUP_SET,
5947: p_param1 => l_set_type,
5948: p_param2 => p_line_rec.header_id,
5942: p_entity_id => nvl(p_line_rec.ship_set_id,p_line_rec.arrival_set_
5943: id),
5944: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_LINE,
5945: p_requesting_entity_id => p_line_rec.line_id,
5946: p_request_type => OE_GLOBALS.G_GROUP_SET,
5947: p_param1 => l_set_type,
5948: p_param2 => p_line_rec.header_id,
5949: p_param3 => p_line_rec.line_id,
5950: p_param4 => p_line_rec.top_model_line_id,
6088:
6089: IF nvl(l_line_tbl(J).override_atp_date_code,'N') = 'N'
6090: AND (l_line_tbl(J).ato_line_id is not null AND
6091: NOT (l_line_tbl(J).ato_line_id = l_line_tbl(J).line_id AND
6092: l_line_tbl(J).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
6093: OE_GLOBALS.G_ITEM_OPTION)))
6094: THEN
6095:
6096: BEGIN
6089: IF nvl(l_line_tbl(J).override_atp_date_code,'N') = 'N'
6090: AND (l_line_tbl(J).ato_line_id is not null AND
6091: NOT (l_line_tbl(J).ato_line_id = l_line_tbl(J).line_id AND
6092: l_line_tbl(J).item_type_code IN (OE_GLOBALS.G_ITEM_STANDARD,
6093: OE_GLOBALS.G_ITEM_OPTION)))
6094: THEN
6095:
6096: BEGIN
6097: