DBA Data[Home] [Help]

APPS.WMS_CROSS_DOCK_PVT SQL Statements

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

Line: 16

   select to_char(sysdate,'MM/DD/YYYY HH:MM:SS') INTO l_ts from dual;
Line: 165

	  SELECT mtrl.line_id,
	    mtrl.inventory_item_id,
	    msi.item_type,
	    mtrl.project_id,
	    mtrl.task_id,
	    mtrl.uom_code,
	    muom.uom_class,
	    mtrl.last_update_login,
	    mtrl.reference,
	    mtrl.reference_id,
	    mtrl.transaction_source_type_id
	    FROM mtl_txn_request_lines mtrl,
	    mtl_system_items msi,
	    mtl_units_of_measure muom
	    WHERE mtrl.lpn_id  = l_lpn_id   -- the MTRL is within the LPN
	    AND (mtrl.line_id = p_move_order_line_id OR p_move_order_line_id IS NULL)
	      AND mtrl.backorder_delivery_detail_id IS NULL  -- this LPN has not crossdocked yet
		AND (mtrl.quantity_detailed = 0 OR mtrl.quantity_detailed IS NULL) -- no MMTT is created for this LPN
		  AND (inspection_status = 2 OR inspection_status IS NULL)
		    AND wms_process_flag = 1
		    AND msi.inventory_item_id = mtrl.inventory_item_id
		    AND msi.organization_id = mtrl.organization_id
		    AND mtrl.uom_code = muom.uom_code;
Line: 191

	 SELECT line_id,
	   inventory_item_id,
	   backorder_delivery_detail_id,
	   crossdock_type,
	   to_subinventory_code,
	   to_locator_id,
	   wip_supply_type,
	   wip_entity_id,
	   operation_seq_num,
	   repetitive_schedule_id,
	   transaction_source_type_id
	   FROM
	   mtl_txn_request_lines mtrl
	   WHERE mtrl.lpn_id  = l_lpn_id   -- the MTRL is within the LPN
	   AND mtrl.line_id = NVL(p_move_order_line_id, mtrl.line_id)
	   AND mtrl.backorder_delivery_detail_id IS NOT NULL  -- also including lines planned crossdocked
	     AND (mtrl.quantity_detailed = 0 OR mtrl.quantity_detailed IS NULL) -- no MMTT is created for this LPN
	       AND NVL(inspection_status, 2) = 2
	       AND wms_process_flag = 1

         --BUG 5194761: If case of Item Load, p_move_order_line will be passed
         --and we need to pick up the MOL that may be split by the crossdock API.
         --So make use of the mtrl.reference_detail_id
         UNION
	 SELECT line_id,
	   inventory_item_id,
	   backorder_delivery_detail_id,
	   crossdock_type,
	   to_subinventory_code,
	   to_locator_id,
	   wip_supply_type,
	   wip_entity_id,
	   operation_seq_num,
	   repetitive_schedule_id,
	   transaction_source_type_id
	   FROM
	   mtl_txn_request_lines mtrl
	   WHERE mtrl.lpn_id  = l_lpn_id   -- the MTRL is within the LPN
	   AND p_move_order_line_id IS NOT NULL
           AND mtrl.reference_detail_id = p_move_order_line_id
	   AND mtrl.backorder_delivery_detail_id IS NOT NULL  -- also including lines planned crossdocked
	     AND (mtrl.quantity_detailed = 0 OR mtrl.quantity_detailed IS NULL) -- no MMTT is created for this LPN
	       AND NVL(inspection_status, 2) = 2
	       AND wms_process_flag = 1;
Line: 268

      SELECT Nvl(mp.crossdock_flag, 2),
	mp.default_crossdock_criteria_id,
	mp.default_crossdock_subinventory, -- default wip crossdocking sub
	mp.default_crossdock_locator_id, -- default wip crossdocking loc
	wsp.default_stage_subinventory,
	wsp.default_stage_locator_id
	INTO l_xdock_flag,
	l_default_xdock_criteria_id,
	l_default_xdock_sub, -- default wip crossdocking sub
	l_default_xdock_loc_id,-- default wip crossdocking loc
	l_default_ship_staging_sub,
	l_default_ship_staging_loc_id
	FROM mtl_parameters mp, wsh_shipping_parameters wsp
	WHERE mp.organization_id = wsp.organization_id (+)
	AND mp.organization_id = l_org_id;
