DBA Data[Home] [Help]

APPS.CSP_SCH_INT_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 216

 PROCEDURE DELETE_RESERVATION(p_reservation_id IN NUMBER
                                ,x_return_status     OUT NOCOPY VARCHAR2
                                ,x_msg_data         OUT NOCOPY VARCHAR2);
Line: 251

        select distinct(crl.requirement_line_id) req_line_id
        from csp_requirement_lines  crl,csp_requirement_headers crh
        where crh.task_id = p_task_id
        and crl.requirement_header_id = crh.requirement_header_id;
Line: 257

        select task_assignment_id
        from jtf_task_assignments
        where task_id = p_task_id;
Line: 274

                SELECT csp.organization_id
                FROM CSP_RS_SUBINVENTORIES_V csp
                WHERE csp.resource_type = v_rs_type
                AND csp.resource_id     = v_rs_id
                AND csp.condition_type  = 'G'
                AND csp.default_flag    = 'Y';
Line: 342

                SELECT count(l.requirement_line_id)
                into l_partial_line
                FROM csp_requirement_headers h,
                  csp_requirement_lines l,
                  csp_req_line_details d,
                  oe_order_lines_all oola
                WHERE h.task_id             = p_task_id
                AND h.task_assignment_id    = r_asgn.task_assignment_id
                AND h.requirement_header_id = l.requirement_header_id
                AND l.requirement_line_id   = d.requirement_line_id
                and d.source_type = 'IO'
                AND d.source_id = oola.line_id
                and csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code) = 'PARTIALLY RECEIVED';
Line: 376

                SELECT COUNT(l.requirement_line_id)
                into l_fl_rcvd_lines
                FROM csp_requirement_headers h,
                  csp_requirement_lines l,
                  csp_req_line_details dio,
                  csp_req_line_details dres,
                  oe_order_lines_all oola,
                  mtl_reservations mr
                WHERE h.task_id             = p_task_id
                AND h.task_assignment_id    = r_asgn.task_assignment_id
                AND h.address_type         IN ('R', 'S')
                AND h.requirement_header_id = l.requirement_header_id
                AND l.requirement_line_id   = dio.requirement_line_id
                AND dio.source_type        = 'IO'
                and dio.source_id = oola.line_id
                AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)        = 'FULLY RECEIVED'
                AND dio.requirement_line_id = dres.requirement_line_id
                AND oola.inventory_item_id    = mr.inventory_item_id
                AND oola.ordered_quantity   = mr.reservation_quantity
                AND dres.source_type       = 'RES'
                AND dres.source_id = mr.reservation_id;
Line: 405

                        SELECT ooha.order_number
                        into l_order_number
                        FROM csp_requirement_headers h,
                          csp_requirement_lines l,
                          csp_req_line_details dio,
                          oe_order_lines_all oola,
                          oe_order_headers_all ooha
                        WHERE h.task_id             = p_task_id
                        AND h.task_assignment_id    = r_asgn.task_assignment_id
                        AND h.address_type         IN ('R', 'S')
                        AND h.requirement_header_id = l.requirement_header_id
                        AND l.requirement_line_id   = dio.requirement_line_id
                        AND dio.source_type        = 'IO'
                        and dio.source_id = oola.line_id
                        and oola.header_id = ooha.header_id
                        AND rownum                  = 1;
Line: 434

                SELECT COUNT(l.requirement_line_id)
                into l_fl_rcvd_lines
                FROM csp_requirement_headers h,
                  csp_requirement_lines l,
                  csp_req_line_details dio,
                  csp_req_line_details dres,
                  oe_order_lines_all oola,
                  mtl_reservations mr
                WHERE h.task_id             = p_task_id
                AND h.task_assignment_id    = r_asgn.task_assignment_id
                AND h.address_type         IN ('T', 'C', 'P')
                AND h.requirement_header_id = l.requirement_header_id
                AND l.requirement_line_id   = dio.requirement_line_id
                AND dio.source_type        = 'IO'
                and dio.source_id = oola.line_id
                AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)        = 'FULLY RECEIVED'
                AND dio.requirement_line_id = dres.requirement_line_id
                AND oola.inventory_item_id    = mr.inventory_item_id
                AND oola.ordered_quantity   = mr.reservation_quantity
                AND dres.source_type       = 'RES'
                AND dres.source_id = mr.reservation_id;
Line: 466

                        SELECT COUNT(l.requirement_line_id)
                        into l_fl_rcvd_multi_source
                        FROM csp_requirement_headers h,
                          csp_requirement_lines l,
                          csp_req_line_details dio,
                          csp_req_line_details dres,
                          csp_req_line_details dother,
                          oe_order_lines_all oola,
                          mtl_reservations mr
                        WHERE h.task_id             = p_task_id
                        AND h.task_assignment_id    = r_asgn.task_assignment_id
                        AND h.address_type         IN ('T', 'C', 'P')
                        AND h.requirement_header_id = l.requirement_header_id
                        AND l.requirement_line_id   = dio.requirement_line_id
                        AND dio.source_type        = 'IO'
                        AND dio.source_id = oola.line_id
                        AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)         = 'FULLY RECEIVED'
                        AND dio.requirement_line_id = dres.requirement_line_id
                        AND oola.inventory_item_id    = mr.inventory_item_id
                        AND oola.ordered_quantity   = mr.reservation_quantity
                        AND dres.source_type       = 'RES'
                        AND dres.source_id = mr.reservation_id
                        AND l.requirement_line_id   = dother.requirement_line_id
                        AND dother.source_id       <> dio.source_id
                        AND dother.source_id       <> dres.source_id;
Line: 510

                        SELECT COUNT(requirement_line_id)
                        into l_oth_req_line
                        FROM
                          (SELECT l.requirement_line_id
                          FROM csp_requirement_headers h,
                                csp_requirement_lines l,
                                csp_req_line_details d
                          WHERE h.task_id             = p_task_id
                          AND h.task_assignment_id    = r_asgn.task_assignment_id
                          AND h.requirement_header_id = l.requirement_header_id
                          AND h.address_type         IN ('T', 'C', 'P')
                          AND l.requirement_line_id   = d.requirement_line_id
                          MINUS
                          SELECT l.requirement_line_id
                          FROM csp_requirement_headers h,
                                csp_requirement_lines l,
                                csp_req_line_details dio,
                                csp_req_line_details dres,
                                oe_order_lines_all oola,
                                mtl_reservations mr
                          WHERE h.task_id             = p_task_id
                          AND h.task_assignment_id    = r_asgn.task_assignment_id
                          AND h.address_type         IN ('T', 'C', 'P')
                          AND h.requirement_header_id = l.requirement_header_id
                          AND l.requirement_line_id   = dio.requirement_line_id
                          AND dio.source_type        = 'IO'
                          AND dio.source_id = oola.line_id
                          AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)       = 'FULLY RECEIVED'
                          AND dio.requirement_line_id = dres.requirement_line_id
                          AND oola.inventory_item_id    = mr.inventory_item_id
                          AND oola.ordered_quantity   = mr.reservation_quantity
                          AND dres.source_type       = 'RES'
                          AND dres.source_id = mr.reservation_id
                          );
Line: 563

                        SELECT COUNT(requirement_line_id)
                        into l_non_src_line
                        FROM
                          (SELECT l.requirement_line_id
                          FROM csp_requirement_headers h,
                                csp_requirement_lines l
                          WHERE h.task_id             = p_task_id
                          AND h.task_assignment_id    = r_asgn.task_assignment_id
                          AND h.requirement_header_id = l.requirement_header_id
                          AND h.address_type         IN ('T', 'C', 'P')
                          AND (SELECT COUNT (d.requirement_line_id)
                                FROM csp_req_line_details d
                                WHERE d.requirement_line_id = l.requirement_line_id) = 0
                          MINUS
                          SELECT l.requirement_line_id
                          FROM csp_requirement_headers h,
                                csp_requirement_lines l,
                                csp_req_line_details dio,
                                csp_req_line_details dres,
                                oe_order_lines_all oola,
                                mtl_reservations mr
                          WHERE h.task_id             = p_task_id
                          AND h.task_assignment_id    = r_asgn.task_assignment_id
                          AND h.address_type         IN ('T', 'C', 'P')
                          AND h.requirement_header_id = l.requirement_header_id
                          AND l.requirement_line_id   = dio.requirement_line_id
                          AND dio.source_type        = 'IO'
                          AND dio.source_id = oola.line_id
                          AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)        = 'FULLY RECEIVED'
                          AND dio.requirement_line_id = dres.requirement_line_id
                          AND oola.inventory_item_id    = mr.inventory_item_id
                          AND oola.ordered_quantity   = mr.reservation_quantity
                          AND dres.source_type       = 'RES'
                          AND dres.source_id = mr.reservation_id
                          );
