DBA Data[Home] [Help]

APPS.INV_PICK_RELEASE_PUB SQL Statements

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

Line: 190

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

                  print_debug('return error from update shipping attributes',
                              'Inv_Pick_Release_Pub.Pick_Release');
Line: 204

                  print_debug('return error from update shipping attributes',
                              'Inv_Pick_Release_Pub.Pick_Release');
Line: 210

    l_shipping_attr.DELETE;
Line: 216

all_del_det_bo_tbl.DELETE;
Line: 339

  SELECT mmtt.transaction_temp_id
       , mmtt.subinventory_code
       , mmtt.locator_id
       , mmtt.transfer_to_location
       , mmtt.organization_id
       , wdd.oe_header_id
       , wdd.oe_line_id
       , wdd.customer_id
       , wdd.freight_code
       , wdd.ship_to_location
       , wdd.shipment_priority_code
       , wdd.trip_stop_id
       , wdd.shipping_delivery_id
       , mol.ship_set_id
       , mol.ship_model_id
       , mmtt.parent_line_id
       , mmtt.transfer_subinventory
       , mmtt.project_id
       , mmtt.task_id
       , mmtt.inventory_item_id
       , mmtt.revision
    FROM mtl_material_transactions_temp mmtt,mtl_txn_request_lines mol,wsh_inv_delivery_details_v wdd
   WHERE mmtt.move_order_line_id = mol.line_id
     AND mol.header_id = p_move_order_header_id
     AND wdd.move_order_line_id = mol.line_id
     AND mmtt.pick_slip_number IS NULL;
Line: 368

   SELECT wct.transaction_temp_id
   FROM wms_cartonization_temp wct
   WHERE wct.parent_line_id = wct.transaction_temp_id;   -- only parent lines
Line: 387

          UPDATE mtl_material_transactions_temp
	  SET pick_slip_number = wsh_pick_slip_numbers_s.nextval
	  WHERE transaction_temp_id = mmtt_line.transaction_temp_id;
Line: 405

  SELECT grouping_rule_id,organization_id
  INTO l_grouping_rule_id,l_organization_id
  FROM mtl_txn_request_headers
  WHERE header_id = p_move_order_header_id;
Line: 422

    SELECT pick_slip_rule_id
    INTO l_grouping_rule_id
    FROM wsh_parameters
    WHERE organization_id = l_organization_id;
Line: 441

       UPDATE mtl_material_transactions_temp
	  SET pick_slip_number = wsh_pick_slip_numbers_s.nextval
	WHERE transaction_temp_id = mmtt_line.parent_line_id;
Line: 468

	      SELECT request_number
	      INTO l_request_number
	      FROM mtl_txn_request_headers
	      WHERE header_id = p_move_order_header_id
	      AND organization_id =  mmtt_line.organization_id;
Line: 479

       	      SELECT document_set_id
       		INTO l_report_set_id
       		FROM wsh_picking_batches
       	       WHERE NAME = l_request_number;
Line: 566

	  UPDATE mtl_material_transactions_temp
	     SET pick_slip_number = l_pick_slip_number
	       , transaction_source_id = l_mso_header_id
	       , trx_source_line_id = mmtt_line.oe_line_id
	       , demand_source_header_id = l_mso_header_id
	       , demand_source_line = mmtt_line.oe_line_id
	   WHERE transaction_temp_id = mmtt_line.transaction_temp_id;
Line: 587

              SELECT request_number
	      INTO l_request_number
	      FROM mtl_txn_request_headers
	      WHERE header_id = p_move_order_header_id
	      	AND organization_id = l_organization_id;
Line: 593

	      SELECT document_set_id
		INTO l_report_set_id
		FROM wsh_picking_batches
	       WHERE NAME = l_request_number;
Line: 954

    IS SELECT transaction_temp_id
    FROM mtl_material_transactions_temp
    WHERE move_order_line_id = p_move_order_line_id;
Line: 1145

        print_debug('Item is unit effective. Inserting new line rec',
		    'PICKREL');
