DBA Data[Home] [Help]

APPS.GML_RCV_TXN_INTERFACE SQL Statements

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

Line: 35

          SELECT
            pll.line_location_id
            , pll.unit_meas_lookup_code
            , Nvl(pll.promised_date,pll.need_by_date)   promised_date
            , pll.quantity_shipped
            , pll.receipt_days_exception_code
            , pll.qty_rcv_exception_code
            , pll.days_early_receipt_allowed
            , pll.days_late_receipt_allowed
            , 0                                                 po_distribution_id
            , pll.ship_to_location_id
            , Nvl(pll.enforce_ship_to_location_code,'NONE') enforce_ship_to_location_code
            , 0 rcv_transaction_id -- only need it for std_deliver
            , pl.item_revision --only needed for std_deliver
            FROM
            po_line_locations   pll,
            po_lines            pl,
            po_headers          ph,
            rcv_shipment_lines  rsl,
            (SELECT DISTINCT source_line_id
             FROM wms_lpn_contents
             WHERE parent_lpn_id = v_lpn_id) wlc
            WHERE pll.po_line_id                    = Nvl(v_po_line_id, pll.po_line_id)
            AND pll.line_location_id              = Nvl(v_po_line_location_id, pll.line_location_id)
            AND Nvl(pll.po_release_id,0)          = Nvl(v_po_release_id,Nvl(pll.po_release_id,0))
            AND pll.po_line_id                    = pl.po_line_id
            -- change for non item master receipts.
            --AND pl.item_id                      = v_item_id
            and (   pl.item_id                    = v_item_id
                 OR (    v_item_id IS NULL
                     AND pl.item_id IS NULL
                     AND pl.item_description = v_item_desc))
            AND NVL(pll.APPROVED_FLAG,'N')        = 'Y'
            AND NVL(pll.CANCEL_FLAG, 'N')         = 'N'
            AND NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
            AND pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
            AND pll.ship_to_organization_id       = Nvl(v_ship_to_org_id,pll.ship_to_organization_id)
            AND pll.ship_to_location_id           = Nvl(v_ship_to_location_id,pll.ship_to_location_id)
            AND rsl.shipment_header_id            = v_shipment_header_id
            AND rsl.po_line_location_id           = pll.line_location_id
            AND pll.po_line_id                    = wlc.source_line_id (+)
            AND pll.line_location_id in
             ( select pod.line_location_id from po_distributions pod
                         where (v_project_id is null or
                                         (v_project_id = -9999 and pod.project_id is null) or --Bug# 2669021
                      pod.project_id = v_project_id
                     )
                                  and (v_task_id is null or pod.task_id = v_task_id)
              and  pod.po_header_id = pll.po_header_id
                       )
            ORDER BY Nvl(pll.promised_date,pll.need_by_date);
Line: 102

          SELECT COUNT(*)
            FROM
            po_line_locations   pll,
            po_lines            pl,
            po_headers          ph,
            rcv_shipment_lines  rsl,
            (SELECT DISTINCT source_line_id
             FROM wms_lpn_contents
             WHERE parent_lpn_id = v_lpn_id) wlc
            WHERE pll.po_line_id                    = Nvl(v_po_line_id, pll.po_line_id)
            AND pll.line_location_id              = Nvl(v_po_line_location_id, pll.line_location_id)
            AND Nvl(pll.po_release_id,0)          = Nvl(v_po_release_id,Nvl(pll.po_release_id,0))
            AND pll.po_line_id                    = pl.po_line_id
            -- change for non item master receipts.
            --AND pl.item_id                      = v_item_id
            and (   pl.item_id                    = v_item_id
                 OR (    v_item_id IS NULL
                     AND pl.item_id IS NULL
                     AND pl.item_description = v_item_desc))
            AND NVL(pll.APPROVED_FLAG,'N')        = 'Y'
            AND NVL(pll.CANCEL_FLAG, 'N')         = 'N'
            AND NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
            AND pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
            AND pll.ship_to_organization_id       = Nvl(v_ship_to_org_id,pll.ship_to_organization_id)
            AND pll.ship_to_location_id           = Nvl(v_ship_to_location_id,pll.ship_to_location_id)
            AND rsl.shipment_header_id            = v_shipment_header_id
            AND rsl.po_line_location_id           = pll.line_location_id
            AND pll.po_line_id                    = wlc.source_line_id (+)
            AND pll.line_location_id in
                ( select pod.line_location_id
                  from po_distributions pod
                            where ( v_project_id is null or
                                  (v_project_id = -9999 and pod.project_id is null) or --Bug# 2669021
                         pod.project_id = v_project_id
                        )
                          and (v_task_id is null or pod.task_id = v_task_id)
                 and   pod.po_header_id = pll.po_header_id
                );