Line: 628

                SELECT COUNT(l.requirement_line_id)
                into l_shpd_lines
                FROM csp_requirement_headers h,
                  csp_requirement_lines l,
                  csp_req_line_details d,
                  oe_order_lines_all oola
                WHERE h.task_id             = p_task_id
                AND h.task_assignment_id    = r_asgn.task_assignment_id
                AND h.requirement_header_id = l.requirement_header_id
                AND l.requirement_line_id   = d.requirement_line_id
                AND d.source_type          = 'IO'
                AND d.source_id = oola.line_id
                AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)          in ('SHIPPED', 'EXPECTED');
Line: 650

                        SELECT count(h.address_type)
                        into l_tech_spec_pr
                        FROM csp_requirement_headers h
                        WHERE h.task_id          = p_task_id
                        AND h.task_assignment_id = r_asgn.task_assignment_id
                        AND h.address_type      IN ('R', 'S');
Line: 664

                                SELECT ooha.order_number
                                INTO l_order_number
                                FROM csp_requirement_headers h,
                                  csp_requirement_lines l,
                                  csp_req_line_details d,
                                  oe_order_lines_all oola,
                                  oe_order_headers_all ooha
                                WHERE h.task_assignment_id  = r_asgn.task_assignment_id
                                AND h.task_id               = p_task_id
                                AND h.requirement_header_id = l.requirement_header_id
                                AND l.requirement_line_id   = d.requirement_line_id
                                AND d.source_type          = 'IO'
                                AND d.source_id = oola.line_id
                                AND oola.header_id = ooha.header_id
                                AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)         IN ('SHIPPED', 'EXPECTED')
                                AND rownum                  = 1;
Line: 692

                                SELECT COUNT(l.requirement_line_id)
                                into l_ship_multi_src
                                FROM csp_requirement_headers h,
                                  csp_requirement_lines l,
                                  csp_req_line_details d,
                                  csp_req_line_details dother,
                                  oe_order_lines_all oola
                                WHERE h.task_id                = p_task_id
                                AND h.task_assignment_id       = r_asgn.task_assignment_id
                                AND h.requirement_header_id    = l.requirement_header_id
                                AND l.requirement_line_id      = d.requirement_line_id
                                AND h.address_type         IN ('T', 'C', 'P')
                                AND d.source_type             = 'IO'
                                AND d.source_id = oola.line_id
                                AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)              in ('SHIPPED', 'EXPECTED')
                                AND dother.requirement_line_id = l.requirement_line_id
                                AND dother.source_id          <> d.source_id;
Line: 728

                                SELECT COUNT(requirement_line_id)
                                into l_oth_req_line
                                FROM
                                  (SELECT l.requirement_line_id
                                  FROM csp_requirement_headers h,
                                        csp_requirement_lines l,
                                        csp_req_line_details d
                                  WHERE h.task_id             = p_task_id
                                  AND h.task_assignment_id    = r_asgn.task_assignment_id
                                  AND h.requirement_header_id = l.requirement_header_id
                                  AND l.requirement_line_id   = d.requirement_line_id
                                  MINUS
                                  SELECT l.requirement_line_id
                                  FROM csp_requirement_headers h,
                                        csp_requirement_lines l,
                                        csp_req_line_details d,
                                        oe_order_lines_all oola
                                  WHERE h.task_id             = p_task_id
                                  AND h.task_assignment_id    = r_asgn.task_assignment_id
                                  AND h.requirement_header_id = l.requirement_header_id
                                  AND l.requirement_line_id   = d.requirement_line_id
                                  AND d.source_type          = 'IO'
                                  AND d.source_id = oola.line_id
                                  AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)          in ('SHIPPED', 'EXPECTED')
                                  );
Line: 772

                                SELECT COUNT(requirement_line_id)
                                into l_non_src_line
                                FROM
                                  (SELECT l.requirement_line_id
                                  FROM csp_requirement_headers h,
                                        csp_requirement_lines l
                                  WHERE h.task_id             = p_task_id
                                  AND h.task_assignment_id    = r_asgn.task_assignment_id
                                  AND h.requirement_header_id = l.requirement_header_id
                                  AND (SELECT COUNT (d.requirement_line_id)
                                                                FROM csp_req_line_details d
                                                                WHERE d.requirement_line_id = l.requirement_line_id) = 0
                                  MINUS
                                  SELECT l.requirement_line_id
                                  FROM csp_requirement_headers h,
                                        csp_requirement_lines l,
                                        csp_req_line_details d,
                                        oe_order_lines_all oola
                                  WHERE h.task_id             = p_task_id
                                  AND h.task_assignment_id    = r_asgn.task_assignment_id
                                  AND h.requirement_header_id = l.requirement_header_id
                                  AND l.requirement_line_id   = d.requirement_line_id
                                  AND d.source_type          = 'IO'
                                  AND d.source_id = oola.line_id
                                  AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)         in ('SHIPPED', 'EXPECTED')
                                  );
Line: 807

                                        SELECT MAX(oel.request_date)
                                        into l_old_arrival_date
                                        FROM csp_requirement_headers h,
                                          csp_requirement_lines l,
                                          csp_req_line_details d,
                                          oe_order_lines_all oel
                                        WHERE h.task_id             = p_task_id
                                        AND h.task_assignment_id    = r_asgn.task_assignment_id
                                        AND h.requirement_header_id = l.requirement_header_id
                                        AND l.requirement_line_id   = d.requirement_line_id
                                        AND d.source_type          = 'IO'
                                        AND csp_pick_utils.get_order_status(oel.line_id,oel.flow_status_code)       in ('SHIPPED', 'EXPECTED')
                                        AND d.source_id             = oel.line_id;
Line: 828

                                        SELECT ch.destination_organization_id
                                        into l_dest_ou
                                        FROM csp_requirement_headers ch
                                        WHERE ch.task_id                     = p_task_id
                                        AND ch.task_assignment_id          = r_asgn.task_assignment_id
                                        AND rownum                         = 1;
Line: 893

                                SELECT MAX(oel.request_date)
                                into l_old_arrival_date
                                FROM csp_requirement_headers h,
                                  csp_requirement_lines l,
                                  csp_req_line_details d,
                                  oe_order_lines_all oel
                                WHERE h.task_id             = p_task_id
                                AND h.task_assignment_id    = r_asgn.task_assignment_id
                                AND h.requirement_header_id = l.requirement_header_id
                                AND l.requirement_line_id   = d.requirement_line_id
                                AND d.source_type          = 'IO'
                                --AND csp_pick_utils.get_order_status(oel.line_id,oel.flow_status_code)       in ('SHIPPED', 'EXPECTED')
                                AND d.source_id             = oel.line_id;
Line: 914

                                SELECT ch.destination_organization_id
                                into l_dest_ou
                                FROM csp_requirement_headers ch
                                WHERE ch.task_id                     = p_task_id
                                AND ch.task_assignment_id          = r_asgn.task_assignment_id
                                AND rownum                         = 1;
Line: 1224

        SELECT crh.REQUIREMENT_HEADER_ID,crh.address_type
        FROM   CSP_REQUIREMENT_HEADERS crh
        WHERE  crh.TASK_ID = p_task_id;
Line: 1229

        select  nvl(jtsv.accepted_flag,'N')
        from    jtf_task_statuses_vl jtsv,
                jtf_task_assignments jta
        where   jta.task_assignment_id = p_task_assignment_id
        and     jtsv.task_status_id = jta.assignment_status_id;
Line: 1236

        SELECT  ORGANIZATION_ID, SUBINVENTORY_CODE
        FROM    CSP_INV_LOC_ASSIGNMENTS
        WHERE   RESOURCE_ID = c_resource_id
        AND     RESOURCE_TYPE = c_resource_type
        AND     DEFAULT_CODE = 'IN' ;
Line: 1243

        SELECT  SHIP_TO_LOCATION_ID
        FROM    CSP_RS_SHIP_TO_ADDRESSES_ALL_V
        WHERE   RESOURCE_ID = c_resource_id
        AND     RESOURCE_TYPE = c_resource_type
        AND     PRIMARY_FLAG = 'Y'
        AND     status        = 'A'
        AND     rownum        = 1;
Line: 1252

        select scheduled_start_date
        from   jtf_tasks_b
        where  task_id = p_task_id;
Line: 1257

        select distinct capt.supplied_item_id,
               capt.supplied_quantity,
               msib.primary_uom_code,
               capt.supplied_item_rev,
               capt.organization_id,
               capt.subinventory_code,
               capt.source_type_code,
               capt.shipping_method,
               ood.operating_unit,
               crl.requirement_line_id,
               crh.destination_organization_id,
               crh.destination_subinventory,
               crh.ship_to_location_id
        from   csp_available_parts_temp capt,
               org_organization_definitions ood,
               csp_requirement_lines crl,
               csp_requirement_headers crh,
               mtl_system_items_b msib
        where  ood.organization_id = capt.organization_id
        and    crl.requirement_header_id = crh.requirement_header_id
        and    crl.inventory_item_id = capt.required_item_id
        and    msib.organization_id = capt.organization_id
        and    msib.inventory_item_id = capt.supplied_item_id
        and    crh.task_id = p_task_id
        order by ood.operating_unit;