Line: 1189

           SELECT revision_qty_control_code, lot_control_code,
                  primary_uom_code, NVL(reservable_type,1)
             INTO l_revision_control_code, l_lot_control_code,
                  l_primary_uom_tbl(l_item_index),
                  l_reservable_type
             FROM mtl_system_items
            WHERE organization_id = l_organization_id
              AND inventory_item_id = l_item_index;
Line: 1276

         SELECT SOURCE_HEADER_ID
           INTO l_OE_HEADER_ID
           FROM wsh_delivery_details
          WHERE move_order_line_id =
                l_qtree_line_tbl(l_qtree_line_index).move_order_line_id
            AND   move_order_line_id is not NULL
            AND released_status = 'S';
Line: 1308

          select t.transaction_source_type_id
            into l_demand_source_type
            from mtl_transaction_types t, mtl_txn_source_types st
           where t.transaction_type_id =
                  l_qtree_line_tbl(l_qtree_line_index).transaction_type_id
             and t.transaction_source_type_id = st.transaction_source_type_id;
Line: 1434

      SELECT print_pick_slip_mode, pick_grouping_rule_id
      INTO l_print_mode, g_org_grouping_rule_id
      FROM WSH_SHIPPING_PARAMETERS
      WHERE organization_id = l_organization_id;
Line: 1541

      l_wdd_index_tbl.DELETE;
Line: 1586

	      SELECT pick_grouping_rule_id
	      INTO l_grouping_rule_id
	      FROM wsh_shipping_parameters
	      WHERE organization_id = l_organization_id;
Line: 1624

         l_qtree_backup_tbl.DELETE;
Line: 1636

         l_qtree_backup_tbl.DELETE;
Line: 1660

         l_qtree_backup_tbl.DELETE;
Line: 1672

         l_qtree_backup_tbl.DELETE;
Line: 1765

	  x_pick_release_status.delete;
Line: 1787

	 --select nvl(sum(transaction_quantity),0)
	 --into l_transaction_quantity
	 --from mtl_material_transactions_Temp
	 --where move_order_line_id = l_mo_line.line_id;
Line: 1803

	 -- Update the move order line to change the requested quantity
	 -- to be equal to the allocated quantity

         -- Get the tolerance set while allocating the line
         -- If quantity is within tolerance then do not backorder shipset
         --
         -- l_lower_tolerance := l_quantity * inv_pick_release_pvt.g_min_tolerance;
Line: 1831

		     print_debug('Update shipping that ship set detailing failed',
				 'Inv_Pick_Release_Pub.Pick_Release');
Line: 1924

		     --delete entry, so we don't restore tree more than once
		     l_qtree_backup_tbl.DELETE(l_tree_id);
Line: 1948

		  --Call Update_Shipping_Attributes to backorder detail line
		  l_shipping_attr(1).source_header_id := l_source_header_id;
Line: 1962

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

			print_debug('return error from update shipping attributes',
				    'Inv_Pick_Release_Pub.Pick_Release');
Line: 1975

			print_debug('return error from update shipping attributes',
				    'Inv_Pick_Release_Pub.Pick_Release');
Line: 1982

		  -- HW INVCONV Update Qty2
		  update mtl_txn_request_lines
		    set  quantity = 0
		    ,quantity_detailed = 0
		    ,secondary_quantity = decode(secondary_quantity,fnd_api.g_miss_num, NULL, 0)
		    ,secondary_quantity_detailed = decode(secondary_quantity_detailed,fnd_api.g_miss_num, NULL, 0)
		    ,line_status = 5
		    where line_id = l_mo_line.line_id;
Line: 1994

		  -- for the last line.  The table gets updated for the last
		  -- line later.
		  -- l_set_index should always be equal to the last line
		  --  in the current ship set, so that the logic at the
		  --  end of the outer loop works correctly.
		  EXIT WHEN l_mo_line_tbl.LAST = l_set_index;
Line: 2007

		  --If next line is for same ship set, update output table
		  l_set_process := l_set_process + 1;
Line: 2035

	       l_qtree_backup_tbl.DELETE;