Line: 156

          SELECT
            pll.line_location_id
            , pll.unit_meas_lookup_code
            , Nvl(pll.promised_date,pll.need_by_date)   promised_date
            , pll.quantity_shipped
            , pll.receipt_days_exception_code
            , pll.qty_rcv_exception_code
            , pll.days_early_receipt_allowed
            , pll.days_late_receipt_allowed
            , 0                                                 po_distribution_id
            , pll.ship_to_location_id
            , Nvl(pll.enforce_ship_to_location_code,'NONE') enforce_ship_to_location_code
            , 0 rcv_transaction_id -- only need it for std_deliver
            , pl.item_revision --only needed for std_deliver
            FROM
            po_line_locations   pll,
            po_lines            pl,
            po_headers          ph,
            rcv_shipment_lines  rsl,
            (SELECT DISTINCT source_line_id
             FROM wms_lpn_contents
             WHERE parent_lpn_id = v_lpn_id) wlc
            WHERE ph.po_header_id                 = header_id
            AND pll.po_header_id                  = header_id
            AND pll.po_line_id                    = Nvl(v_po_line_id, pll.po_line_id)
            AND pll.line_location_id              = Nvl(v_po_line_location_id, pll.line_location_id)
            AND Nvl(pll.po_release_id,0)          = Nvl(v_po_release_id,Nvl(pll.po_release_id,0))
            AND pll.po_line_id                    = pl.po_line_id
            -- change for non item master receipts.
            --AND pl.item_id                      = v_item_id
            and (   pl.item_id                    = v_item_id
                 OR (    v_item_id IS NULL
                     AND pl.item_id IS NULL
                     AND pl.item_description = v_item_desc))
            AND NVL(pll.APPROVED_FLAG,'N')        = 'Y'
            AND NVL(pll.CANCEL_FLAG, 'N')         = 'N'
            AND NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
            AND pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
            AND pll.ship_to_organization_id       = Nvl(v_ship_to_org_id,pll.ship_to_organization_id)
            AND pll.ship_to_location_id           = Nvl(v_ship_to_location_id,pll.ship_to_location_id)
            AND rsl.shipment_header_id            = v_shipment_header_id
            AND rsl.po_line_location_id           = pll.line_location_id
            AND pll.po_line_id                    = wlc.source_line_id (+)
            AND pll.line_location_id in
                ( select pod.line_location_id
                  from po_distributions pod
                            where ( v_project_id is null or
                                  (v_project_id = -9999 and pod.project_id is null) or --Bug# 2669021
                         pod.project_id = v_project_id
                        )
                          and (v_task_id is null or pod.task_id = v_task_id)
                 and   pod.po_header_id = pll.po_header_id
                )
            ORDER BY Nvl(pll.promised_date,pll.need_by_date);
Line: 227

          SELECT COUNT(*)
            FROM
            po_line_locations   pll,
            po_lines            pl,
            po_headers          ph,
            rcv_shipment_lines  rsl,
            (SELECT DISTINCT source_line_id
             FROM wms_lpn_contents
             WHERE parent_lpn_id = v_lpn_id) wlc
            WHERE ph.po_header_id                 = header_id
            AND pll.po_header_id                  = header_id
            AND pll.po_line_id                    = Nvl(v_po_line_id, pll.po_line_id)
            AND pll.line_location_id              = Nvl(v_po_line_location_id, pll.line_location_id)
            AND Nvl(pll.po_release_id,0)          = Nvl(v_po_release_id,Nvl(pll.po_release_id,0))
            AND pll.po_line_id                    = pl.po_line_id
            -- change for non item master receipts.
            --AND pl.item_id                      = v_item_id
            and (   pl.item_id                    = v_item_id
                 OR (    v_item_id IS NULL
                     AND pl.item_id IS NULL
                     AND pl.item_description = v_item_desc))
            AND NVL(pll.APPROVED_FLAG,'N')        = 'Y'
            AND NVL(pll.CANCEL_FLAG, 'N')         = 'N'
            AND NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
            AND pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
            AND pll.ship_to_organization_id       = Nvl(v_ship_to_org_id,pll.ship_to_organization_id)
            AND pll.ship_to_location_id           = Nvl(v_ship_to_location_id,pll.ship_to_location_id)
            AND rsl.shipment_header_id            = v_shipment_header_id
            AND rsl.po_line_location_id           = pll.line_location_id
            AND pll.po_line_id                    = wlc.source_line_id (+)
            AND pll.line_location_id in
                ( select pod.line_location_id
                  from po_distributions pod
                            where ( v_project_id is null or
                                  (v_project_id = -9999 and pod.project_id is null) or --Bug# 2669021
                         pod.project_id = v_project_id
                        )
                          and (v_task_id is null or pod.task_id = v_task_id)
                 and   pod.po_header_id = pll.po_header_id
                ) ;
