DBA Data[Home] [Help]

APPS.GME_PENDING_PRODUCT_LOTS_PVT SQL Statements

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

Line: 14

/*  Procedure relieve_pending_lots modified to delete the pending lots if transacting qty >=     */
/*  pending lot qty                                                                              */
/* Namit Singhi Bug#5689035. Added procedure get_pnd_prod_lot_qty				 */

/* G. Muratore    Bug 6941158  07-APR-2008                                                       */
/*      Initialized origination type to '1' (for production) before calling INV api to           */
/*      create the lot. PROCEDURE: create_product_lot                                            */
/* K.Swapna Bug#7139549 26-JUN-2008                                                              */
/*    The expiration date is not assigned to the pending product                                 */
/*    lot created when the item's expiration control is by shelf days.                           */
/*     create_product_lot procedure is change.                                                   */
/*************************************************************************************************/

  PROCEDURE get_pending_lot
              (p_material_detail_id       IN  NUMBER
              ,x_return_status            OUT NOCOPY VARCHAR2
              ,x_pending_product_lot_tbl  OUT NOCOPY gme_common_pvt.pending_lots_tab) IS

    CURSOR cur_get_lots (v_mtl_dtl_id NUMBER) IS
    SELECT *
      FROM gme_pending_product_lots
     WHERE material_detail_id = v_mtl_dtl_id
     ORDER BY sequence asc, lot_number asc;
Line: 68

    SELECT quantity, secondary_quantity
      FROM gme_pending_product_lots
     WHERE pending_product_lot_id = v_pending_lot_id;
Line: 78

    error_delete_row             EXCEPTION;
Line: 91

      /* Bug#5186388 if transacting qty is greater than pending lot qty then delete the lot
         rather than updating to zero */
      l_pending_product_lots_rec.pending_product_lot_id := p_pending_lot_id;
Line: 94

      delete_pending_product_lot( p_pending_product_lots_rec => l_pending_product_lots_rec
                                 ,x_return_status            => l_return_status
				);
Line: 98

        RAISE error_delete_row;
Line: 101

      /*UPDATE gme_pending_product_lots
         SET quantity = 0,
             last_updated_by = gme_common_pvt.g_user_ident,
             last_update_date = gme_common_pvt.g_timestamp,
             last_update_login = gme_common_pvt.g_login_id
       WHERE pending_product_lot_id = p_pending_lot_id;
Line: 109

        UPDATE gme_pending_product_lots
           SET secondary_quantity = 0
         WHERE pending_product_lot_id = p_pending_lot_id;
Line: 114

      UPDATE gme_pending_product_lots
         SET quantity = quantity - p_quantity,
             last_updated_by = gme_common_pvt.g_user_ident,
             last_update_date = gme_common_pvt.g_timestamp,
             last_update_login = gme_common_pvt.g_login_id
       WHERE pending_product_lot_id = p_pending_lot_id;
Line: 122

        UPDATE gme_pending_product_lots
           SET secondary_quantity = secondary_quantity - p_secondary_quantity
         WHERE pending_product_lot_id = p_pending_lot_id;
Line: 133

    WHEN ERROR_DELETE_ROW THEN
      x_return_status := l_return_status;
Line: 181

      SELECT msi.shelf_life_code, msi.shelf_life_days
      FROM mtl_system_items msi
      WHERE msi.inventory_item_id = p_inventory_item_id
      AND    msi.organization_id = p_organization_id;
Line: 399

    error_insert_row         EXCEPTION;
Line: 410

    IF NOT gme_pending_product_lots_dbl.insert_row
             (p_pending_product_lots_rec    => p_pending_product_lots_rec
             ,x_pending_product_lots_rec    => l_pp_lot_rec) THEN
      RAISE error_insert_row;
Line: 423

    WHEN  error_insert_row THEN
      gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);
Line: 434

  PROCEDURE update_pending_product_lot
    (p_pending_product_lots_rec   IN  gme_pending_product_lots%ROWTYPE
    ,x_pending_product_lots_rec   OUT NOCOPY  gme_pending_product_lots%ROWTYPE
    ,x_return_status              OUT NOCOPY VARCHAR2) IS

    error_update_row         EXCEPTION;
Line: 441

    l_api_name     CONSTANT  VARCHAR2 (30)      := 'update_pending_product_lot';
Line: 450

    IF NOT gme_pending_product_lots_dbl.update_row
             (p_pending_product_lots_rec    => p_pending_product_lots_rec) THEN
      RAISE error_update_row;
Line: 466

    WHEN error_update_row OR error_fetch_row THEN
      -- error message set in fetch routine
      x_return_status := fnd_api.g_ret_sts_unexp_error;
Line: 475

  END update_pending_product_lot;
Line: 477

  PROCEDURE delete_pending_product_lot
    (p_pending_product_lots_rec   IN  gme_pending_product_lots%ROWTYPE
    ,x_return_status              OUT NOCOPY VARCHAR2) IS

    error_delete_row         EXCEPTION;
Line: 482

    l_api_name     CONSTANT  VARCHAR2 (30)      := 'delete_pending_product_lot';
Line: 491

    IF NOT gme_pending_product_lots_dbl.delete_row
             (p_pending_product_lots_rec    => p_pending_product_lots_rec) THEN
      RAISE error_delete_row;
Line: 501

    WHEN  error_delete_row THEN
      gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);
Line: 510

  END delete_pending_product_lot;
Line: 513

  PROCEDURE delete_pending_product_lot
    (p_material_detail_id         IN  NUMBER
    ,x_return_status              OUT NOCOPY VARCHAR2)
  IS
    CURSOR c_get_pending_lots IS
      SELECT pending_product_lot_id
        FROM gme_pending_product_lots
       WHERE material_detail_id = p_material_detail_id;
Line: 522

    l_api_name     CONSTANT  VARCHAR2 (30)      := 'delete_pending_product_lot';
Line: 525

    error_delete_row         EXCEPTION;
Line: 538

       IF NOT gme_pending_product_lots_dbl.delete_row
                         (p_pending_product_lots_rec    => l_pending_product_lots_rec) THEN
          CLOSE c_get_pending_lots;
Line: 541

	  RAISE error_delete_row;
Line: 552

    WHEN  error_delete_row THEN
      gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);
Line: 561

  END delete_pending_product_lot;
Line: 600

    IF p_batch_header_rec.update_inventory_ind = 'N' THEN
      IF p_material_detail_rec.line_type <> gme_common_pvt.g_line_type_ing THEN
        gme_common_pvt.log_message('GME_NO_LOT_CREATE');
Line: 632

    SELECT max(sequence)
    FROM   gme_pending_product_lots
    WHERE  material_detail_id = v_dtl_id;
Line: 829

    LAST_UPDATE_DATE
    LAST_UPDATED_BY
    LAST_UPDATE_LOGIN
     */

    IF g_debug <= gme_debug.g_log_procedure THEN
      gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
