DBA Data[Home] [Help]

APPS.GMI_RESERVATION_PVT SQL Statements

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

Line: 17

 | - Update_Reservation                                                    |
 | - Delete_Reservation                                                    |
 | - Transfer_Reservation                                                  |
 | - Check_Shipping_Details                                                |
 | - Calculate_Prior_Reservations
 |                                                                         |
 | HISTORY                                                                 |
 | 21-feb-2000 odaboval             Created                                |
 |  7-Nov-2000 odaboval, B1479751 : Added the test and a  message.         |
 | 28-Nov-2000 odaboval, B1504749 : in Query_reservation, swapped columns  |
 |             staged_ind with event_id.                                   |
 | 24-AUG-2001 NC Added line_detail_id in the SELECT in Query_Reservation  |
 |             Bug#1675561                                                 |
 | 03-OCT-2001  odaboval, local fix for bug 2025611                        |
 |                        added procedure Check_Shipping_Details           |
 | 24-JAN-2002 plowe --   added rounding fix for query_reservation so that |
 |                        reserved quantity rounding for recurring decimals|
 |                        uses GMI: EPSILON for decimal precision rounding |
 |                        in case where primary item UOM is different to   |
 |                        ordered quantity UOM.                            |
 | 13-JAN-2003  NC  - Added procedure Calculate_prior_reservations.        |
 |                    for prior reservations project. Bug#2670928          |
 | 23-MAR-2004  P.Raghu  Bug#3411704                                       |
 |                       Modified procedure Update_Reservation such that   |
 |                       reserved quantity is calculated if it is equal to |
 |                       FND_API.G_MISS_NUM.                               |
 +========================================================================+
  API Name  : GMI_Reservation_PVT
  Type      : Private - Package Body
  Function  : This package contains Private procedures used to
              OPM reservation process.
 -
  Pre-reqs  : N/A
  Parameters: Per function

  Current Vers  : 1.0
*/


/*  Global variables */
G_PKG_NAME      CONSTANT  VARCHAR2(30):='GMI_Reservation_PVT';
Line: 200

           SELECT   trans_id
                  , item_id
                  , line_id
                  , co_code
                  , orgn_code
                  , whse_code
                  , lot_id
                  , location
                  , doc_id
                  , doc_type
                  , doc_line
                  , line_type
                  , reason_code
                  , trans_date
                  , trans_qty
                  , trans_qty2
                  , qc_grade
                  , NULL         /*  lot no  */
                  , NULL         /*  sublot no  */
                  , lot_status
                  , trans_stat
                  , trans_um
                  , trans_um2
                  , staged_ind
                  , event_id
                  , text_code
                  , NULL      /*  user id  */
                  , NULL      /*  create_lot_index  */
                  , NULL      /*  non_inv field */
                  , line_detail_id
                 FROM ic_tran_pnd
                 WHERE doc_type ='OMSO'
                 AND   delete_mark = 0
                 AND   completed_ind = 0
                 AND   line_id = p_query_input.demand_source_line_id
                 ORDER BY lot_id DESC;
Line: 506

    select loct_ctl
    from ic_whse_mst
    where whse_code = l_allocation_rec.whse_code;
Line: 511

 SELECT SUM(ABS(trans_qty))
 FROM   ic_tran_pnd
 WHERE  line_id       = p_rsv_rec.demand_source_line_id
 AND    doc_type      = 'OMSO'
 AND    staged_ind    = 0
 AND    completed_ind = 0
 AND    lot_id <> 0
 AND    delete_mark   = 0;
Line: 730

       GMI_reservation_Util.PrintLn('(opm_dbg) in PVT c before Create_Default_Lot orgn_code='||l_orgn_code||', trans_id(if not null then UPDATE default_lot)='||l_trans_id);
Line: 751

       GMI_reservation_Util.PrintLn('(opm_dbg) in PVT c DefaultLot already exist NO Error (Going to update the default lot transaction).');
Line: 781

                GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d ERROR: Returned by Update_Transaction() updating the default record.');
Line: 783

                FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION');
Line: 784

                FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