Line: 282

          select
            pll.line_location_id
            , pll.unit_meas_lookup_code
            , nvl(pll.promised_date,pll.need_by_date)   promised_date
            , pll.quantity_shipped
            , pll.receipt_days_exception_code
            , pll.qty_rcv_exception_code
            , pll.days_early_receipt_allowed
            , pll.days_late_receipt_allowed
            , 0                                                 po_distribution_id
            , pll.ship_to_location_id
            , nvl(pll.enforce_ship_to_location_code,'NONE') enforce_ship_to_location_code
            , 0 rcv_transaction_id -- only need it for std_deliver
            , pl.item_revision --only needed for std_deliver
            from        po_line_locations_all   pll,
            po_lines_all                pl,
            po_headers_all              ph
            where ph.po_header_id                 = header_id
            and pll.po_header_id                  = header_id
            AND pll.po_line_id                    = Nvl(v_po_line_id, pll.po_line_id)
            AND pll.line_location_id              = Nvl(v_po_line_location_id, pll.line_location_id)
            and nvl(pll.po_release_id,0)          = nvl(v_po_release_id,nvl(pll.po_release_id,0))
            and pll.po_line_id                    = pl.po_line_id
            -- change for non item master receipts.
            and (   pl.item_id                    = v_item_id
                 OR (    v_item_id IS NULL
                     AND pl.item_id IS NULL
                     AND pl.item_description = v_item_desc))
            AND ((v_revision IS NOT NULL
                  AND Nvl(pl.item_revision, v_revision) = v_revision)
                 OR (v_revision IS NULL))
            and NVL(pll.APPROVED_FLAG,'N')        = 'Y'
            and NVL(pll.CANCEL_FLAG, 'N')         = 'N'
            and NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
            and pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
            and pll.ship_to_organization_id       = nvl(v_ship_to_org_id,pll.ship_to_organization_id)
            and pll.ship_to_location_id           = nvl(v_ship_to_location_id,pll.ship_to_location_id)
            AND pll.line_location_id in
                ( select pod.line_location_id
                  from po_distributions pod
                  where (v_project_id is null
                         or ((v_project_id = -9999 and pod.project_id is null)--Bug# 2669021
                             or (nvl(pod.project_id,-99) = v_project_id )))
                  and   (v_task_id is null or nvl(pod.task_id,-9999) = v_task_id)
                  and   pod.po_header_id = pll.po_header_id
                 )
            order by pl.item_revision, nvl(pll.promised_date,pll.need_by_date);
Line: 345

          SELECT COUNT(*)
            from  po_line_locations_all pll,
                  po_lines_all                  pl
            WHERE pll.po_header_id                = header_id
            AND pll.po_line_id                    = Nvl(v_po_line_id, pll.po_line_id)
            AND pll.line_location_id              = Nvl(v_po_line_location_id, pll.line_location_id)
            and nvl(pll.po_release_id,0)          = nvl(v_po_release_id,nvl(pll.po_release_id,0))
            and pll.po_line_id                    = pl.po_line_id
            -- change for non item master receipts.
            and (   pl.item_id                    = v_item_id
                 OR (    v_item_id IS NULL
                     AND pl.item_id IS NULL
                     AND pl.item_description = v_item_desc))
            -- and pl.item_id                        = v_item_id
            AND ((v_revision IS NOT NULL
                  AND Nvl(pl.item_revision, v_revision) = v_revision)
                 OR (v_revision IS NULL))
            and NVL(pll.APPROVED_FLAG,'N')        = 'Y'
            and NVL(pll.CANCEL_FLAG, 'N')         = 'N'
            and NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
            and pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
            and pll.ship_to_organization_id       = nvl(v_ship_to_org_id,pll.ship_to_organization_id)
            and pll.ship_to_location_id           = nvl(v_ship_to_location_id,pll.ship_to_location_id)
            AND pll.line_location_id in
                ( select pod.line_location_id
                  from po_distributions pod
                  where (v_project_id is null
                         or ((v_project_id = -9999 and pod.project_id is null)--Bug# 2669021
                             or (nvl(pod.project_id,-99) = v_project_id )))
                  and   (v_task_id is null or nvl(pod.task_id,-9999) = v_task_id)
                  and   pod.po_header_id = pll.po_header_id
                 );
