12:
13: TYPE type_cursor IS REF CURSOR;
14: so_cursor type_cursor;
15: sql_stmt varchar2(2000);
16: x_return_status varchar2(1) :=FND_API.G_RET_STS_SUCCESS;
17: x_crm_return_status varchar2(1) :=FND_API.G_RET_STS_SUCCESS;
18: a number;
19: p_so_table OE_SCHEDULE_GRP.Sch_Tbl_Type;
20: p_crm_so_table AHL_LTP_ASCP_ORDERS_PVT.Sched_Orders_Tbl;
13: TYPE type_cursor IS REF CURSOR;
14: so_cursor type_cursor;
15: sql_stmt varchar2(2000);
16: x_return_status varchar2(1) :=FND_API.G_RET_STS_SUCCESS;
17: x_crm_return_status varchar2(1) :=FND_API.G_RET_STS_SUCCESS;
18: a number;
19: p_so_table OE_SCHEDULE_GRP.Sch_Tbl_Type;
20: p_crm_so_table AHL_LTP_ASCP_ORDERS_PVT.Sched_Orders_Tbl;
21:
582:
583: IF p_crm_so_table.count >0 then
584: AHL_LTP_ASCP_ORDERS_PVT.Update_Scheduling_Results(
585: 1.0,
586: FND_API.g_false,
587: FND_API.g_false,
588: FND_API.g_valid_level_full,
589: p_crm_so_table,
590: x_crm_return_status);
583: IF p_crm_so_table.count >0 then
584: AHL_LTP_ASCP_ORDERS_PVT.Update_Scheduling_Results(
585: 1.0,
586: FND_API.g_false,
587: FND_API.g_false,
588: FND_API.g_valid_level_full,
589: p_crm_so_table,
590: x_crm_return_status);
591: commit;
584: AHL_LTP_ASCP_ORDERS_PVT.Update_Scheduling_Results(
585: 1.0,
586: FND_API.g_false,
587: FND_API.g_false,
588: FND_API.g_valid_level_full,
589: p_crm_so_table,
590: x_crm_return_status);
591: commit;
592: END IF;
594:
595:
596: -- send workflow notification for the failed so
597: for a in 1..so_count loop
598: if nvl(p_so_table(a).x_return_status, FND_API.G_RET_STS_ERROR) <>
599: FND_API.G_RET_STS_SUCCESS or
600: p_so_table(a).x_override_atp_date_code = 'Y' then
601: sql_stmt:=
602: ' update msc_sales_order_interface'||p_dblink||
595:
596: -- send workflow notification for the failed so
597: for a in 1..so_count loop
598: if nvl(p_so_table(a).x_return_status, FND_API.G_RET_STS_ERROR) <>
599: FND_API.G_RET_STS_SUCCESS or
600: p_so_table(a).x_override_atp_date_code = 'Y' then
601: sql_stmt:=
602: ' update msc_sales_order_interface'||p_dblink||
603: ' set return_status = :p_status '||
603: ' set return_status = :p_status '||
604: ' where sr_instance_id = :p_instance_id '||
605: ' and batch_id = :p_batch_id '||
606: ' and line_id = :p_line_id ';
607: if nvl(p_so_table(a).x_return_status, FND_API.G_RET_STS_ERROR) <>
608: FND_API.G_RET_STS_SUCCESS then
609: --14356932, show orderNum/LineNum in the request log for failed lines
610: p_order_num := null;
611: p_line_num := null;
604: ' where sr_instance_id = :p_instance_id '||
605: ' and batch_id = :p_batch_id '||
606: ' and line_id = :p_line_id ';
607: if nvl(p_so_table(a).x_return_status, FND_API.G_RET_STS_ERROR) <>
608: FND_API.G_RET_STS_SUCCESS then
609: --14356932, show orderNum/LineNum in the request log for failed lines
610: p_order_num := null;
611: p_line_num := null;
612: OPEN ord_num_c(p_so_table(a).line_id);
632: if (x_return_status = 'W') then
633: retcode := 1; -- warning
634: end if;
635:
636: IF nvl(x_crm_return_status, FND_API.G_RET_STS_ERROR) <>
637: FND_API.G_RET_STS_SUCCESS THEN
638: p_status := 2; -- fails
639: retcode :=2;
640: sql_stmt:=
633: retcode := 1; -- warning
634: end if;
635:
636: IF nvl(x_crm_return_status, FND_API.G_RET_STS_ERROR) <>
637: FND_API.G_RET_STS_SUCCESS THEN
638: p_status := 2; -- fails
639: retcode :=2;
640: sql_stmt:=
641: ' update msc_sales_order_interface'||p_dblink||