Line: 326

	 SELECT location_id
	   INTO l_location_id
	   FROM rcv_supply
	   WHERE lpn_id = p_lpn
	   AND ROWNUM<2;
Line: 573

	       SELECT nvl(nvl(supply_subinventory, mp.default_crossdock_subinventory), wp.default_pull_supply_subinv),
		 nvl(nvl(supply_locator_id, mp.default_crossdock_locator_id), wp.default_pull_supply_locator_id)
		 INTO l_to_sub_code,
		 l_to_loc_id
		 FROM wip_requirement_operations wro,
		 mtl_txn_request_lines mtrl,
		 mtl_parameters mp,
		 wip_parameters wp
		 WHERE wro.organization_id = l_org_id
		 AND mp.organization_id = l_org_id
		 AND wp.organization_id = l_org_id
		 AND mtrl.line_id = l_line_id
		 AND wro.inventory_item_id = mtrl.inventory_item_id
		 AND wro.wip_entity_id  = mtrl.wip_entity_id
		 AND nvl(wro.operation_seq_num, -1)  = Nvl(mtrl.operation_seq_num, nvl(wro.operation_seq_num, -1))
		 AND nvl(wro.repetitive_schedule_id, -1)  = Nvl(mtrl.repetitive_schedule_id, nvl(wro.repetitive_schedule_id, -1));
Line: 606

		  SELECT default_pull_supply_subinv,
		    default_pull_supply_locator_id
		    INTO l_to_sub_code,
		    l_to_loc_id
		    FROM wip_parameters
		    WHERE organization_id = l_org_id;
Line: 629

		SELECT delivery_id
		  INTO l_delivery_id
		  FROM wsh_delivery_assignments_v
		  WHERE delivery_detail_id = l_backorder_delivery_detail_id;
Line: 662

			 SELECT 2
			   , inv_salesorder.get_salesorder_for_oeheader(wdd.source_header_id)
			   , wdd.source_line_id
			   INTO l_source_type_id, l_source_header_id, l_source_line_id
			   FROM wsh_delivery_details wdd
			   WHERE wdd.delivery_detail_id = l_backorder_delivery_detail_id;
Line: 723

		     SELECT crossdock_criteria_id,
		       demand_ship_date
		       INTO l_xdock_criterion_id,
		       l_expected_delivery_time
		       FROM mtl_reservations
		       WHERE demand_source_line_detail = l_backorder_delivery_detail_id
		       AND supply_source_type_id  = inv_reservation_global.g_source_type_rcv
		       AND organization_id = l_org_id
		       AND inventory_item_id = l_inventory_item_id;
Line: 1069

	    UPDATE mtl_txn_request_lines
	      SET to_subinventory_code = l_to_sub_code,
	      to_locator_id = l_to_loc_id
	      WHERE line_id = l_line_id;
Line: 1076

	    UPDATE mtl_txn_request_lines
	      SET to_subinventory_code = Nvl(l_to_sub_code, l_default_ship_staging_sub),
	      to_locator_id = Nvl(l_to_loc_id, l_default_ship_staging_loc_id)
	      WHERE line_id = l_line_id;
Line: 1218

     l_update_rsv_rec			INV_Reservation_GLOBAL.MTL_RESERVATION_REC_TYPE;
Line: 1273

	SELECT serial_number
	  FROM mtl_serial_numbers
	  WHERE lpn_id = l_lpn_id;
Line: 1278

	SELECT fm_serial_number
	  FROM  mtl_serial_numbers_temp
	  WHERE transaction_temp_id=l_serial_temp_id ;
Line: 1283

    SELECT lpn_id, license_plate_number, parent_lpn_id, organization_id, subinventory_code, locator_id,
           tare_weight, tare_weight_uom_code, gross_weight, gross_weight_uom_code,
           container_volume, container_volume_uom, content_volume, content_volume_uom_code
    FROM   wms_license_plate_numbers
    START WITH lpn_id = p_innermost_lpn_id
    CONNECT BY lpn_id = PRIOR parent_lpn_id;