Line: 2053

		     print_debug('Update shipping that ship model detailing partial',
				 'Inv_Pick_Release_Pub.Pick_Release');
Line: 2107

		  SELECT ordered_quantity, order_quantity_uom
		    INTO l_cur_txn_source_req_qty, l_txn_source_line_uom
		    FROM OE_ORDER_LINES_ALL
		    WHERE line_id = l_cur_txn_source_line_id;
Line: 2204

		     --delete entry, so we don't restore tree more than once
		     l_qtree_backup_tbl.DELETE(l_tree_id);
Line: 2228

			   SELECT ordered_quantity, order_quantity_uom
			     INTO l_set_txn_source_req_qty, l_txn_source_line_uom
			     FROM OE_ORDER_LINES_ALL
			     WHERE line_id = l_set_txn_source_line_id;
Line: 2302

		     --Call Update_Shipping_Attributes to backorder detail line
		     l_shipping_attr(1).source_header_id := l_source_header_id;
Line: 2328

			l_smc_backorder_det_tbl.DELETE;
Line: 2335

			l_smc_backorder_det_tbl.DELETE;
Line: 2339

		     l_smc_backorder_det_tbl.DELETE;
Line: 2342

		     --WSH_INTERFACE.Update_Shipping_Attributes
		     --(p_source_code               => 'INV',
		     --p_changed_attributes        => l_shipping_attr,
		     --x_return_status             => l_api_return_status
		     --);
Line: 2352

		  -- Update mo line with new quantity and model quantity;
Line: 2355

		     update mtl_txn_request_lines
		       set  quantity = 0
		       ,quantity_detailed = 0
		       ,line_status = 5
		       ,model_quantity = l_new_model_quantity
		       where line_id = l_mo_line.line_id;
Line: 2364

		     update mtl_txn_request_lines
		       set  quantity = l_new_line_quantity
		       ,quantity_detailed = NULL
		       ,model_quantity = l_new_model_quantity
		       where line_id = l_mo_line.line_id;
Line: 2385

		  -- for the last line.  The table gets updated for the last
		  -- line later.
		  -- l_set_index should always be equal to the last line
		  --  in the current ship set, so that the logic at the
		  --  end of the outer loop works correctly.
		  EXIT WHEN l_mo_line_tbl.LAST = l_set_index;
Line: 2398

		  -- Only update status table if model_quantity = 0;
Line: 2404

		  -- We have to update the status now.
		  if l_new_model_quantity = 0 then

		     --If next line is for same ship set, update output table
		     l_set_process := l_set_process + 1;
Line: 2428

	       l_qtree_backup_tbl.DELETE;
Line: 2496

	       -- new logic to support crossdocking.  The WDD record needs to be split or updated
	       -- properly so we can still try to allocate material through crossdocking later.
	       -- {{
	       -- Run PR in Prioritize INV mode and ensure that one WDD
	       -- does not get allocated at all. That WDD should get
	       -- x-docked and later deliveries created for same.
	       -- }}
	       -- {{
	       -- Run PR in Prioritize INV mode and ensure that one WDD
	       -- gets partially allocated. That WDD should get split &
	       -- x-docked and later deliveries created for the new WDD.
	       -- Also ensure that the original WDD has the correct qty.
	       -- }}
	       IF (l_allocation_method = g_prioritize_inventory) AND (p_wsh_release_table.COUNT > 0) THEN
		  IF (l_transaction_quantity = 0) THEN


		     -- Move order line is not allocated at all.
		     -- Do not backorder the current WDD line yet since crossdocking can still
		     -- potentially allocate material for this.  Update the WDD record to null
		     -- out the move_order_line_id column and reset the released_status to the
		     -- original value from the corresponding record in p_wsh_release_table.


		     -- R12.1 replenishment Project 6681109/6710368
		     -- changes based ON p_dynamic_replenishment
		     IF (is_debug) THEN
			print_debug('p_dynamic_replenishment :'||p_dynamic_replenishment,
				    'INV_Pick_Release_Pub.Pick_Release');