Line: 932

 |    Update_Reservation                                                    |
 |                                                                          |
 | TYPE                                                                     |
 |    Global                                                                |
 |                                                                          |
 | USAGE                                                                    |
 |   Update reservation by calling OPM_Allocation manager.                  |
 |                                                                          |
 | DESCRIPTION                                                              |
 |   Update reservation by calling OPM_Allocation manager.                  |
 |                                                                          |
 | PARAMETERS                                                               |
 |    p_init_msg_lst              IN  VARCHAR2     - Msg init               |
 |    x_return_status             OUT VARCHAR2     - Return Status          |
 |    x_msg_count                 OUT NUMBER       -                        |
 |    x_msg_data                  OUT VARCHAR2     -                        |
 |    p_validation_flag           IN  VARCHAR2     -                        |
 |    p_original_rsv_rec          IN  rec_type     -                        |
 |    p_to_rsv_rec                IN  rec_type     -                        |
 |    p_serial_number             IN  rec_type     -                        |
 |    x_serial_number             OUT rec_type     -                        |
 |                                                                          |
 | RETURNS                                                                  |
 |    None                                                                  |
 |                                                                          |
 | HISTORY                                                                  |
 |     21-FEB-2000  odaboval        Created                                 |
 |     23-MAR-2004  P.Raghu  Bug#3411704                                    |
 |                           Reserved quantity is calculated correctly if it|
 |                           is equal to FND_API.G_MISS_NUM.                |
 |                                                                          |
 +==========================================================================+
  Api end of comments
*/
PROCEDURE Update_Reservation
  (
     x_return_status                 OUT NOCOPY VARCHAR2
   , x_msg_count                     OUT NOCOPY NUMBER
   , x_msg_data                      OUT NOCOPY VARCHAR2
   , p_validation_flag               IN  VARCHAR2 DEFAULT fnd_api.g_true
   , p_original_rsv_rec              IN  inv_reservation_global.mtl_reservation_rec_type
   , p_to_rsv_rec                    IN  inv_reservation_global.mtl_reservation_rec_type
   , p_original_serial_number        IN  inv_reservation_global.serial_number_tbl_type
   , p_to_serial_number              IN  inv_reservation_global.serial_number_tbl_type
   ) IS

  l_commit                        VARCHAR2(5) := fnd_api.g_false;
Line: 980

  l_api_name                      CONSTANT VARCHAR2(30) := 'Update_Reservation';
Line: 1012

/*   GMI_Reservation_Util.Validation_before_Update(
           p_mtl_rsv_rec   => p_to_rsv_rec
          ,x_ic_tran_rec   => l_ic_tran_rec_out
          ,x_orgn_code     => x_orgn_code
          ,x_return_status => x_return_status
          ,x_msg_count     => x_msg_count
          ,x_msg_data      => x_msg_data);
Line: 1020

     GMI_reservation_Util.PrintLn('(opm_dbg) in PVT u : Error Returned by Validation_before_Update');
Line: 1021

     FND_MESSAGE.SET_NAME('GMI','ERROR_IN_VALIDATION_BEFORE_UPDATE');
Line: 1051

   FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1063

   FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1082

    FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1113

         FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1164

       FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1208

/*      Update the default_lot with Delta*/
/*  else*/
/*      if NewQty > OldQty*/
/*      then*/
/*          Update the default_lot with Delta*/
/*      else*/
/*          Delete the Allocated lot*/
/*          and */
/*          Update the default_lot with Delta*/
/*  endif*/
/*  endif*/
/* ======================================================= */
/*  Beginning of the process*/
/* =======================================================*/
/* bug 2240221*/
IF p_to_rsv_rec.requirement_date <> FND_API.G_MISS_DATE THEN
  l_default_tran_rec.trans_date := p_to_rsv_rec.requirement_date;
Line: 1233

    GMI_reservation_Util.PrintLn('(opm_dbg)in PVT u: Update PRIM  default Lot  to:' || l_default_tran_rec.trans_qty );
Line: 1234

    GMI_reservation_Util.PrintLn('(opm_dbg)in PVT u: Update SECO default Lot  to:' || l_default_tran_rec.trans_qty2 );