Line: 1313

      SELECT
	l.line_id, l.backorder_delivery_detail_id,l.inventory_item_id,Nvl(crossdock_type,1)
	,l.transaction_source_type_id,l.txn_source_id
	INTO l_mo_line_id,l_del_id,l_item_id,l_crossdock_type,l_transaction_source_type_id,l_txn_supply_source_id
	FROM mtl_txn_request_lines l, mtl_material_transactions_temp t, wsh_delivery_details_ob_grp_v wdd
	WHERE t.transaction_temp_id=l_temp_id
	AND  l.backorder_delivery_detail_id = wdd.delivery_detail_id
	AND t.move_order_line_id=l.line_id
	AND exists (
		    select 1 from oe_order_lines_all oel
		    where oel.line_id = wdd.source_line_id
		    and nvl(oel.project_id,-9999) = nvl(l.project_id,-9999)
		    and nvl(oel.task_id,-9999) = nvl(l.task_id,-9999)
		    );
Line: 1331

	    SELECT
	      l.line_id, l.backorder_delivery_detail_id,l.inventory_item_id,Nvl(crossdock_type,1)
	      ,l.transaction_source_type_id,l.txn_source_id
	      INTO l_mo_line_id,l_del_id,l_item_id,l_crossdock_type,l_transaction_source_type_id,l_txn_supply_source_id
	      FROM mtl_txn_request_lines l, mtl_material_transactions_temp t
	      WHERE t.transaction_temp_id=l_temp_id
	      AND t.move_order_line_id=l.line_id;
Line: 1382

       SELECT  t.primary_quantity,t.inventory_item_id,t.subinventory_code,
	 t.locator_id,t.revision,t.transaction_type_id,t.transfer_lpn_id,
	 t.content_lpn_id,i.primary_uom_code,i.lot_control_code,
	 i.serial_number_control_code
	 INTO  l_prim_qty ,l_item_id,l_sub,
	 l_loc,l_rev,l_transaction_type_id,
	 l_transfer_lpn_id,l_cnt_lpn_id,l_prim_uom
	 ,l_lot_control_code, l_serial_control_code
	 FROM mtl_material_transactions_temp t,
	 mtl_system_items i
	 WHERE t.transaction_temp_id=l_temp_id
	 AND t.organization_id=l_org_id
	 AND t.organization_id =i.organization_id
	 AND t.inventory_item_id=i.inventory_item_id;
Line: 1407

	  SELECT lot_number,serial_transaction_temp_id INTO l_lot,
	    l_serial_temp_id
	    FROM  mtl_transaction_lots_temp
	    WHERE transaction_temp_id=l_temp_id;
Line: 1428

	 SELECT * INTO l_demand_info
	   from wsh_inv_delivery_details_v
	   WHERE delivery_detail_id=l_del_id;
Line: 1448

	 select Nvl(order_source_id,1)
	   into   l_order_source_id
	   from oe_order_lines_all
	   where line_id = l_demand_info.oe_line_id;
Line: 1477

	       SELECT Nvl(po_header_id, -1)
		 INTO l_query_rsv_rec.supply_source_header_id
		 FROM rcv_transactions
		 -- patchset j changes
		 WHERE transaction_id = l_txn_supply_source_id;
Line: 1523

	       l_update_rsv_rec := l_reservation_tbl(i);
Line: 1524

	       l_update_rsv_rec.demand_source_delivery	:= NULL;
Line: 1525

	       l_update_rsv_rec.primary_uom_code             := l_prim_uom;
Line: 1526

	       l_update_rsv_rec.primary_uom_id               := NULL;
Line: 1527

	       l_update_rsv_rec.reservation_uom_code         := NULL;
Line: 1528

	       l_update_rsv_rec.reservation_uom_id           := NULL;
Line: 1529

	       l_update_rsv_rec.reservation_quantity         := NULL;
Line: 1533

		  l_update_rsv_rec.primary_reservation_quantity :=
		    l_reservation_tbl(i).primary_reservation_quantity;
Line: 1538

		  l_update_rsv_rec.primary_reservation_quantity :=
		    l_primary_temp_qty;