Line: 849

  PROCEDURE validate_material_for_update
                        (p_batch_header_rec          IN gme_batch_header%ROWTYPE
                        ,p_material_detail_rec       IN gme_material_details%ROWTYPE
                        ,x_return_status             OUT NOCOPY VARCHAR2) IS

    l_api_name     CONSTANT  VARCHAR2 (30)      := 'validate_material_for_update';
Line: 874

  END validate_material_for_update;
Line: 876

  PROCEDURE validate_record_for_update
                        (p_material_detail_rec             IN gme_material_details%ROWTYPE
                        ,p_db_pending_product_lots_rec     IN gme_pending_product_lots%ROWTYPE
                        ,p_pending_product_lots_rec        IN gme_pending_product_lots%ROWTYPE
                        ,x_pending_product_lots_rec        OUT NOCOPY gme_pending_product_lots%ROWTYPE
                        ,x_return_status                   OUT NOCOPY VARCHAR2) IS

    l_api_name     CONSTANT  VARCHAR2 (30)      := 'validate_record_for_update';
Line: 931

    x_pending_product_lots_rec.last_update_date := l_db_pending_product_lots_rec.last_update_date;
Line: 932

    x_pending_product_lots_rec.last_update_login := l_db_pending_product_lots_rec.last_update_login;
Line: 933

    x_pending_product_lots_rec.last_updated_by := l_db_pending_product_lots_rec.last_updated_by;
Line: 1090

  END validate_record_for_update;
Line: 1092

  PROCEDURE validate_material_for_delete
                        (p_batch_header_rec          IN gme_batch_header%ROWTYPE
                        ,p_material_detail_rec       IN gme_material_details%ROWTYPE
                        ,x_return_status             OUT NOCOPY VARCHAR2) IS

    l_api_name     CONSTANT  VARCHAR2 (30)      := 'validate_material_for_delete';
Line: 1117

  END validate_material_for_delete;
Line: 1119

  PROCEDURE validate_record_for_delete
                        (p_material_detail_rec             IN gme_material_details%ROWTYPE
                        ,p_db_pending_product_lots_rec     IN gme_pending_product_lots%ROWTYPE
                        ,p_pending_product_lots_rec        IN gme_pending_product_lots%ROWTYPE
                        ,x_pending_product_lots_rec        OUT NOCOPY gme_pending_product_lots%ROWTYPE
                        ,x_return_status                   OUT NOCOPY VARCHAR2) IS

    l_api_name     CONSTANT  VARCHAR2 (30)      := 'validate_record_for_delete';
Line: 1167

  END validate_record_for_delete;
Line: 1193

    SELECT primary_uom_code, secondary_uom_code
      FROM mtl_system_items_b
     WHERE inventory_item_id = v_item_id
       AND organization_id = v_org_id;
Line: 1333

    SELECT count( 1 )
    FROM   mtl_lot_numbers
    WHERE  inventory_item_id = v_item_id
    AND    organization_id = v_org_id
    AND    lot_number = v_lot_no;
Line: 1389

      SELECT 1
      FROM   gme_pending_product_lots
      WHERE  material_detail_id = v_matl_dtl_id
      AND    sequence = v_sequ;
Line: 1498

      SELECT count(1)
      FROM  mtl_transaction_reasons
      WHERE reason_id = v_reason_id
      AND   NVL (disable_date, SYSDATE + 1) > SYSDATE;
Line: 1552

      SELECT 1
      FROM  gme_pending_product_lots
      WHERE batch_id = v_batch_id
      AND   material_detail_id = v_matl_dtl_id
      AND   quantity <> 0
      AND   rownum = 1;