Line: 1334

        select task_assignment_id
        from jtf_task_assignments
        where task_id = p_task_id;
Line: 1343

                select requirement_header_id
                from csp_requirement_headers
                where task_id = v_task_id
                and task_assignment_id = v_task_assignment_id;
Line: 1363

                        SELECT NAME
                        INTO l_resource_type_name
                        FROM JTF_OBJECTS_VL
                        WHERE OBJECT_CODE = p_options.resource_type;
Line: 1390

                        SELECT COUNT(l.requirement_line_id)
                        into l_fl_rcvd_lines
                        FROM csp_requirement_headers h,
                          csp_requirement_lines l,
                          csp_req_line_details dio,
                          csp_req_line_details dres,
                          oe_order_lines_all oola,
                          mtl_reservations mr
                        WHERE h.task_id             = p_task_id
                        AND h.task_assignment_id    = r_asgn.task_assignment_id
                        AND h.address_type         IN ('T', 'C', 'P')
                        AND h.requirement_header_id = l.requirement_header_id
                        AND l.requirement_line_id   = dio.requirement_line_id
                        AND dio.source_type        = 'IO'
                        AND dio.source_id = oola.line_id
                        AND  csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)      = 'FULLY RECEIVED'
                        AND dio.requirement_line_id = dres.requirement_line_id
                        AND oola.inventory_item_id    = mr.inventory_item_id
                        AND oola.ordered_quantity   = mr.reservation_quantity
                        AND dres.source_type       = 'RES'
                        AND dres.source_id = mr.reservation_id;
Line: 1443

                        SELECT COUNT(l.requirement_line_id)
                        into l_shpd_lines
                        FROM csp_requirement_headers h,
                          csp_requirement_lines l,
                          csp_req_line_details d,
                          oe_order_lines_all oola
                        WHERE h.task_id             = p_task_id
                        AND h.task_assignment_id    = r_asgn.task_assignment_id
                        AND h.requirement_header_id = l.requirement_header_id
                        and h.address_type in ('C', 'T', 'P')
                        AND l.requirement_line_id   = d.requirement_line_id
                        AND d.source_type          = 'IO'
                        AND d.source_id = oola.line_id
                        AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)        in ('SHIPPED', 'EXPECTED');
Line: 1467

                                        l_requirement_header.last_update_date := sysdate;
Line: 1480

                                        log('choose_option', 'before calling Update_requirement_headers...');
Line: 1481

                                        CSP_Requirement_Headers_PVT.Update_requirement_headers(
                                                                        P_Api_Version_Number         => 1.0,
                                                                        P_Init_Msg_List              => FND_API.G_FALSE,
                                                                        P_Commit                     => FND_API.G_FALSE,
                                                                        p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
                                                                        P_REQUIREMENT_HEADER_Rec     => l_requirement_header,
                                                                        X_Return_Status              => x_return_status,
                                                                        X_Msg_Count                  => x_msg_count,
                                                                        x_msg_data                   => x_msg_data
                                                                        );
Line: 1491

                                        log('choose_option', 'before calling Update_requirement_headers...x_return_status=' || x_return_status);
Line: 1528

                                                l_requirement_header.last_update_date := sysdate;
Line: 1541

                                                log('choose_option', 'before calling Update_requirement_headers...');
Line: 1542

                                                CSP_Requirement_Headers_PVT.Update_requirement_headers(
                                                                                P_Api_Version_Number         => 1.0,
                                                                                P_Init_Msg_List              => FND_API.G_FALSE,
                                                                                P_Commit                     => FND_API.G_FALSE,
                                                                                p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
                                                                                P_REQUIREMENT_HEADER_Rec     => l_requirement_header,
                                                                                X_Return_Status              => x_return_status,
                                                                                X_Msg_Count                  => x_msg_count,
                                                                                x_msg_data                   => x_msg_data
                                                                                );
Line: 1552

                                                log('choose_option', 'before calling Update_requirement_headers...x_return_status=' || x_return_status);
Line: 1681

                  csp_req_line_details_pkg.insert_row(
                       l_req_line_details_id
                      ,cap.requirement_line_id
                      ,fnd_global.user_id
                      ,sysdate
                      ,fnd_global.user_id
                      ,sysdate
                      ,fnd_global.login_id
                      ,'RES'
                      ,l_reservation_id);
Line: 1724

                    csp_req_line_details_pkg.insert_row(
                       l_req_line_details_id
                      ,l_parts_lines(i).requirement_line_id
                      ,fnd_global.user_id
                      ,sysdate
                      ,fnd_global.user_id
                      ,sysdate
                      ,fnd_global.login_id
                      ,'IO'
                      ,l_parts_lines(i).order_line_id);
Line: 1735

                  l_parts_lines.delete;
Line: 1800

                csp_req_line_details_pkg.insert_row(
                   l_req_line_details_id
                  ,l_parts_lines(i).requirement_line_id
                  ,fnd_global.user_id
                  ,sysdate
                  ,fnd_global.user_id
                  ,sysdate
                  ,fnd_global.login_id
                  ,'IO'
                  ,l_parts_lines(i).order_line_id);
Line: 1817

             l_requirement_header.last_update_date      := sysdate;
Line: 1841

             CSP_Requirement_Headers_PVT.Update_requirement_headers(
                                P_Api_Version_Number         => 1.0,
                                P_Init_Msg_List              => FND_API.G_FALSE,
                                P_Commit                     => FND_API.G_FALSE,
                                p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
                                P_REQUIREMENT_HEADER_Rec     => l_requirement_header,
                                X_Return_Status              => x_return_status,
                                X_Msg_Count                  => x_msg_count,
                                x_msg_data                   => x_msg_data
                                );
Line: 1970

                    SELECT LEAST(min_cost, l_temp_options(I).transfer_cost) INTO min_cost
                    FROM   DUAL;
Line: 1996

                        SELECT INSTR(l_final_option(1).shipping_methodes,'$',1,l_ship_methode_count ) INTO current_position
                        FROM   DUAL;
Line: 1998

                        SELECT SUBSTR(l_final_option(1).shipping_methodes,previous_position,(current_position-previous_position))
                        INTO   l_org_ship_methode(l_org_ship_methode.count).shipping_methode
                        FROM   DUAL;
Line: 2015

            SELECT INSTR(l_final_option(1).shipping_methodes,'$',1,l_ship_methode_count ) INTO current_position
                        FROM   DUAL;
Line: 2017

                        SELECT SUBSTR(l_final_option(1).shipping_methodes,previous_position,(current_position-previous_position))
                        INTO   l_org_ship_methode(l_org_ship_methode.count).shipping_methode
                        FROM   DUAL;
Line: 2087

                select CSP_REQUIREMENT_LINES_S1.nextval INTO l_req_line_details_tbl(l_req_line_details_tbl.count).req_line_detail_id from dual;
Line: 2108

                select CSP_REQUIREMENT_LINES_S1.nextval INTO l_req_line_details_tbl(l_req_line_details_tbl.count).req_line_detail_id from dual;
Line: 2170

            csp_req_line_details_pkg.insert_row(l_req_line_details_tbl(K).REQ_LINE_DETAIL_ID
                                                ,l_req_line_details_tbl(K).REQUIREMENT_LINE_ID
                                                ,fnd_global.user_id
                                                ,sysdate
                                                ,fnd_global.user_id
                                                ,sysdate
                                                ,fnd_global.login_id
                                                ,l_req_line_details_tbl(K).SOURCE_TYPE
                                                ,l_req_line_details_tbl(K).SOURCE_ID);
Line: 2186

         l_requirement_header.Last_Update_Date      := SYSDATE;
Line: 2192

         CSP_Requirement_Headers_PVT.Update_requirement_headers(
                                P_Api_Version_Number         => 1.0,
                                P_Init_Msg_List              => FND_API.G_FALSE,
                                P_Commit                     => FND_API.G_FALSE,
                                p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
                                P_REQUIREMENT_HEADER_Rec     => l_requirement_header,
                                X_Return_Status              => x_return_status,
                                X_Msg_Count                  => x_msg_count,
                                X_Msg_Data                   => x_msg_data
                                );
Line: 2228

    SELECT crl.RESERVATION_ID,crl.LOCAL_RESERVATION_ID,crl.REQUIREMENT_LINE_ID
    FROM   CSP_REQUIREMENT_LINES crl, csp_requirement_headers crh
    WHERE  crh.task_assignment_id = p_task_assignment_id
    and    crl.REQUIREMENT_HEADER_ID = crh.requirement_header_id
    AND    crl.local_RESERVATION_ID IS NOT NULL;