Line: 1543

	       l_update_rsv_rec.supply_source_type_id := INV_Reservation_GLOBAL.g_source_type_inv;
Line: 1544

	       l_update_rsv_rec.supply_source_header_id      := NULL;
Line: 1545

	       l_update_rsv_rec.supply_source_line_id        := NULL;
Line: 1546

	       l_update_rsv_rec.supply_source_name           := NULL;
Line: 1547

	       l_update_rsv_rec.supply_source_line_detail    := NULL;
Line: 1549

	       l_update_rsv_rec.subinventory_code            := l_sub;
Line: 1550

	       l_update_rsv_rec.subinventory_id              := NULL;
Line: 1551

	       l_update_rsv_rec.locator_id                   := l_loc;
Line: 1554

	       l_update_rsv_rec.lpn_id                       := l_transfer_lpn_id;
Line: 1564

		  p_to_rsv_rec             => l_update_rsv_rec,
		  p_original_serial_number => l_dummy_sn,
		  p_to_serial_number       => l_dummy_sn,
		  p_validation_flag        => fnd_api.g_true,
		  x_to_reservation_id      => l_org_wide_res_id);
Line: 1587

	    l_update_rsv_rec.reservation_id 		:= NULL; -- cannot know
Line: 1588

	    l_update_rsv_rec.requirement_date 		:= Sysdate;
Line: 1589

	    l_update_rsv_rec.organization_id 		:= l_org_id;
Line: 1590

	    l_update_rsv_rec.inventory_item_id 		:= l_item_id;
Line: 1593

	       l_update_rsv_rec.demand_source_type_id     :=
		 INV_RESERVATION_GLOBAL.G_SOURCE_TYPE_INTERNAL_ORD; -- Internal Order
Line: 1596

	       l_update_rsv_rec.demand_source_type_id   :=
		 INV_RESERVATION_GLOBAL.G_SOURCE_TYPE_OE; -- Order Entry
Line: 1600

	    --l_update_rsv_rec.demand_source_type_id 	:= inv_globals.G_SourceType_SalesOrder;
Line: 1602

	    l_update_rsv_rec.demand_source_name 		:= NULL;
Line: 1603

	    l_update_rsv_rec.demand_source_header_id 	:= l_mso_header_id;
Line: 1604

	    l_update_rsv_rec.demand_source_line_id 	:= l_demand_info.oe_line_id;
Line: 1605

	    l_update_rsv_rec.demand_source_delivery	:= NULL;
Line: 1606

	    l_update_rsv_rec.primary_uom_code             := l_prim_uom;
Line: 1607

	    l_update_rsv_rec.primary_uom_id               := NULL;
Line: 1608

	    l_update_rsv_rec.reservation_uom_code         := NULL;
Line: 1609

	    l_update_rsv_rec.reservation_uom_id           := NULL;
Line: 1610

	    l_update_rsv_rec.reservation_quantity         := NULL;
Line: 1611

	    l_update_rsv_rec.primary_reservation_quantity := l_prim_qty;
Line: 1612

	    l_update_rsv_rec.autodetail_group_id          := NULL;
Line: 1613

	    l_update_rsv_rec.external_source_code         := NULL;
Line: 1614

	    l_update_rsv_rec.external_source_line_id      := NULL;
Line: 1615

	    l_update_rsv_rec.supply_source_type_id 	:=
	      INV_Reservation_GLOBAL.g_source_type_inv;
Line: 1617

	    l_update_rsv_rec.supply_source_header_id      := NULL;
Line: 1618

	    l_update_rsv_rec.supply_source_line_id        := NULL;
Line: 1619

	    l_update_rsv_rec.supply_source_name           := NULL;
Line: 1620

	    l_update_rsv_rec.supply_source_line_detail    := NULL;
Line: 1622

	    l_update_rsv_rec.revision                     := l_rev;
Line: 1623

	    l_update_rsv_rec.subinventory_code            := l_sub;
Line: 1624

	    l_update_rsv_rec.subinventory_id              := NULL;
Line: 1625

	    l_update_rsv_rec.locator_id                   := l_loc;
Line: 1626

	    l_update_rsv_rec.lot_number                   := l_lot;
Line: 1627

	    l_update_rsv_rec.lot_number_id                := NULL;