Line: 391

 select
  pll.line_location_id
 ,pll.unit_meas_lookup_code
 ,nvl(pll.promised_date,pll.need_by_date)       promised_date
 ,pll.quantity_shipped
 ,pll.receipt_days_exception_code
 ,pll.qty_rcv_exception_code
 ,pll.days_early_receipt_allowed
 ,pll.days_late_receipt_allowed
 ,pod.po_distribution_id
 ,pll.ship_to_location_id
 ,nvl(pll.enforce_ship_to_location_code,'NONE') enforce_ship_to_location_code
 ,0 rcv_transaction_id -- only need it for std_deliver
 ,pl.item_revision --only needed for std_deliver
 from  po_distributions    pod,
       po_line_locations   pll,
       po_lines            pl,
       po_headers          ph
 where ph.po_header_id                 = header_id
 and pod.po_header_id                  = header_id
 AND pod.po_line_id                    = Nvl(v_po_line_id, pod.po_line_id)
 AND pod.line_location_id              = Nvl(v_po_line_location_id, pod.line_location_id)
 AND pod.po_distribution_id            = Nvl(v_po_distribution_id, pod.po_distribution_id)
 and ph.po_header_id                   = pl.po_header_id
 and nvl(pll.po_release_id,0)          = nvl(v_po_release_id,nvl(pll.po_release_id,0))
 and pll.po_line_id                    = pl.po_line_id
 --and pl.item_id                              = v_item_id
 -- change for non item master receipts.
 and (   pl.item_id                    = v_item_id
      OR (  v_item_id IS NULL
               AND pl.item_id IS NULL
               AND pl.item_description = v_item_desc))
 AND ((v_revision IS NOT NULL
       AND Nvl(pl.item_revision, v_revision) = v_revision)
      OR (v_revision IS NULL))
 and NVL(pll.APPROVED_FLAG,'N')        = 'Y'
 and NVL(pll.CANCEL_FLAG, 'N')         = 'N'
 and NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
 and pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
 and pll.line_location_id              = pod.line_location_id
 and pll.ship_to_organization_id       = nvl(v_ship_to_org_id,pll.ship_to_organization_id)
 and pll.ship_to_location_id           = nvl(v_ship_to_location_id,pll.ship_to_location_id)
 and (v_project_id is null or
       ( v_project_id = -9999 and pod.project_id is null ) or --Bug# 2669021
         pod.project_id = v_project_id)
 and (v_task_id is null or pod.task_id = v_task_id)
 order by pl.item_revision, nvl(pll.promised_date,pll.need_by_date);
Line: 452

 select count(*)
 from po_distributions  pod,
      po_line_locations pll,
      po_lines          pl
 where pll.po_header_id                = header_id
 AND pod.po_line_id                    = Nvl(v_po_line_id, pod.po_line_id)
 AND pod.line_location_id              = Nvl(v_po_line_location_id, pod.line_location_id)
 AND pod.po_distribution_id            = Nvl(v_po_distribution_id, pod.po_distribution_id)
 and nvl(pll.po_release_id,0)          = nvl(v_po_release_id,nvl(pll.po_release_id,0))
 and pll.po_line_id                    = pl.po_line_id
 --and pl.item_id                              = v_item_id
 -- change for non item master receipts.
 and (   pl.item_id                    = v_item_id
      OR (  v_item_id IS NULL
               AND pl.item_id IS NULL
               AND pl.item_description = v_item_desc))
 AND ((v_revision IS NOT NULL
       AND Nvl(pl.item_revision, v_revision) = v_revision)
      OR (v_revision IS NULL))
 and NVL(pll.APPROVED_FLAG,'N')        = 'Y'
 and NVL(pll.CANCEL_FLAG, 'N')         = 'N'
 and NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
 and pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
 and pll.line_location_id              = pod.line_location_id
 and pll.ship_to_organization_id       = nvl(v_ship_to_org_id,pll.ship_to_organization_id)
 and pll.ship_to_location_id           = nvl(v_ship_to_location_id,pll.ship_to_location_id)
 and (v_project_id is null or
       ( v_project_id = -9999 and pod.project_id is null ) or --Bug# 2669021
         pod.project_id = v_project_id)
 and (v_task_id is null or pod.task_id = v_task_id) ;