Line: 1235

    GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION(
             p_api_version      => 1.0
            ,p_init_msg_list    => fnd_api.g_false
            ,p_commit           => l_commit
            ,p_validation_level => l_validation_level
            ,p_tran_rec         => l_default_tran_rec
            ,x_tran_row         => l_temp_tran_row
            ,x_return_status    => x_return_status
            ,x_msg_count        => x_msg_count
            ,x_msg_data         => x_msg_data);
Line: 1247

      GMI_reservation_Util.PrintLn('(opm_dbg) in PVT u: Error returned by GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION.');
Line: 1249

      FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION');
Line: 1250

      FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1260

        /*  Here we have to update the default_lot, only.*/

       l_default_tran_rec.trans_qty := -1 * (ABS(l_default_tran_rec.trans_qty)                                         + ABS(l_new_rsv_to_item_um_qty));
Line: 1267

        GMI_reservation_Util.PrintLn('(opm_dbg) in PVT u: Update default row trans_qty to '|| l_default_tran_rec.trans_qty);
Line: 1268

        GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION(
                           p_api_version      => 1.0
                          ,p_init_msg_list    => fnd_api.g_false
                          ,p_commit           => l_commit
                          ,p_validation_level => l_validation_level
                          ,p_tran_rec         => l_default_tran_rec
                          ,x_tran_row         => l_temp_tran_row
                          ,x_return_status    => x_return_status
                          ,x_msg_count        => x_msg_count
                          ,x_msg_data         => x_msg_data);
Line: 1280

           GMI_reservation_Util.PrintLn('(opm_dbg) in PVT u: Error returned by GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION.');
Line: 1282

           FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION');
Line: 1283

           FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1289

        /*  Otherwise call opm delete reservation to remove old allocation*/
        /*  -------------------------------------------------------------------- */
        GMI_reservation_Util.PrintLn('(opm_dbg) in UpdateReserv: The new rsv qty is smaller than the default qty.' );
Line: 1292

        GMI_reservation_Util.PrintLn('(opm_dbg) in UpdateReserv: We must delete the old reservation.' );
Line: 1298

        /*  Delete the record since it is not the default record*/
        GMI_reservation_Util.PrintLn('(opm_dbg) in PVT u: Deleting transaction record res_id='||p_original_rsv_rec.reservation_id);
Line: 1302

        GMI_TRANS_ENGINE_PUB.DELETE_PENDING_TRANSACTION(
                              p_api_version      => 1.0
                             ,p_init_msg_list    => fnd_api.g_false
                             ,p_commit           => l_commit
                             ,p_validation_level => l_validation_level
                             ,p_tran_rec         => l_original_tran_rec
                             ,x_tran_row         => l_temp_tran_row
                             ,x_return_status    => x_return_status
                             ,x_msg_count        => x_msg_count
                             ,x_msg_data         => x_msg_data);
Line: 1314

            GMI_reservation_Util.PrintLn('(opm_dbg) in PVT u: ERROR Returned by Delete_Transaction().');
Line: 1316

            FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.DELETE_PENDING_TRANSACTION');
Line: 1317

            FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1322

        GMI_reservation_Util.PrintLn('(opm_dbg) in PVT u: After DELETE_PENDING_TRANSACTION.');
Line: 1324

        /*  Transfer the deleted qties to the default_lot + new requested Values.*/
        l_default_tran_rec.trans_qty := -1 * (ABS(l_default_tran_rec.trans_qty)                                          + ABS(l_new_rsv_to_item_um_qty));
Line: 1330

        /*  Using the modified copy update the default record by calling the transaction engine*/
        GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION(
                       p_api_version       => 1.0
                      ,p_init_msg_list     => fnd_api.g_false
                      ,p_commit            => l_commit
                      ,p_validation_level  => l_validation_level
                      ,p_tran_rec          => l_default_tran_rec
                      ,x_tran_row          => l_temp_tran_row
                      ,x_return_status     => x_return_status
                      ,x_msg_count         => x_msg_count
                      ,x_msg_data          => x_msg_data);