Line: 1628

	    l_update_rsv_rec.pick_slip_number             := NULL;
Line: 1631

	    l_update_rsv_rec.lpn_id                       := l_transfer_lpn_id;
Line: 1632

	    l_update_rsv_rec.attribute_category           := NULL;
Line: 1633

	    l_update_rsv_rec.attribute1                   := NULL;
Line: 1634

	    l_update_rsv_rec.attribute2                   := NULL;
Line: 1635

	    l_update_rsv_rec.attribute3                   := NULL;
Line: 1636

	    l_update_rsv_rec.attribute4                   := NULL;
Line: 1637

	    l_update_rsv_rec.attribute5                   := NULL;
Line: 1638

	    l_update_rsv_rec.attribute6                   := NULL;
Line: 1639

	    l_update_rsv_rec.attribute7                   := NULL;
Line: 1640

	    l_update_rsv_rec.attribute8                   := NULL;
Line: 1641

	    l_update_rsv_rec.attribute9                   := NULL;
Line: 1642

	    l_update_rsv_rec.attribute10                  := NULL;
Line: 1643

	    l_update_rsv_rec.attribute11                  := NULL;
Line: 1644

	    l_update_rsv_rec.attribute12                  := NULL;
Line: 1645

	    l_update_rsv_rec.attribute13                  := NULL;
Line: 1646

	    l_update_rsv_rec.attribute14                  := NULL;
Line: 1647

	    l_update_rsv_rec.attribute15                  := NULL;
Line: 1648

	    l_update_rsv_rec.ship_ready_flag 		:= NULL;
Line: 1649

	    l_update_rsv_rec.detailed_quantity 		:= 0;
Line: 1662

	       , p_rsv_rec                   => l_update_rsv_rec
	       , p_serial_number             => l_dummy_sn
	       , x_serial_number             => l_dummy_sn
	       , p_partial_reservation_flag  => fnd_api.g_true
	       , p_force_reservation_flag    => fnd_api.g_false
	       , p_validation_flag           => fnd_api.g_true
	       , x_quantity_reserved         => l_qty_succ_reserved
	       , x_reservation_id            => l_org_wide_res_id
	       );
Line: 1717

	 -- staged. Am calling an API to update the reservation thusly..

	 IF (l_debug = 1) THEN
	    mydebug('Upd Reservation as having been staged');
Line: 1722

	    mydebug('Calling API to update rsv as staged...');
Line: 1724

	 inv_staged_reservation_util.update_staged_flag
	   ( x_return_status  =>l_return_status,
	     x_msg_count =>l_msg_cnt,
	     x_msg_data  =>l_msg_data,
	     p_reservation_id  =>l_org_wide_res_id,
	     p_staged_flag =>'Y');
Line: 1746

          mydebug('After calling API to update rsv as staged');
Line: 1755

       select  oe_header_id, oe_line_id
	 into  l_source_header_id, l_source_line_id
	 from wsh_inv_delivery_details_v
	 WHERE delivery_detail_id=l_del_id;
Line: 1802

		WSH_INTERFACE.Update_Shipping_Attributes
		  (p_source_code               => 'INV',
		   p_changed_attributes        => l_shipping_attr,
		   x_return_status             => l_return_status
		   );
Line: 1809

   		mydebug('after update shipping attributes');
Line: 1818

		   UPDATE mtl_serial_numbers
		     SET  group_mark_id = mtl_material_transactions_s.NEXTVAL
		     WHERE serial_number = l_serial_number
		     AND   inventory_item_id = l_item_id
		     AND   current_organization_id = l_org_id;
Line: 1831

		   mydebug('Number of serial number updated: ' || SQL%rowcount);
Line: 1864

		WSH_INTERFACE.Update_Shipping_Attributes
		  (p_source_code               => 'INV',
		   p_changed_attributes        => l_shipping_attr,
		   x_return_status             => l_return_status
		   );
Line: 1872

   		mydebug('after update shipping attributes');
Line: 1880

		   UPDATE mtl_serial_numbers
		     SET  group_mark_id = mtl_material_transactions_s.NEXTVAL
		     WHERE serial_number = l_serial_number
		     AND   inventory_item_id = l_item_id
		     AND   current_organization_id = l_org_id;