Line: 498

 select
  pll.line_location_id
 ,pll.unit_meas_lookup_code
 ,nvl(pll.promised_date,pll.need_by_date)       promised_date
 ,0 --pll.quantity_shipped
 ,pll.receipt_days_exception_code
 ,pll.qty_rcv_exception_code
 ,pll.days_early_receipt_allowed
 ,pll.days_late_receipt_allowed
 ,pod.po_distribution_id
 ,pll.ship_to_location_id
 ,nvl(pll.enforce_ship_to_location_code,'NONE') enforce_ship_to_location_code
 ,rs.rcv_transaction_id
 ,rs.item_revision
 from  po_distributions     pod,
       po_line_locations    pll,
       po_lines             pl,
       po_headers           ph,
       rcv_supply           rs,
       rcv_shipment_headers rsh,
--       rcv_shipment_lines   rsl,
       rcv_transactions     rt
 where rsh.receipt_source_code         = 'VENDOR'
 AND ph.po_header_id                   = header_id
 AND pod.po_line_id                    = Nvl(v_po_line_id, pod.po_line_id)
 AND pod.line_location_id              = Nvl(v_po_line_location_id, pod.line_location_id)
 AND pod.po_distribution_id            = Nvl(v_po_distribution_id, pod.po_distribution_id)
 and pl.po_line_id                     = rs.po_line_id
 and pll.line_location_id              = rs.po_line_location_id
 and pod.line_location_id              = rs.po_line_location_id
-- and pl.item_id                      = v_item_id
 and NVL(pll.APPROVED_FLAG,'N')        = 'Y'
 and NVL(pll.CANCEL_FLAG, 'N')         = 'N'
 and NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
 and pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
 and pll.ship_to_organization_id       = nvl(v_ship_to_org_id,pll.ship_to_organization_id)
 and pll.ship_to_location_id           = nvl(v_ship_to_location_id,pll.ship_to_location_id)
 AND RT.TRANSACTION_TYPE               <> 'UNORDERED'
 -- for all the transactions in rt for which we can putaway, the
 -- transfer_lpn_id should match the lpn being putaway.
 --AND Nvl(rt.transfer_lpn_id,-1)        = Nvl(v_lpn_id,-1)
 -- Fix for 1865886. Commented the above and added the following for lpn
 AND Nvl(v_lpn_id,-1) IN (select nvl(rt2.transfer_lpn_id,-1)
                            from rcv_transactions rt2
                           where rt2.transaction_type <> 'DELIVER'
                           start with rt2.transaction_id = rs.supply_source_id
                         connect by prior rt2.transaction_id = rt2.parent_transaction_id
                        union all
                          select nvl(rt2.lpn_id,-1)
                            from rcv_transactions rt2
                           where rt2.transaction_type not in ('RECEIVE', 'DELIVER')
                           start with rt2.transaction_id = rs.supply_source_id
                         connect by prior rt2.transaction_id = rt2.parent_transaction_id
                          )
  --
 and rs.supply_type_code               = 'RECEIVING'
 --and rsl.shipment_line_id   = rs.shipment_line_id
 and rsh.shipment_header_id            = rs.shipment_header_id
 AND (Nvl(rsh.receipt_num,'@@@'))      = Nvl(v_receipt_num,Nvl(rsh.receipt_num,'@@@'))
 and rt.transaction_id                 = rs.rcv_transaction_id
 AND rt.transaction_date               < Nvl(v_txn_date,(rt.transaction_date + 1))
 --and rt.transaction_type <> 'UNORDERED'
 --
 and rs.po_header_id = header_id
 and rs.item_id      = v_item_id
 AND ((v_revision IS NOT NULL
       AND Nvl(rs.item_revision, v_revision) = v_revision)
      OR (v_revision IS NULL))
 AND (rt.routing_header_id IS NULL OR
      rt.routing_header_id <> 2 OR
      (rt.routing_header_id = 2
       AND rt.inspection_status_code <> 'NOT INSPECTED'
       AND rt.inspection_status_code = Nvl(v_inspection_status,rt.inspection_status_code)))
 --
 order by rs.item_revision, nvl(pll.promised_date,pll.need_by_date);