Line: 1343

              GMI_reservation_Util.PrintLn('(opm_dbg) in PVT u: ERROR Returned by Update_Pending_Transaction updating the default record.');
Line: 1345

              FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION');
Line: 1346

              FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1379

/*     FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');*/
Line: 1391

    FND_MESSAGE.Set_Token('WHERE', 'Update_Reservation');
Line: 1426

END Update_Reservation;
Line: 1433

 |    Delete_Reservation                                                    |
 |                                                                          |
 | TYPE                                                                     |
 |    Global                                                                |
 |                                                                          |
 | USAGE                                                                    |
 |   Delete reservation by calling OPM_Allocation manager.                  |
 |                                                                          |
 | DESCRIPTION                                                              |
 |   Delete reservation by calling OPM_Allocation manager.                  |
 |                                                                          |
 | PARAMETERS                                                               |
 |    x_return_status             OUT VARCHAR2     - Return Status          |
 |    x_msg_count                 OUT NUMBER       -                        |
 |    x_msg_data                  OUT VARCHAR2     -                        |
 |    p_validation_flag           IN  VARCHAR2     -                        |
 |    p_rsv_rec                   IN  rec_type     -                        |
 |    p_serial_number             IN  rec_type     -                        |
 |                                                                          |
 | RETURNS                                                                  |
 |    None                                                                  |
 |                                                                          |
 | HISTORY                                                                  |
 |     21-FEB-2000  odaboval        Created                                 |
 |                                                                          |
 +==========================================================================+
  Api end of comments
*/
PROCEDURE Delete_Reservation
  (
     x_return_status            OUT NOCOPY VARCHAR2
   , x_msg_count                OUT NOCOPY NUMBER
   , x_msg_data                 OUT NOCOPY VARCHAR2
   , p_validation_flag          IN  VARCHAR2 DEFAULT fnd_api.g_true
   , p_rsv_rec                  IN  inv_reservation_global.mtl_reservation_rec_type
   , p_serial_number            IN  inv_reservation_global.serial_number_tbl_type
   ) IS

  l_api_name           CONSTANT VARCHAR2 (30) := 'Delete_Reservation';
Line: 1476

  l_tran_to_delete_rec          GMI_TRANS_ENGINE_PUB.ictran_rec;
Line: 1490

  Select ship_from_org_id
    From oe_order_lines_all
   Where line_id = l_line_id;
Line: 1495

  Select whse_code
    From ic_whse_mst
   Where mtl_organization_id = l_organization_id;
Line: 1504

  GMI_reservation_Util.PrintLn('(opm_dbg) in proc OPM_Reservation_PVT.OPM_Delete_reservation ');
Line: 1537

        GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d ERROR: No records found to delete.');
Line: 1540

        FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
Line: 1553

     GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d ERROR: No records found to delete.');
Line: 1556

     FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
Line: 1564

     /*  If the record is not the default record then just delete the record*/

       GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d: deleting allocation.');
Line: 1580

         FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
Line: 1588

          /*  Save a copy of the record to be deleted*/
          l_tran_to_delete_rec := GMI_Reservation_Util.ic_tran_rec_tbl(l_allocated_lot_index);
Line: 1592

          /*  l_tran_to_delete_rec.non_inv := 0;*/
Line: 1593

          /*  Delete the record since it is not the default record*/
          GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d: Deleting transaction record res_id='||p_rsv_rec.reservation_id||', trans_id='||GMI_Reservation_Util.ic_tran_rec_tbl(l_allocated_lot_index).trans_id );
Line: 1596

          GMI_TRANS_ENGINE_PUB.DELETE_PENDING_TRANSACTION(
                                p_api_version      => 1.0
                               ,p_init_msg_list    => fnd_api.g_false
                               ,p_commit           => l_commit
                               ,p_validation_level => l_validation_level
                               ,p_tran_rec         => l_tran_to_delete_rec
                               ,x_tran_row         => l_temp_tran_row
                               ,x_return_status    => x_return_status
                               ,x_msg_count        => x_msg_count
                               ,x_msg_data         => x_msg_data);