Line: 2541

			l_in_rec.action_code := 'UPDATE';
Line: 2553

			l_in_rec.action_code := 'UPDATE';
Line: 2557

		     WSH_INTERFACE_EXT_GRP.Create_Update_Delivery_Detail
		       (p_api_version_number  => 1.0,
			p_init_msg_list       => fnd_api.g_false,
			p_commit              => fnd_api.g_false,
			x_return_status       => l_api_return_status,
			x_msg_count           => x_msg_count,
			x_msg_data            => x_msg_data,
			p_detail_info_tab     => l_detail_info_tab,
			p_in_rec              => l_in_rec,
			x_out_rec             => l_out_rec
			);
Line: 2571

			   print_debug('Error returned from Create_Update_Delivery_Detail API',
				       'Inv_Pick_Release_Pub.Pick_Release');
Line: 2577

			   print_debug('Unexpected errror from Create_Update_Delivery_Detail API',
				       'Inv_Pick_Release_Pub.Pick_Release');
Line: 2626

		     -- Update the split WDD line for the unallocated quantity to null out the
		     -- move_order_line_id column and reset the released_status to the original
		     -- value in the corresponding WDD record (original one) in p_wsh_release_table
		     l_detail_info_tab(1).delivery_detail_id := l_split_delivery_detail_id;
Line: 2652

		     l_in_rec.action_code := 'UPDATE';
Line: 2654

		     WSH_INTERFACE_EXT_GRP.Create_Update_Delivery_Detail
		       (p_api_version_number  => 1.0,
			p_init_msg_list       => fnd_api.g_false,
			p_commit              => fnd_api.g_false,
			x_return_status       => l_api_return_status,
			x_msg_count           => x_msg_count,
			x_msg_data            => x_msg_data,
			p_detail_info_tab     => l_detail_info_tab,
			p_in_rec              => l_in_rec,
			x_out_rec             => l_out_rec
			);
Line: 2668

			   print_debug('Error returned from Create_Update_Delivery_Detail API',
				       'Inv_Pick_Release_Pub.Pick_Release');
Line: 2674

			   print_debug('Unexpected errror from Create_Update_Delivery_Detail API',
				       'Inv_Pick_Release_Pub.Pick_Release');
Line: 2680

		     -- Insert the split WDD line into p_wsh_release_table.
		     -- The split WDD release record should be the same as the original one with
		     -- only the following fields modified: delivery_detail_id, move_order_line_id
		     -- replenishment_status, and requested_quantity fields
		     l_split_wdd_rel_rec := p_wsh_release_table(l_wdd_index_tbl(l_delivery_detail_id));