Line: 1893

		   mydebug('Number of serial number updated: ' || SQL%rowcount);
Line: 1937

		      WSH_INTERFACE.Update_Shipping_Attributes
			(p_source_code               => 'INV',
			 p_changed_attributes        => l_shipping_attr,
			 x_return_status             => l_return_status
			 );
Line: 1948

			 UPDATE mtl_serial_numbers
			   SET  group_mark_id = mtl_material_transactions_s.NEXTVAL
			   WHERE serial_number = l_serial_number
			   AND   inventory_item_id = l_item_id
			   AND   current_organization_id = l_org_id;
Line: 1961

			 mydebug('Number of serial number updated: ' || SQL%rowcount);
Line: 1977

   		      mydebug('after update shipping attributes');
Line: 1997

		      WSH_INTERFACE.Update_Shipping_Attributes
			(p_source_code               => 'INV',
			 p_changed_attributes        => l_shipping_attr,
			 x_return_status             => l_return_status
			 );
Line: 2008

			 UPDATE mtl_serial_numbers
			   SET  group_mark_id = mtl_material_transactions_s.NEXTVAL
			   WHERE serial_number = l_serial_number
			   AND   inventory_item_id = l_item_id
			   AND   current_organization_id = l_org_id;
Line: 2021

			    mydebug('Number of serial number updated: ' || SQL%rowcount);
Line: 2037

   		      mydebug('after update shipping attributes');
Line: 2060

   		      mydebug('about to call update shipping attributes');
Line: 2067

		      WSH_INTERFACE.Update_Shipping_Attributes
			(p_source_code               => 'INV',
			 p_changed_attributes        => l_shipping_attr,
			 x_return_status             => l_return_status
			 );
Line: 2116

   		      mydebug('after update shipping attributes');
Line: 2127

	    SELECT delivery_detail_id INTO l_lpn_del_detail_id
	      FROM wsh_delivery_details_ob_grp_v
	      WHERE lpn_id=l_transfer_lpn_id
	      AND ROWNUM=1;
Line: 2139

   	 mydebug('Update LPN context to picked');
Line: 2175

	 	       SELECT 1 INTO l_ret
	 	       FROM   wsh_delivery_details
	 	       WHERE  lpn_id = parent_lpn_rec.lpn_id;
Line: 2232

                  mydebug('Done with call to WSH Create_Update_Containers');
Line: 2329

      mydebug('Before calling update shipping');
Line: 2332

   WSH_INTERFACE.Update_Shipping_Attributes
     (p_source_code               => 'INV',
      p_changed_attributes        => l_shipping_attr,
      x_return_status             => l_return_status
      );
Line: 2404

      SELECT status
	INTO l_wdt_status
	FROM wms_dispatched_tasks
	WHERE transaction_temp_id = p_transaction_temp_id
	AND   task_type = wms_globals.g_wms_task_type_putaway;
Line: 2421

   UPDATE mtl_txn_request_lines
     SET backorder_delivery_detail_id = NULL
     , crossdock_type = 1
     , quantity_detailed = (quantity - Nvl(quantity_delivered,0))
     WHERE line_id = p_move_order_line_id;
Line: 2428

   INV_TRX_UTIL_PUB.Delete_transaction
     (x_return_status       => x_return_status,
      x_msg_data            => x_msg_data,
      x_msg_count           => x_msg_count,
      p_transaction_temp_id => p_transaction_temp_id,
      p_update_parent       => FALSE);
Line: 2467

   SELECT mmtt.transaction_source_type_id
     , mmtt.move_order_line_id
     , mtrl.backorder_delivery_detail_id
     INTO l_txn_src_type_id
     , l_move_order_line_id
     , l_backorder_delivery_detail_id
     FROM mtl_material_transactions_temp mmtt
     , mtl_txn_request_lines mtrl
     , mtl_txn_request_headers mtrh
     WHERE mmtt.transaction_temp_id = p_transaction_temp_id
     AND mmtt.move_order_line_id = mtrl.line_id
     AND mtrh.header_id = mtrl.header_id
     AND mtrh.move_order_type = 6
     AND mtrl.line_status = 7;