Line: 1607

          GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d After DELETE_PENDING_TRANSACTION.');
Line: 1611

              GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d ERROR: Returned by Delete_Transaction().');
Line: 1613

              FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.DELETE_PENDING_TRANSACTION');
Line: 1614

              FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
Line: 1621

       GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d: Qties to update: qty=='||l_default_tran_rec.trans_qty||', qty2='||l_default_tran_rec.trans_qty2);
Line: 1632

            GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d ERROR: Returned by Update_Transaction() updating the default record.');
Line: 1634

            FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION');
Line: 1635

            FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
Line: 1672

            FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
Line: 1678

          /*  If the record is the default record then don't delete it just set the quantity to zero*/
         l_default_tran_rec.trans_qty  := 0 ;
Line: 1682

         GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION(
                           p_api_version       => 1.0
                          ,p_init_msg_list     => fnd_api.g_false
                          ,p_commit            => l_commit
                          ,p_validation_level  => l_validation_level
                          ,p_tran_rec          => l_default_tran_rec
                          ,x_tran_row          => l_temp_tran_row
                          ,x_return_status     => x_return_status
                          ,x_msg_count         => x_msg_count
                          ,x_msg_data          => x_msg_data);
Line: 1694

            GMI_reservation_Util.PrintLn('(opm_dbg) in PVT d ERROR: Returned by Update_Transaction() updating the default record.');
Line: 1696

            FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION');
Line: 1697

            FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
Line: 1745

END Delete_Reservation;
Line: 1930

   SELECT SUM(nvl(s.onhand_order_qty,0)),
          SUM(nvl(s.onhand_order_qty2,0)),
          SUM(nvl(s.committedsales_qty,0)),
          SUM(nvl(s.committedsales_qty2,0))
   FROM   ic_summ_inv s
   WHERE  s.item_id = p_item_id
   AND    s.whse_code = l_whse_code;
Line: 1940

  SELECT whse_code ,loct_ctl
  FROM IC_WHSE_MST
  WHERE mtl_organization_id = l_organization_id ;
Line: 1946

   SELECT loct_ctl,lot_ctl,noninv_ind
     FROM ic_item_mst
    WHERE item_id=p_item_id;
Line: 1952

  Select inventory_item_id
  From mtl_system_items_b mtl
     , ic_item_mst ic
  Where ic.item_id = p_item_id
    and mtl.organization_id = p_organization_id
    and ic.item_no = mtl.segment1;
Line: 1962

  SELECT ABS(SUM(nvl(trans_qty,0))),
         ABS(SUM(nvl(trans_qty2,0)))
  FROM   ic_tran_pnd
  WHERE  item_id = p_item_id
  AND    whse_code = l_whse_code
  AND    (lot_id <> 0 OR location <> GMI_RESERVATION_UTIL.G_DEFAULT_LOCT)
  AND    completed_ind = 0
  AND    delete_mark = 0
  AND    trans_qty < 0;                 -- pending incoming is sorta available, but not real yet
Line: 1975

  Select sum(nvl(requested_quantity,0)), sum(nvl(requested_quantity2,0))
  From wsh_delivery_details
  Where organization_id = p_organization_id
    and inventory_item_id = p_inventory_item_id
    and released_status in ('S', 'Y');
Line: 1983

  SELECT ABS(SUM(nvl(trans_qty,0))),
         ABS(SUM(nvl(trans_qty2,0)))
  FROM   ic_tran_pnd
  WHERE  line_id = p_demand_source_line_id
  AND    line_detail_id = p_delivery_detail_id
  AND    doc_type='OMSO'
  AND    completed_ind = 0
  AND    delete_mark = 0;
Line: 1994

  SELECT nvl(ship_set_id, 0), source_header_id
  FROM   wsh_delivery_details
  WHERE  delivery_detail_id = p_delivery_detail_id;
Line: 1999

  SELECT NVL(ENFORCE_SHIP_SET_AND_SMC,'N')
  FROM   WSH_SHIPPING_PARAMETERS
  WHERE  ORGANIZATION_ID = v_org_id;