Line: 2696

		     -- Insert a new record into p_trolin_delivery_ids and p_del_detail_id
		     -- for the split WDD line created.
		     -- UPDATE: Do not need to do this anymore.  The delivery tables passed in by
		     -- Shipping are used for storing crossdocked WDD lines.  If this split line
		     -- is later allocated from Crossdocking, the crossdock API will insert them
		     -- into the delivery tables.
		     /*l_xdock_index := NVL(p_del_detail_id.LAST, 0) + 1;
Line: 2706

		     -- Update the original WDD line in p_wsh_release_table with
		     -- released_status = 'S' and the corresponding allocated quantity
		     l_xdock_index := l_wdd_index_tbl(l_delivery_detail_id);
Line: 2730

		  --Note: Inside the API Update_Shipping_Attributes, wdd is split and qty are backordered
		  --in case action_flag is 'B'.  Backorder qty is passed
		  --from INV as cycle_count_quantity below and requested qty is obtained from WDD table by
		  --shipping. Now in case of 'R', shipping team will make change
		  -- to mark those lines as Replenishment Requested instead of backordering them

		  IF NVL(p_dynamic_replenishment,'N') = 'Y'  THEN
		     IF is_debug THEN
			print_debug('Marking line status as RR',
				    'Inv_Pick_Release_Pub.Pick_Release');
Line: 2752

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

			print_debug('return error from update shipping attributes',
				    'Inv_Pick_Release_Pub.Pick_Release');
Line: 2765

			print_debug('return error from update shipping attributes',
				    'Inv_Pick_Release_Pub.Pick_Release');
Line: 2773

	       -- Update the current move order line depending on how much quantity
	       -- was successfully allocated from inventory.
	       IF (l_transaction_quantity = 0) THEN
		  -- Close the move order line created since no quantity was allocated
		  UPDATE mtl_txn_request_lines
		    SET line_status = 5,
		    quantity = l_transaction_quantity,
		    secondary_quantity = DECODE(secondary_quantity, fnd_api.g_miss_num, NULL,
						l_transaction_quantity2)
		    WHERE line_id = l_mo_line.line_id;
Line: 2792

		     -- UPDATE: Do not need to do this anymore.  The delivery tables inputted from
		     -- Shipping are used only to store crossdocked WDD lines.  They will be
		     -- empty initially.  Instead, set the released_status for the line to be 'B'
		     -- in the inputted release table.
		     --l_backordered_wdd_tbl(l_delivery_detail_id) := TRUE;
Line: 2800

		  -- Update the move order line to the partial quantity that was allocated
		  UPDATE mtl_txn_request_lines
		    SET quantity = l_transaction_quantity,
		    secondary_quantity = DECODE(secondary_quantity, fnd_api.g_miss_num, NULL,
						l_transaction_quantity2)
		    WHERE line_id = l_mo_line.line_id;
Line: 2810

	    -- Bug# 4258360: If allocation mode = N (Prioritize Inventory), we need to update
	    -- the corresponding WDD record in p_wsh_release_table to a released_status of 'S'.
	    -- This is so the crossdock API (which will be called later on) knows the WDD record has
	    -- been fully allocated already.  This is added for the R12 Planned Crossdocking project.
	    -- {{
	    -- Run PR in prioritize INV mode and ensure entire WDD
	    -- gets allocated. That WDD should not be re-allocated for
	    -- x-docking.
	    -- }}
	    IF (l_allocation_method = g_prioritize_inventory) THEN
	       -- Retrieve the WDD record associated with the current MOL
	       IF (NOT INV_CACHE.set_wdd_rec(l_mo_line.line_id)) THEN
		  IF (is_debug) THEN
		     print_debug('Error setting cache for WDD delivery line',
				 'INV_Pick_Release_Pub.Pick_Release');
Line: 2830

	       -- Update WDD record in release table with a released status of 'S'
               IF (p_wsh_release_table.COUNT > 0) THEN
	          p_wsh_release_table(l_wdd_index_tbl(l_delivery_detail_id)).released_status := 'S';
Line: 2899

        DELETE FROM mtl_txn_request_lines  mtrl
         WHERE line_status = 5
           AND line_id = l_mol_id_tbl(ii)
           AND EXISTS
             ( SELECT 'x'
                 FROM mtl_system_items  msi
                WHERE msi.organization_id = mtrl.organization_id
                  AND msi.inventory_item_id = mtrl.inventory_item_id
                  AND NVL(msi.reservable_type,1) = 1
             );
Line: 3127

			SELECT count (*) into honor_case_pick_count
			FROM mtl_material_transactions_temp mmtt, wms_user_task_type_attributes wutta
			WHERE mmtt.standard_operation_id = wutta.user_task_type_id
			AND mmtt.organization_id = wutta.organization_id
			AND mmtt.transaction_temp_id = l_transaction_id(b)
			AND honor_case_pick_flag = 'Y';
Line: 3259

	    p_del_detail_id.DELETE(l_xdock_index);
Line: 3260

	    p_trolin_delivery_ids.DELETE(l_xdock_index);
Line: 3455

					-- to or updated
      l_mso_header_id		NUMBER; -- The header ID for the record in
Line: 3734

      SELECT print_pick_slip_mode, pick_grouping_rule_id
      INTO l_print_mode, g_org_grouping_rule_id
      FROM WSH_SHIPPING_PARAMETERS
      WHERE organization_id = p_org_id;