Line: 2235

     select distinct  oeh.header_id,crl.requirement_line_id
     from oe_order_lines_all oel, oe_order_headers_all oeh, csp_requirement_headers crh, csp_requirement_lines crl
     where crh.task_assignment_id = p_task_assignment_id
     and   crl.REQUIREMENT_HEADER_ID = crh.REQUIREMENT_HEADER_ID
     and   oel.line_id = crl.order_line_id
     and   oeh.header_id =  oel.header_id
     order by oeh.header_id;
Line: 2298

                CSP_Requirement_Lines_PVT.Update_requirement_lines(
                                P_Api_Version_Number         => 1.0,
                                P_Init_Msg_List              => FND_API.G_FALSE,
                                P_Commit                     => FND_API.G_FALSE,
                                p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
                                P_Requirement_Line_Tbl       => l_Requirement_Line_Tbl,
                                X_Return_Status              => x_return_status,
                                X_Msg_Count                  => x_msg_count,
                                X_Msg_Data                   => x_msg_data
                                );
Line: 2354

                    CSP_Requirement_Lines_PVT.Update_requirement_lines(
                                P_Api_Version_Number         => 1.0,
                                P_Init_Msg_List              => FND_API.G_FALSE,
                                P_Commit                     => FND_API.G_FALSE,
                                p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
                                P_Requirement_Line_Tbl       => l_Requirement_Line_Tbl,
                                X_Return_Status              => x_return_status,
                                X_Msg_Count                  => x_msg_count,
                                X_Msg_Data                   => x_msg_data
                                );
Line: 2435

    select crld.source_id , crld.req_line_detail_id
    from  csp_req_line_details crld
         ,csp_requirement_lines crl
         ,csp_requirement_headers crh
    where  crh.task_assignment_id = p_task_assignment_id
    and crl.requirement_header_id = crh.requirement_header_id
    and crld.requirement_line_id = crl.requirement_line_id
    and crld.source_type = 'RES' ;
Line: 2445

    select oeh.header_id, crld.req_line_detail_id, crh.address_type
    from  csp_req_line_details crld
         ,csp_requirement_lines crl
         ,csp_requirement_headers crh
         ,oe_order_lines_all oel
         ,oe_order_headers_all oeh
    where  crh.task_assignment_id = p_task_assignment_id
    and crl.requirement_header_id = crh.requirement_header_id
    and crld.requirement_line_id = crl.requirement_line_id
    and crld.source_type = 'IO'
    and oel.line_id = crld.source_id
    and oeh.header_id =  oel.header_id
    order by oeh.header_id;
Line: 2460

    select flow_status_code
    from   oe_order_headers_all
    where  header_id =  c_header_id;
Line: 2465

    select REQ_LINE_DETAIL_ID
    from  csp_req_line_details crld,oe_order_lines_all oel
    where crld.source_id = oel.line_id
    and crld.source_type = 'IO'
    and oel.header_id = c_order_header_id;
Line: 2472

    select requirement_header_id,address_type
    from csp_requirement_headers
    where task_assignment_id = p_task_assignment_id;
Line: 2496

                SELECT COUNT(l.requirement_line_id)
                into l_fl_rcvd_lines
                FROM csp_requirement_headers h,
                  csp_requirement_lines l,
                  csp_req_line_details dio,
                  csp_req_line_details dres,
                  oe_order_lines_all oola,
                  mtl_reservations mr
                WHERE h.task_assignment_id    = p_task_assignment_id
                AND h.address_type         IN ('T', 'C', 'P')
                AND h.requirement_header_id = l.requirement_header_id
                AND l.requirement_line_id   = dio.requirement_line_id
                AND dio.source_type        = 'IO'
                AND dio.source_id = oola.line_id
                AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)         = 'FULLY RECEIVED'
                AND dio.requirement_line_id = dres.requirement_line_id
                AND oola.inventory_item_id    = mr.inventory_item_id
                AND oola.ordered_quantity   = mr.reservation_quantity
                AND dres.source_type       = 'RES'
                AND dres.source_id = mr.reservation_id;
Line: 2528

                SELECT COUNT(l.requirement_line_id)
                into l_shpd_lines
                FROM csp_requirement_headers h,
                  csp_requirement_lines l,
                  csp_req_line_details d,
                  oe_order_lines_all oola
                WHERE h.task_assignment_id    = p_task_assignment_id
                AND h.requirement_header_id = l.requirement_header_id
                and h.address_type in ('C', 'T', 'P')
                AND l.requirement_line_id   = d.requirement_line_id
                AND d.source_type          = 'IO'
                AND d.source_id = oola.line_id
                AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)           in ('SHIPPED', 'EXPECTED');
Line: 2579

                    CSP_REQ_LINE_DETAILS_PKG.Delete_Row(l_req_details_line_id);
Line: 2615

                SELECT COUNT(1)
                INTO l_line_to_cancel
                FROM oe_order_lines_all
                WHERE header_id    = l_order_id
                AND cancelled_flag = 'N'
                                AND open_flag = 'Y'
                                AND flow_status_code <> 'SHIPPED';
Line: 2669

                                        CSP_REQ_LINE_DETAILS_PKG.Delete_Row(l_req_details_line_id);
Line: 2710

                CSP_Requirement_Headers_PVT.Update_requirement_headers(
                                P_Api_Version_Number         => 1.0,
                                P_Init_Msg_List              => FND_API.G_FALSE,
                                P_Commit                     => FND_API.G_FALSE,
                                p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
                                P_REQUIREMENT_HEADER_Rec     => l_requirement_header,
                                X_Return_Status              => x_return_status,
                                X_Msg_Count                  => x_msg_count,
                                X_Msg_Data                   => x_msg_data
                                );
Line: 2751

        INV_RESERVATION_PUB.delete_reservation(l_api_version_number
                                              ,l_init_msg_lst
                                              ,x_return_status
                                              ,x_msg_count
                                              ,x_msg_data
                                              ,l_rsv_rec
                                              ,l_serial_number);
Line: 2814

        select distinct oeh.header_id, oel.line_id
        from  csp_req_line_details crld
         ,csp_requirement_lines crl
         ,csp_requirement_headers crh
         ,oe_order_lines_all oel
         ,oe_order_headers_all oeh
        where  crh.task_assignment_id = p_task_assignment_id
        and crl.requirement_header_id = crh.requirement_header_id
        and crld.requirement_line_id = crl.requirement_line_id
        and crld.source_type = 'IO'
        and oel.line_id = crld.source_id
        and oeh.header_id =  oel.header_id
        order by oeh.header_id;
Line: 2847

                 l_parts_header.OPERATION := 'UPDATE';
Line: 2888

    SELECT  INVENTORY_ITEM_ID, UOM_CODE,REVISION
           ,SHIP_COMPLETE_FLAG,SOURCE_ORGANIZATION_ID
           ,ORDERED_QUANTITY,REQUIREMENT_LINE_ID,RESERVATION_ID
    FROM  CSP_REQUIREMENT_HEADERS HR,CSP_REQUIREMENT_LINES LN
    WHERE HR.TASK_ASSIGNMENT_ID = c_task_assignment
    AND   LN.REQUIREMENT_HEADER_ID = HR.REQUIREMENT_HEADER_ID;
Line: 2902

    select REQUIREMENT_HEADER_ID
    from   CSP_REQUIREMENT_HEADERS
    where  TASK_ASSIGNMENT_ID = c_task_assignment;
Line: 2906

    SELECT  INVENTORY_ITEM_ID, UOM_CODE,REVISION
           ,SHIP_COMPLETE_FLAG,SOURCE_ORGANIZATION_ID
           ,ORDERED_QUANTITY,REQUIREMENT_LINE_ID,RESERVATION_ID
    FROM  CSP_REQUIREMENT_LINES
    WHERE REQUIREMENT_HEADER_ID = c_header_id;
Line: 2914

    SELECT RESOURCE_ID,RESOURCE_TYPE_CODE
    FROM   JTF_TASK_ASSIGNMENTS
    WHERE  TASK_ASSIGNMENT_ID=c_task_assignment_id;
Line: 2919

    SELECT  ORGANIZATION_ID, SUBINVENTORY_CODE
    FROM    CSP_INV_LOC_ASSIGNMENTS
    WHERE   RESOURCE_ID = c_resource_id
    AND     RESOURCE_TYPE = c_resource_type
    AND     DEFAULT_CODE = 'IN' ;
Line: 2926

    SELECT  SHIP_TO_LOCATION_ID
    FROM    CSP_RS_SHIP_TO_ADDRESSES_V
    WHERE   RESOURCE_ID = c_resource_id
    AND     RESOURCE_TYPE = c_resource_type
    AND     PRIMARY_FLAG = 'Y';
Line: 3082

          CSP_Requirement_Lines_PVT.Update_requirement_lines(
                                    P_Api_Version_Number     => 1.0,
                                    P_Init_Msg_List          => FND_API.G_FALSE,
                                    P_Commit                 => FND_API.G_FALSE,
                                    p_validation_level       => FND_API.G_VALID_LEVEL_FULL,
                                    P_Requirement_Line_Tbl   => l_requrements_lines,
                                    X_Return_Status          => l_return_status,
                                    X_Msg_Count              => l_msg_count,
                                    X_Msg_Data               => l_msg_data
                                    )  ;