Line: 2007

  SELECT NVL(sum(nvl(requested_quantity,0)),0), NVL(sum(nvl(requested_quantity2,0)),0)
  FROM   wsh_delivery_details
  WHERE  organization_id   = p_organization_id
  AND    inventory_item_id = p_inventory_item_id
  AND    source_code       = 'OE'
  AND    released_status   = 'S';
Line: 2017

  SELECT NVL(ABS(SUM(nvl(trans_qty,0))),0), NVL(ABS(SUM(nvl(trans_qty2,0))),0)
  FROM   ic_tran_pnd itp
  WHERE  item_id   = p_item_id
  AND    whse_code = l_whse_code
  AND    (lot_id <> 0 OR location <> GMI_RESERVATION_UTIL.G_DEFAULT_LOCT)
  AND    completed_ind = 0
  AND    delete_mark   = 0
  AND    trans_qty     < 0
  AND  EXISTS(SELECT 1
              FROM   wsh_delivery_details
              WHERE  delivery_detail_id = itp.line_detail_id
              AND    source_code       = 'OE'
              AND    released_status   = 'S');
Line: 2386

SELECT released_status
FROM wsh_delivery_details
WHERE released_status IN ('Y', 'C')
AND source_line_id = l_so_line_id;
Line: 2477

   SELECT SUM(nvl(s.onhand_order_qty,0)),
          SUM(nvl(s.onhand_order_qty2,0)),
          SUM(nvl(s.committedsales_qty,0)),
          SUM(nvl(s.committedsales_qty2,0))
   FROM   ic_summ_inv s
   WHERE  s.item_id = p_item_id
   AND    s.whse_code = l_whse_code;
Line: 2487

  SELECT whse_code
  FROM IC_WHSE_MST
  WHERE mtl_organization_id = l_organization_id ;
Line: 2493

  Select grade_ctl
  from ic_item_mst
  where item_id=p_item_id;
Line: 2501

  SELECT SUM(nvl(trans_qty,0)),
         SUM(nvl(trans_qty2,0))
  FROM   ic_tran_pnd
  WHERE  item_id = p_item_id
--  AND    line_id = p_demand_source_line_id
  AND    whse_code = l_whse_code
  AND    completed_ind = 0
  AND    delete_mark = 0
--  AND    doc_type='OMSO'
  AND    qc_grade = l_qc_grade
  AND line_type = decode(doc_type,'PROD',-1,line_type); --Bug3163165
Line: 2515

  SELECT SUM(nvl(trans_qty,0)),
         SUM(nvl(trans_qty2,0))
  FROM   ic_tran_pnd
  WHERE  item_id = p_item_id
--  AND    line_id = p_demand_source_line_id
  AND    whse_code = l_whse_code
  AND    completed_ind = 0
  AND    delete_mark = 0
  AND line_type = decode(doc_type,'PROD',-1,line_type); --Bug3163165
Line: 2529

   SELECT SUM(nvl(s.onhand_order_qty,0)),
          SUM(nvl(s.onhand_order_qty2,0)),
          SUM(nvl(s.committedsales_qty,0)),
          SUM(nvl(s.committedsales_qty2,0))
   FROM   ic_summ_inv s
   WHERE  s.item_id = p_item_id
   AND    s.whse_code = l_whse_code
   AND    s.qc_grade = l_qc_grade
   ;
Line: 2541

  SELECT SUM(ABS(nvl(trans_qty,0))),
         SUM(ABS(nvl(trans_qty2,0)))
  FROM   ic_tran_pnd
  WHERE  line_id = p_demand_source_line_id
  AND    doc_type='OMSO'
  AND    completed_ind = 0
  AND    delete_mark = 0;
Line: 2550

 SELECT preferred_grade
 FROM oe_order_lines_all
 WHERE line_id = p_line_id;
Line: 2722

   SELECT ABS(SUM(nvl(trans_qty,0))),
          ABS(SUM(nvl(trans_qty2,0)))
     FROM  ic_tran_pnd
    WHERE  line_id = p_demand_source_line_id
      AND  line_detail_id = p_delivery_detail_id
      AND  doc_type='OMSO'
      AND  completed_ind = 0
      AND  delete_mark = 0;