Line: 588

select count(*)
 from  po_distributions     pod,
       po_line_locations    pll,
       po_lines             pl,
       po_headers           ph,
       rcv_supply           rs,
       rcv_shipment_headers rsh,
--       rcv_shipment_lines   rsl,
       rcv_transactions     rt
 where rsh.receipt_source_code         = 'VENDOR'
 AND ph.po_header_id                   = header_id
 AND pod.po_line_id                    = Nvl(v_po_line_id, pod.po_line_id)
 AND pod.line_location_id              = Nvl(v_po_line_location_id, pod.line_location_id)
 AND pod.po_distribution_id            = Nvl(v_po_distribution_id, pod.po_distribution_id)
 and pl.po_line_id                     = rs.po_line_id
 and pll.line_location_id              = rs.po_line_location_id
 and pod.line_location_id              = rs.po_line_location_id
-- and NVL(pl.item_id,0)               = nvl(v_item_id,nvl(pl.item_id,0))
 and NVL(pll.APPROVED_FLAG,'N')        = 'Y'
 and NVL(pll.CANCEL_FLAG, 'N')         = 'N'
 and NVL(pll.CLOSED_CODE,'OPEN')       <> 'FINALLY CLOSED'
 and pll.SHIPMENT_TYPE                 IN ('STANDARD','BLANKET','SCHEDULED')
 and pll.ship_to_organization_id       = nvl(v_ship_to_org_id,pll.ship_to_organization_id)
 and pll.ship_to_location_id           = nvl(v_ship_to_location_id,pll.ship_to_location_id)
 AND RT.TRANSACTION_TYPE               <> 'UNORDERED'
 -- for all the transactions in rt for which we can putaway, the
 -- transfer_lpn_id should match the lpn being putaway.
 --AND Nvl(rt.transfer_lpn_id,-1)        = Nvl(v_lpn_id,-1)
 -- Fix for 1865886. Commented the above and added the following for lpn
 AND Nvl(v_lpn_id,-1) IN (select nvl(rt2.transfer_lpn_id,-1)
                            from rcv_transactions rt2
                           where rt2.transaction_type <> 'DELIVER'
                           start with rt2.transaction_id = rs.supply_source_id
                         connect by prior rt2.transaction_id = rt2.parent_transaction_id
                        union all
                          select nvl(rt2.lpn_id,-1)
                            from rcv_transactions rt2
                           where rt2.transaction_type not in ('RECEIVE', 'DELIVER')
                           start with rt2.transaction_id = rs.supply_source_id
                         connect by prior rt2.transaction_id = rt2.parent_transaction_id
                          )
  --
 and rs.supply_type_code               = 'RECEIVING'
 --and rsl.shipment_line_id   = rs.shipment_line_id
 and rsh.shipment_header_id            = rs.shipment_header_id
 AND (Nvl(rsh.receipt_num,'@@@'))      = Nvl(v_receipt_num,Nvl(rsh.receipt_num,'@@@'))
 and rt.transaction_id                 = rs.rcv_transaction_id
 AND rt.transaction_date               < Nvl(v_txn_date,(rt.transaction_date + 1))
 --and rt.transaction_type <> 'UNORDERED'
 --
 and rs.po_header_id = header_id
 and rs.item_id      = v_item_id
 AND ((v_revision IS NOT NULL
       AND Nvl(rs.item_revision, v_revision) = v_revision)
      OR (v_revision IS NULL))
 AND (rt.routing_header_id IS NULL OR
      rt.routing_header_id <> 2 OR
      (rt.routing_header_id = 2
       AND rt.inspection_status_code <> 'NOT INSPECTED'
       AND rt.inspection_status_code = Nvl(v_inspection_status,rt.inspection_status_code)));
Line: 654

         select segment1
         from mtl_system_items
         where inventory_item_id = p_item_id and
               organization_id=p_organization_id;
Line: 680

 insert_into_table              boolean := FALSE;
Line: 1042

                           temp_cascaded_table.delete(i);
Line: 1061

                        temp_cascaded_table.delete(i);
Line: 1175

            insert_into_table := FALSE;
Line: 1349

                    insert_into_table := TRUE;
Line: 1352

                    insert_into_table := TRUE;
Line: 1364

                    insert_into_table := TRUE;
Line: 1370

                    insert_into_table := FALSE;
Line: 1377

            if insert_into_table then
               if (x_first_trans) then
                  x_first_trans                         := FALSE;