Line: 3116

        SELECT  ORGANIZATION_ID, SUBINVENTORY_CODE
        FROM    CSP_INV_LOC_ASSIGNMENTS
        WHERE   RESOURCE_ID = l_resource_id
        AND     RESOURCE_TYPE = l_resource_type
        AND     DEFAULT_CODE = 'IN' ;
Line: 3123

        SELECT NAME
        FROM JTF_OBJECTS_VL
        WHERE OBJECT_CODE = l_resource_type;
Line: 3145

                        /*select csp_pick_utils.get_object_name(p_resources(I).resource_type,p_resources(I).resource_id)
                        INTO   l_resource_name
                        FROM   DUAL;*/
Line: 3192

        SELECT INVENTORY_ITEM_ID,REQUIRED_QUANTITY , UOM_CODE,SHIP_COMPLETE_FLAG,REVISION,REQUIREMENT_LINE_ID
        FROM   CSP_REQUIREMENT_LINES crl, CSP_REQUIREMENT_HEADERS crh
        WHERE  crh.TASK_ID = product_task
        AND    crl.requirement_header_id = crh.requirement_header_id
        AND    nvl(crl.LIKELIHOOD,0) >= nvl(parts_category,0) ;
Line: 3251

    SELECT NVL((REQUIRED_QUANTITY-ORDERED_QUANTITY),0)
    FROM   CSP_REQUIREMENT_LINES
    WHERE  REQUIREMENT_HEADER_ID = (SELECT REQUIREMENT_HEADER_ID
                                    FROM   CSP_REQUIREMENT_HEADERS
                                    WHERE  OPEN_REQUIREMENT = 'Yes'
                                    AND    DESTINATION_ORGANIZATION_ID = org_id)
    AND   SOURCE_SUBINVENTORY =  sub_inv_code
    AND   INVENTORY_ITEM_ID = item_id
    AND   ORDER_LINE_ID IS NOT NULL ;*/
Line: 3262

        SELECT mri.RELATED_ITEM_ID
        FROM   MTL_RELATED_ITEMS_VIEW mri, mtl_parameters mp
        WHERE  mp.organization_id = org_id
        AND    mri.INVENTORY_ITEM_ID = item_id
        AND    mri.RELATIONSHIP_TYPE_ID = 2
        AND    mri.ORGANIZATION_ID  = MP.MASTER_ORGANIZATION_ID;
Line: 3296

        l_res_ids.delete;
Line: 3304

                    l_alternate_parts.delete;
Line: 3307

                    l_supersede_items.DELETE;
Line: 3593

                CSP_SCH_INT_PVT.DELETE_RESERVATION(l_res_ids(i),x_return_status,x_msg_data);
Line: 3617

    select organization_id,
           subinventory_code,
           shipping_date,
           sum(supplied_quantity)
    from   csp_available_parts_temp capt
    where  capt.required_item_id = p_inventory_item_id
    and    capt.supplied_quantity >= p_quantity
    and    capt.arrival_date <= p_interval.latest_time
    group by organization_id, subinventory_code, shipping_date, shipping_cost
    order by shipping_cost asc;
Line: 3629

    select inv_loc_id,
           site_loc_id
    from   csp_rs_ship_to_addresses_all_v
    where  resource_type = p_resource_type
    and    resource_id = p_resource_id
    and    primary_flag = 'Y';
Line: 3677

       p_required_parts.delete();
Line: 3748

       delete from csp_available_parts_temp;
Line: 3749

       delete from csp_required_parts_temp;
Line: 3766

    select crh.requirement_header_id,
           decode(crh.address_type,'R',null,'S',null,crh.ship_to_location_id),
           decode(crh.address_type,'R',null,'S',null,hps.location_id)
    from   csp_requirement_headers crh,
           hz_cust_site_uses_all hcsua,
           po_location_associations_all plaa,
           hz_cust_acct_sites_all hcasa,
           hz_party_sites hps
    where  crh.task_id = p_task_id
    and    plaa.location_id = crh.ship_to_location_id
    and    hcsua.site_use_id = plaa.site_use_id
    and    hcsua.site_use_code = 'SHIP_TO'
    and    hcsua.status = 'A'
    and    hcasa.cust_acct_site_id = hcsua.cust_acct_site_id
    and    hps.party_site_id = hcasa.party_site_id;
Line: 3783

    select crh.requirement_header_id
    from   csp_requirement_headers crh
    where  crh.task_id = p_task_id;
Line: 3788

    select inventory_item_id,
           quantity
    from   csp_required_parts_temp
    where  item_type = 'BASE';
Line: 3794

    select distinct supplied_quantity,
           arrival_date,
           shipping_cost,
           organization_id,
           subinventory_code,
           shipping_method,
           source_type_code,
           supplied_item_id,
           distance
    from   csp_available_parts_temp
    where  required_item_id = p_inventory_item_id
    and    nvl(open_or_closed,'-1') <> 'USED'
    order by shipping_cost,distance,organization_id,subinventory_code;
Line: 3809

    select cia.org_id
    from   cs_incidents_all cia,
           jtf_tasks_b jtb
    where  jtb.task_id = p_task_id
    and    jtb.source_object_type_code = 'SR'
    and    cia.incident_id = jtb.source_object_id;
Line: 3818

    select crstaav.ship_to_location_id,
           crstaav.site_loc_id,
           hcasa.org_id
    from   csp_rs_ship_to_addresses_all_v crstaav,
           hz_cust_acct_sites_all hcasa
    where  crstaav.resource_type = p_resource_type
    and    crstaav.resource_id = p_resource_id
    and    crstaav.primary_flag = 'Y'
    and    hcasa.cust_acct_site_id = crstaav.cust_acct_site_id;
Line: 3883

       delete from csp_available_parts_temp;
Line: 3884

       delete from csp_required_parts_temp;
Line: 3946

         delete from csp_available_parts_temp;
Line: 3947

         delete from csp_required_parts_temp;
Line: 3974

           delete from csp_available_parts_temp
           where source_type_code in ('MYSELF','DEDICATED');
Line: 3995

           delete from csp_required_parts_temp;
Line: 4027

               select organization_code into l_src_org_code
                    from mtl_parameters where organization_id = ca.organization_id;
Line: 4044

                                        SELECT meaning
                                        into l_ship_method_meaning
                                        FROM fnd_lookup_values_vl
                                        WHERE lookup_type = 'SHIP_METHOD'
                                        AND lookup_code   = ca.shipping_method;
Line: 4078

               log('spares_check2','update supplied quantity of capt');
Line: 4079

               update csp_available_parts_temp
               set    supplied_quantity = least(supplied_quantity,l_missing_parts),
                      open_or_closed = 'USED'
               where  organization_id = ca.organization_id
               and    nvl(subinventory_code,'-1') = nvl(ca.subinventory_code,'-1')
               and    supplied_item_id = ca.supplied_item_id
               and    required_item_id = cp.inventory_item_id
               and    nvl(open_or_closed,'-1') <> 'USED'
               and    rownum = 1;
Line: 4088

               log('spares_check2','Records updated:'||sql%rowcount);
Line: 4093

             delete from csp_available_parts_temp
             where organization_id = ca.organization_id
             and   nvl(subinventory_code,'-1') = nvl(ca.subinventory_code,'-1')
             and   supplied_item_id = ca.supplied_item_id
             and   required_item_id = cp.inventory_item_id
             and   rownum = 1;
Line: 4099

             log('spares_check2','Records deleted:'||sql%rowcount);
Line: 4164

        SELECT instance_id
        FROM   mrp_ap_apps_instances;
Line: 4168

        select  meaning
        from    mfg_lookups
        where   lookup_type = 'MTL_DEMAND_INTERFACE_ERRORS'
        and    lookup_code = c_errro_code;
Line: 4174

        select  distinct(CONCATENATED_SEGMENTS)
        from    mtl_system_items_b_kfv
        where   inventory_item_id = c_item_id
        and     organization_id = cs_std.get_item_valdn_orgzn_id;
Line: 4181

       /* SELECT vendor_id, vendor_site_id
        FROM  mrp_sources_v
        where assignment_set_id = c_assignment_id
        and   inventory_item_id = c_item_id
        and   organization_id  = c_organization_id
        and   source_type = 3;*/
Line: 4187

       Select 'Y'
       from MRP_ITEM_SOURCING_LEVELS_V  misl
       where misl.organization_id = c_organization_id
       and misl.assignment_set_id =c_assignment_id
       and inventory_item_id = c_item_id
       and SOURCE_TYPE       = 3
       and sourcing_level = (select min(sourcing_level) from MRP_ITEM_SOURCING_LEVELS_V
                             where organization_id = c_organization_id
                             and assignment_set_id = c_assignment_id
                             and inventory_item_id = c_item_id
                             and sourcing_level not in (2,9));