Line: 2733

   SELECT whse_code ,loct_ctl
     FROM ic_whse_mst
    WHERE mtl_organization_id = l_organization_id ;
Line: 2739

   SELECT loct_ctl,lot_ctl,noninv_ind
     FROM ic_item_mst
    WHERE  item_id=p_item_id;
Line: 2959

  Select delivery_detail_id, inventory_item_id, organization_id, source_line_id, requested_quantity, requested_quantity2
  FROM   wsh_delivery_details
  WHERE  source_header_id = p_source_header_id
    AND  ship_set_id = p_shipset_id
    AND  source_code = 'OE'
    AND  released_status <> 'D';
Line: 2969

  Select inventory_item_id, Sum(requested_quantity) total_requested
  FROM   wsh_delivery_details
  WHERE  source_header_id = p_source_header_id
    AND  ship_set_id = p_shipset_id
    AND  source_code = 'OE'
    AND  released_status <> 'D'
  Group by inventory_item_id;
Line: 2980

  SELECT item_id
  FROM  ic_item_mst
  WHERE delete_mark = 0
    AND   item_no in (SELECT segment1
                      FROM mtl_system_items
                      WHERE organization_id   = p_organization_id
                      AND   inventory_item_id = l_apps_itm_id);
Line: 2989

  SELECT loct_ctl,lot_ctl,noninv_ind
    FROM ic_item_mst
   WHERE item_id=l_opm_itm_id;
Line: 2994

  Select sum(nvl(requested_quantity,0)), sum(nvl(requested_quantity2,0))
  From wsh_delivery_details
  Where organization_id = p_organization_id
    and inventory_item_id = l_apps_itm_id
    and released_status in ('S', 'Y');
Line: 3003

  SELECT ABS(SUM(nvl(trans_qty,0))),
         ABS(SUM(nvl(trans_qty2,0)))
  FROM   ic_tran_pnd
  WHERE  item_id = l_opm_itm_id
  AND    whse_code = l_whse_code
  AND    (lot_id <> 0 OR location <> GMI_RESERVATION_UTIL.G_DEFAULT_LOCT)
  AND    completed_ind = 0
  AND    delete_mark = 0
  AND    trans_qty < 0;
Line: 3014

  SELECT SUM(nvl(s.onhand_order_qty,0)),
         SUM(nvl(s.onhand_order_qty2,0)),
         SUM(nvl(s.committedsales_qty,0)),
         SUM(nvl(s.committedsales_qty2,0))
  FROM   ic_summ_inv s
  WHERE  s.item_id = l_opm_itm_id
  AND    s.whse_code = l_whse_code;
Line: 3026

  SELECT NVL(sum(nvl(requested_quantity,0)),0), NVL(sum(nvl(requested_quantity2,0)),0)
  FROM   wsh_delivery_details
  WHERE  organization_id   = p_organization_id
  AND    inventory_item_id = p_inventory_item_id
  AND    source_code       = 'OE'
  AND    released_status   = 'S';
Line: 3036

  SELECT NVL(ABS(SUM(nvl(trans_qty,0))),0), NVL(ABS(SUM(nvl(trans_qty2,0))),0)
  FROM   ic_tran_pnd itp
  WHERE  item_id   = p_item_id
  AND    whse_code = l_whse_code
  AND    (lot_id <> 0 OR location <> GMI_RESERVATION_UTIL.G_DEFAULT_LOCT)
  AND    completed_ind = 0
  AND    delete_mark   = 0
  AND    trans_qty     < 0
  AND  EXISTS(SELECT 1
              FROM   wsh_delivery_details
              WHERE  delivery_detail_id = itp.line_detail_id
              AND    source_code       = 'OE'
              AND    released_status   = 'S');
Line: 3267

            gmi_reservation_util.Println('Demand table Updated For Shipset item id ' || l_opm_itm_id );
Line: 3278

    gmi_reservation_util.println('EXITING Record Updated- RESERVED Shipset id  '||p_shipset_id);