Line: 4233

                Select MRP_ATP_SCHEDULE_TEMP_S.NextVal
                Into   l_session_id
                From   Dual;
Line: 4249

                    l_atp_rec.Insert_Flag(I) := 1;
Line: 4737

                select least(round(p_temp_options(I).arrival_date,'MI'),round(g_earliest_delivery_date,'MI'))
                INTO g_earliest_delivery_date
                from dual;
Line: 4764

        SELECT count(*)
        FROM   MTL_INTERORG_SHIP_METHODS ISM,HR_ALL_ORGANIZATION_UNITS hao
        where  hao.organization_id = c_from_org_id
        and  ism.from_location_id = hao.location_id
        and  ism.to_location_id = c_to_location_id;
Line: 4796

        do_insert BOOLEAN;
Line: 4895

                    SELECT GREATEST(greatest_available_date, nvl(p_eligible_resources(I).available_date,sysdate))
                    INTO   greatest_available_date
                    FROM DUAL;
Line: 4910

                SELECT GREATEST(min_leadtime,loop_min) INTO min_leadtime FROM DUAL;
Line: 4911

                SELECT GREATEST(max_leadtime,loop_max) INTO max_leadtime FROM DUAL;
Line: 5019

                                select LEAST(l_min_cost_for_loop,l_resource_shipping_parameters(N).transfer_cost)
                                INTO l_min_cost_for_loop
                                FROM DUAL;
Line: 5107

                            SELECT GREATEST(l_final_resource(K).lead_time,l_temp_rec(L).lead_time)
                            INTO l_temp_final_resource(l_temp_final_resource.count).lead_time
                            FROM DUAL ;
Line: 5144

                           /* SELECT LEAST(min_cost, l_final_resource(J).transfer_cost)
                            INTO min_cost
                            FROM DUAL;*/
Line: 5176

                               do_insert := TRUE;
Line: 5180

                        IF do_insert THEN
                            px_options.extend;
Line: 5198

                    do_insert := FALSE;
Line: 5210

                                do_insert := TRUE;
Line: 5214

                        IF do_insert THEN
                            x_ship_count.extend;
Line: 5307

        SELECT ISM.SHIP_METHOD,NVL(ISM.COST_PER_UNIT_LOAD_WEIGHT,0)
       ,CDT.FREIGHT_CODE,CDT.LEAD_TIME,CDT.LEAD_TIME_UOM,CDT.DELIVERY_TIME
       ,CDT.CUTOFF_TIME,CDT.TIMEZONE_ID,CDT.SAFETY_ZONE
        FROM   MTL_INTERORG_SHIP_METHODS ISM,CSP_CARRIER_DELIVERY_TIMES CDT
        WHERE  ISM.FROM_ORGANIZATION_ID = from_org
        AND    ISM.TO_ORGANIZATION_ID =  to_org
        AND    CDT.ORGANIZATION_ID = from_org
        AND    CDT.SHIPPING_METHOD = ISM.SHIP_METHOD;
Line: 5318

        SELECT TIMEZONE_ID
        FROM   CSP_RS_SHIP_TO_ADDRESSES_V
        WHERE  PRIMARY_FLAG ='Y'
        AND resource_id  = c_resource_id
        AND resource_type = c_resource_type;
Line: 5325

        SELECT ORGANIZATION_CODE
        FROM   MTL_PARAMETERS
        WHERE  ORGANIZATION_ID = l_org_id;
Line: 5330

        select shipping_method,
               shipping_cost,
               intransit_time,
               from_location_id,
               to_location_id,
               destination_type
        from   csp_shipping_details_v
        where  organization_id = c_from_org_id
        and    to_location_id = c_to_location_id;
Line: 5657

        SELECT CDT.LEAD_TIME,CDT.LEAD_TIME_UOM,CDT.DELIVERY_TIME
              ,CDT.CUTOFF_TIME,CDT.TIMEZONE_ID,CDT.SAFETY_ZONE
        FROM   CSP_CARRIER_DELIVERY_TIMES CDT
        WHERE  CDT.relation_ship_id = c_relation_id;
Line: 5771

        p_atp_rec.Insert_Flag.Extend;
Line: 5792

          SELECT TRANSACTION_SOURCE_TYPE_ID,TRANSACTION_SOURCE_TYPE_NAME
          FROM   MTL_TXN_SOURCE_TYPES
          WHERE  transaction_source_type_id = 13;
Line: 5836

                    select LOT INTO l_rsv_rec.lot_number
                    from MTL_ONHAND_LOT_V
                    where INVENTORY_ITEM_ID=p_reservation_parts.item_id
                    and SUBINVENTORY_CODE = p_reservation_parts.sub_inventory_code
                    and organization_id=p_reservation_parts.organization_id
                    and rownum=1;
Line: 6029

        SELECT NVL(ISM.COST_PER_UNIT_LOAD_WEIGHT,0),
               CDT.RELATION_SHIP_ID,CDT.CUTOFF_TIME,CDT.TIMEZONE_ID,ISM.SHIP_METHOD
        FROM   MTL_INTERORG_SHIP_METHODS ISM,CSP_CARRIER_DELIVERY_TIMES CDT
        WHERE  ISM.FROM_ORGANIZATION_ID = from_org
        AND    ISM.TO_ORGANIZATION_ID =  to_org
        AND    CDT.ORGANIZATION_ID = from_org
        AND    CDT.SHIPPING_METHOD = ISM.SHIP_METHOD;
Line: 6149

    /*SELECT TIMEZONE_ID
    FROM   CSP_RS_SHIP_TO_ADDRESSES_V
    WHERE  PRIMARY_FLAG ='Y'
    AND resource_id  = c_resource_id
    AND resource_type = c_resource_type;*/
Line: 6154

    SELECT hzl.time_zone TIMEZONE_ID
    FROM csp_rs_cust_relations rcr,
      hz_cust_acct_sites cas,
      hz_cust_site_uses csu,
      hz_party_sites ps,
      hz_locations hzl
    WHERE rcr.customer_id     = cas.cust_account_id
    AND cas.cust_acct_site_id = csu.cust_acct_site_id (+)
    AND csu.site_use_code     = 'SHIP_TO'
    AND cas.party_site_id     = ps.party_site_id
    AND ps.location_id        = hzl.location_id
    AND csu.primary_flag      = 'Y'
    AND rcr.resource_type     =c_resource_type
    AND rcr.resource_id       = c_resource_id;
Line: 6171

    /* SELECT vendor_id, vendor_site_id
    FROM  mrp_sources_v
    where assignment_set_id = c_assignment_id
    and   inventory_item_id = c_item_id
    and   organization_id  = c_organization_id
    and   source_type = 3;*/
Line: 6177

    SELECT vendor_id,
      vendor_site_id
    FROM MRP_ITEM_SOURCING_LEVELS_V misl
    WHERE misl.organization_id = c_organization_id
    AND misl.assignment_set_id =c_assignment_id
    AND inventory_item_id      = c_item_id
    AND SOURCE_TYPE            = 3
    AND sourcing_level         =
      (SELECT MIN(sourcing_level)
      FROM MRP_ITEM_SOURCING_LEVELS_V
      WHERE organization_id   = c_organization_id
      AND assignment_set_id   = c_assignment_id
      AND inventory_item_id   = c_item_id
      AND sourcing_level NOT IN (2,9)
      );
Line: 6195

    SELECT PRIMARY_UOM_CODE
    FROM MTL_SYSTEM_ITEMS_B
    WHERE INVENTORY_ITEM_ID = item_id
    AND organization_id     = org_id;
Line: 6201

    /* SELECT mri.RELATED_ITEM_ID
    FROM   MTL_RELATED_ITEMS_VIEW mri, mtl_parameters mp
    WHERE  mp.organization_id = org_id
    AND    mri.INVENTORY_ITEM_ID = item_id
    AND    mri.RELATIONSHIP_TYPE_ID = 2
    AND    mri.ORGANIZATION_ID  = MP.MASTER_ORGANIZATION_ID;*/
Line: 6207

    SELECT mri.RELATED_ITEM_ID
    FROM MTL_RELATED_ITEMS mri,
      mtl_parameters mp
    WHERE mp.organization_id     = org_id
    AND mri.INVENTORY_ITEM_ID    = item_id
    AND mri.RELATIONSHIP_TYPE_ID = 2
    AND mri.ORGANIZATION_ID      = MP.MASTER_ORGANIZATION_ID;
Line: 6627

    CSP_SCH_INT_PVT.DELETE_RESERVATION(l_res_ids(i),x_return_status,x_msg_data);
Line: 6999

    SELECT (REQUIRED_QUANTITY-ORDERED_QUANTITY)
    FROM   CSP_REQUIREMENT_LINES
    WHERE  REQUIREMENT_HEADER_ID = (SELECT REQUIREMENT_HEADER_ID
                                    FROM   CSP_REQUIREMENT_HEADERS
                                    WHERE  OPEN_REQUIREMENT = 'Yes'
                                    AND    DESTINATION_ORGANIZATION_ID = org_id)
    AND   SOURCE_SUBINVENTORY =  sub_inv_code
    AND   INVENTORY_ITEM_ID = item_id
    AND   ORDER_LINE_ID IS NOT NULL ;*/
Line: 7069

      PROCEDURE TASKS_POST_INSERT( x_return_status out nocopy varchar2) IS
        p_task_id NUMBER;
Line: 7088

      END TASKS_POST_INSERT;
Line: 7124

                    SELECT LEAST(min_cost, px_options(I).transfer_cost) INTO min_cost
                    FROM   DUAL;
Line: 7150

                        SELECT INSTR(l_final_option(1).shipping_methodes,'$',1,l_ship_methode_count ) INTO current_position
                        FROM   DUAL;
Line: 7152

                        SELECT SUBSTR(l_final_option(1).shipping_methodes,previous_position,(current_position-previous_position))
                        INTO   l_org_ship_methode(l_org_ship_methode.count).shipping_methode
                        FROM   DUAL;
Line: 7169

            SELECT INSTR(l_final_option(1).shipping_methodes,'$',1,l_ship_methode_count ) INTO current_position
            FROM   DUAL;
Line: 7171

            SELECT SUBSTR(l_final_option(1).shipping_methodes,previous_position,(current_position-previous_position))
            INTO   l_org_ship_methode(l_org_ship_methode.count).shipping_methode
            FROM   DUAL;
Line: 7213

            SELECT  cil.ORGANIZATION_ID, cil.SUBINVENTORY_CODE
            FROM    CSP_INV_LOC_ASSIGNMENTS cil,csp_sec_inventories csi
            WHERE   cil.RESOURCE_ID = l_resource_id
            AND     cil.RESOURCE_TYPE = l_resource_type
            AND     nvl(cil.EFFECTIVE_DATE_END,sysdate) >= sysdate
            AND     csi.organization_id = cil.organization_id
            and     csi.secondary_inventory_name = cil.subinventory_code
            and     csi.condition_type = 'G' ;
Line: 7223

            SELECT  ORGANIZATION_ID, SUBINVENTORY_CODE
            FROM    CSP_INV_LOC_ASSIGNMENTS
            WHERE   RESOURCE_ID = l_resource_id
            AND     RESOURCE_TYPE = l_resource_type
            AND     DEFAULT_CODE = 'IN' ;
Line: 7230

            select meaning
            from fnd_lookups
            where lookup_type = 'CSP_REQ_SOURCE_TYPE'
            and lookup_code = l_type;
Line: 7236

            select meaning
            from mfg_lookups
            where lookup_type
            like 'MTL_RELATIONSHIP_TYPES'
            and lookup_code = l_item_type;
Line: 7243

            select CONCATENATED_SEGMENTS
            FROM   mtl_system_items_kfv
            where inventory_item_id = c_item_id
            and   organization_id = c_org_id;
Line: 7250

            SELECT PRIMARY_UOM_CODE
            FROM   MTL_SYSTEM_ITEMS_B
            WHERE  INVENTORY_ITEM_ID = item_id
            AND    organization_id  = org_id;
Line: 7370

            SELECT  ORGANIZATION_ID, SUBINVENTORY_CODE
            FROM    CSP_INV_LOC_ASSIGNMENTS
            WHERE   RESOURCE_ID = l_resource_id
            AND     RESOURCE_TYPE = l_resource_type
            AND     DEFAULT_CODE = 'IN' ;
Line: 7377

            select meaning
            from fnd_lookups
            where lookup_type = 'CSP_REQ_SOURCE_TYPE'
            and lookup_code = l_type;
Line: 7383

            select meaning
            from mfg_lookups
            where lookup_type
            like 'MTL_RELATIONSHIP_TYPES'
            and lookup_code = l_item_type;
Line: 7390

            select CONCATENATED_SEGMENTS
            FROM   mtl_system_items_kfv
            where inventory_item_id = c_item_id
            and   organization_id = c_org_id;
Line: 7397

            SELECT PRIMARY_UOM_CODE
            FROM   MTL_SYSTEM_ITEMS_B
            WHERE  INVENTORY_ITEM_ID = item_id
            AND    organization_id  = org_id;
Line: 7560

            SELECT  ORGANIZATION_ID, SUBINVENTORY_CODE
            FROM    CSP_INV_LOC_ASSIGNMENTS
            WHERE   RESOURCE_ID = l_resource_id
            AND     RESOURCE_TYPE = l_resource_type
            AND     DEFAULT_CODE = 'IN' ;
Line: 7567

            select meaning
            from fnd_lookups
            where lookup_type = 'CSP_REQ_SOURCE_TYPE'
            and lookup_code = l_type;
Line: 7573

            select meaning
            from mfg_lookups
            where lookup_type
            like 'MTL_RELATIONSHIP_TYPES'
            and lookup_code = l_item_type;
Line: 7580

            select location_id
            from HR_ALL_ORGANIZATION_UNITS
            where organization_id = c_org_id;
Line: 7585

            select CONCATENATED_SEGMENTS
            FROM   mtl_system_items_kfv
            where inventory_item_id = c_item_id
            and   organization_id = c_org_id;
Line: 7591

            select meaning
            from   OE_SHIP_METHODS_V
            where  lookup_code = c_ship_method;
Line: 7757

        SELECT PRIMARY_UOM_CODE
        FROM   MTL_SYSTEM_ITEMS_B
        WHERE  INVENTORY_ITEM_ID = item_id
        AND    organization_id  = org_id;
Line: 7763

       /* SELECT mri.RELATED_ITEM_ID
        FROM   MTL_RELATED_ITEMS_VIEW mri, mtl_parameters mp
        WHERE  mp.organization_id = org_id
        AND    mri.INVENTORY_ITEM_ID = item_id
        AND    mri.RELATIONSHIP_TYPE_ID = 2
        AND    mri.ORGANIZATION_ID  = MP.MASTER_ORGANIZATION_ID;*/
Line: 7769

        SELECT mri.RELATED_ITEM_ID
        FROM   MTL_RELATED_ITEMS mri, mtl_parameters mp
        WHERE  mp.organization_id = org_id
        AND    mri.INVENTORY_ITEM_ID = item_id
        AND    mri.RELATIONSHIP_TYPE_ID = 2
        AND    mri.ORGANIZATION_ID  = MP.MASTER_ORGANIZATION_ID;
Line: 7858

        SELECT  mp.calendar_code,mp.calendar_exception_set_id
        FROM    mtl_parameters mp
        where     mp.organization_id = p_org_id;
Line: 7867

        select bcd1.calendar_date
        from bom_calendar_dates bcd,
             bom_calendar_dates bcd1
        where bcd.calendar_code = c_calendar_code
        and   bcd.exception_set_id = c_exception_set_id
        and   bcd.calendar_date = c_calendar_date
        and   bcd1.calendar_code = bcd.calendar_code
        and   bcd1.exception_set_id = bcd.exception_set_id
        and   bcd1.seq_num = (bcd.seq_num + c_lead_time);
Line: 7881

          select bcd.seq_num
          from bom_calendar_dates bcd
          where   bcd.calendar_code = c_calendar_code
            and   bcd.exception_set_id = c_exception_set_id
            and   bcd.calendar_date = c_calendar_date;
Line: 7935

        SELECT  mp.calendar_code,mp.calendar_exception_set_id
        FROM    mtl_parameters mp
        WHERE   mp.organization_id = p_to_org_id ;
Line: 7944

        select bcd1.calendar_date
        from bom_calendar_dates bcd,
             bom_calendar_dates bcd1
        where bcd.calendar_code = c_calendar_code
        and   bcd.exception_set_id = c_exception_set_id
        and   bcd.calendar_date = c_calendar_date
        and   bcd1.calendar_code = bcd.calendar_code
        and   bcd1.exception_set_id = bcd.exception_set_id
        and   bcd1.seq_num = (bcd.seq_num - c_lead_time);
Line: 7958

          select bcd.seq_num
          from bom_calendar_dates bcd
          where   bcd.calendar_code = c_calendar_code
            and   bcd.exception_set_id = c_exception_set_id
            and   bcd.calendar_date = c_calendar_date;
Line: 7966

            select cutoff_time,timezone_id
            from CSP_CARRIER_DELIVERY_TIMES
            where  ORGANIZATION_ID = c_org_id
            and    SHIPPING_METHOD = c_ship_method_code;
Line: 8024

        l_statement := 'Select MRP_ATP_SCHEDULE_TEMP_S.NextVal From   Dual@'
                         || p_database_link;
Line: 8050

    select crld.source_id , crld.req_line_detail_id
    from  csp_req_line_details crld
         ,csp_requirement_lines crl
         ,csp_requirement_headers crh
    where  crh.task_id = l_task_id
    and crl.requirement_header_id = crh.requirement_header_id
    and crld.requirement_line_id = crl.requirement_line_id
    and crld.source_type = 'RES' ;
Line: 8060

    select oeh.header_id, crld.req_line_detail_id
    from  csp_req_line_details crld
         ,csp_requirement_lines crl
         ,csp_requirement_headers crh
         ,oe_order_lines_all oel
         ,oe_order_headers_all oeh
    where  crh.task_id = l_task_id
    and crl.requirement_header_id = crh.requirement_header_id
    and crld.requirement_line_id = crl.requirement_line_id
    and crld.source_type = 'IO'
    and oel.line_id = crld.source_id
    and oeh.header_id =  oel.header_id
    order by oeh.header_id;
Line: 8075

    select flow_status_code
    from   oe_order_headers_all
    where  header_id =  c_header_id;
Line: 8080

    select 'Y'
    from jtf_task_statuses_vl
    where task_status_id = l_task_status_id
    and ( CANCELLED_FLAG = 'Y' or rejected_flag = 'Y');
Line: 8086

    select REQ_LINE_DETAIL_ID
    from  csp_req_line_details crld,oe_order_lines_all oel
    where crld.source_id = oel.line_id
    and crld.source_type = 'IO'
    and oel.header_id = c_order_header_id;
Line: 8109

                    delete from csp_req_line_details where req_line_detail_id = l_req_details_line_id;
Line: 8129

                            delete from csp_req_line_details where req_line_detail_id = l_req_details_line_id;
Line: 8143

        select mmt.transaction_quantity transaction_quantity ,mmt.inventory_item_id  item_id,
               mmt.revision revision, mmt.organization_id org_id,mmt.subinventory_code subinv_code,
               crld.source_id line_id, mmt.transaction_uom uom,crh.need_by_date need_by_date,
               crld.requirement_line_id requirement_line_id,rcl.quantity_shipped quantity_shipped,
               rcl.quantity_received quantity_received,crld.req_line_detail_id req_line_detail_id
        from mtl_material_transactions mmt,RCV_SHIPMENT_headers rsh,
            rcv_shipment_lines rcl,
            oe_order_lines_all oola,csp_req_line_details crld,
            csp_requirement_lines crl,
            csp_requirement_headers crh
        where mmt.transaction_id = p_transaction_id
        and mmt.shipment_number = rsh.shipment_num
        and rsh.shipment_header_id = rcl.shipment_header_id
        and oola.source_document_line_id = rcl.requisition_line_id
        and crld.source_id = oola.line_id
        and mmt.source_code = 'RCV'
        and crld.source_type = 'IO'
        and crld.requirement_line_id = crl.requirement_line_id
        and crh.requirement_header_id = crl.requirement_header_id
           and crh.task_id is not null
         UNION
         select mmt.transaction_quantity transaction_quantity ,mmt.inventory_item_id  item_id,
               mmt.revision revision, mmt.organization_id org_id,mmt.subinventory_code subinv_code,
               crld.source_id line_id, mmt.transaction_uom uom,crh.need_by_date need_by_date,
               crld.requirement_line_id requirement_line_id, mmt.transaction_quantity quantity_shipped,
               mmt.transaction_quantity quantity_received,crld.req_line_detail_id req_line_detail_id
         from mtl_material_transactions mmt,
            oe_order_lines_all oola,csp_req_line_details crld,
            csp_requirement_lines crl,csp_requirement_headers crh
          where mmt.transaction_id = p_transaction_id
          and  oola.source_document_id = mmt.transaction_source_id
           and crld.source_id = oola.line_id
        and (mmt.source_code = 'ORDER ENTRY')
        and TRANSACTION_QUANTITY > 0
        and crld.source_type = 'IO'
        and crld.requirement_line_id = crl.requirement_line_id
        and crh.requirement_header_id = crl.requirement_header_id
           and crh.task_id is not null;
Line: 8202

                        csp_req_line_details_pkg.insert_row(px_req_line_detail_id => l_req_line_detali_id
                                              ,p_requirement_line_id => grd.requirement_line_id
                                              ,p_created_by => FND_GLOBAL.user_id
                                              ,p_creation_date => sysdate
                                              ,p_last_updated_by =>  FND_GLOBAL.user_id
                                              ,p_last_update_date => sysdate
                                              ,p_last_update_login => FND_GLOBAL.login_id
                                              ,p_source_type => 'RES'
                                              ,p_source_id => l_reservation_id );
Line: 8213

                 csp_req_line_details_pkg.delete_row(grd.req_line_detail_id);
Line: 8231

     PROCEDURE DELETE_RESERVATION(p_reservation_id IN NUMBER
                                ,x_return_status     OUT NOCOPY VARCHAR2
                                ,x_msg_data         OUT NOCOPY VARCHAR2)
    IS
          CURSOR csp_transactions IS
          SELECT TRANSACTION_SOURCE_TYPE_ID,TRANSACTION_SOURCE_TYPE_NAME
          FROM   MTL_TXN_SOURCE_TYPES
          WHERE  transaction_source_type_id = 13;
Line: 8316

                INV_RESERVATION_PUB.delete_reservation(l_api_version_number
                                                 , l_init_msg_lst
                                                 , x_return_status
                                                 , x_msg_count
                                                 , x_msg_data
                                                 , l_rsv_rec
                                                 , l_serial_number);
Line: 8334

     END DELETE_RESERVATION;
Line: 8357

        SELECT dres.source_id,
          mr.inventory_item_id,
          mr.reservation_quantity,
          mr.reservation_uom_code,
          mr.organization_id,
          mr.subinventory_code,
          dres.requirement_line_id,
          dres.req_line_detail_id,
          h.requirement_header_id
        FROM csp_requirement_headers h,
          csp_requirement_lines l,
          csp_req_line_details dio,
          csp_req_line_details dres,
          oe_order_lines_all oola,
          mtl_reservations mr
        WHERE h.task_id             = p_task_id
        AND h.task_assignment_id    = p_task_asgn_id
        AND h.address_type         IN ('T', 'C', 'P')
        AND h.requirement_header_id = l.requirement_header_id
        AND l.requirement_line_id   = dio.requirement_line_id
        AND dio.source_type        = 'IO'
        AND dio.source_id = oola.line_id
        AND csp_pick_utils.get_order_status(oola.line_id,oola.flow_status_code)      = 'FULLY RECEIVED'
        AND dio.requirement_line_id = dres.requirement_line_id
        AND oola.inventory_item_id    = mr.inventory_item_id
        AND oola.ordered_quantity   = mr.reservation_quantity
        AND dres.source_type       = 'RES'
        AND dres.source_id = mr.reservation_id;
Line: 8398

        SELECT req_line_detail_id
        FROM csp_req_line_details
        WHERE requirement_line_id = v_req_line_id
        AND source_type = 'RES';
Line: 8404

        SELECT ORGANIZATION_ID,
          SUBINVENTORY_CODE
        FROM CSP_INV_LOC_ASSIGNMENTS
        WHERE RESOURCE_ID = p_new_resource_id
        AND RESOURCE_TYPE = p_new_resource_type
        AND DEFAULT_CODE  = 'IN';
Line: 8432

                        SELECT NAME
                        into l_resource_type_name
                        FROM JTF_OBJECTS_VL
                        WHERE OBJECT_CODE = p_new_resource_type;
Line: 8553

                                csp_req_line_details_pkg.delete_row(r_req_line_dtl_rec.req_line_detail_id);
Line: 8556

                        log('move_parts_on_reassign', 'before inserting a new req_line_detail...');
Line: 8558

                        csp_req_line_details_pkg.Insert_Row(
                          px_REQ_LINE_DETAIL_ID => l_req_line_detail_id,
                          p_REQUIREMENT_LINE_ID => old_res_record.requirement_line_id,
                          p_CREATED_BY => FND_GLOBAL.user_id,
                          p_CREATION_DATE => sysdate,
                          p_LAST_UPDATED_BY => FND_GLOBAL.user_id,
                          p_LAST_UPDATE_DATE => sysdate,
                          p_LAST_UPDATE_LOGIN => FND_GLOBAL.user_id,
                          p_SOURCE_TYPE => 'RES',
                          p_SOURCE_ID => l_new_reservation_id);
Line: 8572

                        l_requirement_header.last_update_date := sysdate;
Line: 8585

                        log('move_parts_on_reassign', 'before calling Update_requirement_headers...');
Line: 8586

                        CSP_Requirement_Headers_PVT.Update_requirement_headers(
                                                        P_Api_Version_Number         => 1.0,
                                                        P_Init_Msg_List              => FND_API.G_FALSE,
                                                        P_Commit                     => FND_API.G_FALSE,
                                                        p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
                                                        P_REQUIREMENT_HEADER_Rec     => l_requirement_header,
                                                        X_Return_Status              => x_return_status,
                                                        X_Msg_Count                  => x_msg_count,
                                                        x_msg_data                   => x_msg_data
                                                        );
Line: 8596

                        log('move_parts_on_reassign', 'before calling Update_requirement_headers...x_return_status=' || x_return_status);