DBA Data[Home] [Help]

APPS.GML_GME_API_PVT SQL Statements

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

Line: 66

  l_update_history        NUMBER;
Line: 70

  Select *
  from ic_tran_pnd
  where trans_id = p_trans_id;
Line: 75

  Select distinct whse_code
  From gml_batch_so_reservations
  Where batch_line_id = p_batch_line_id;
Line: 81

  Select sum(reserved_qty), sum(reserved_qty2)
  From gml_batch_so_reservations
  Where batch_line_id = p_batch_line_id
   and  whse_code = p_whse_code
   and  delete_mark = 0;
Line: 89

  Select abs(sum(nvl(trans_qty,0))), abs(sum(nvl(trans_qty2,0)))
  From ic_tran_pnd
  Where line_id = p_batch_line_id
    and whse_code = p_whse_code
    and doc_type in ('PROD', 'FPO')
    and delete_mark = 0
    and completed_ind = 0;
Line: 98

  Select ic.trans_id
  From ic_tran_pnd ic
     , gml_batch_so_alloc_history his
  Where his.batch_trans_id = p_batch_trans_id
    and his.trans_id = ic.trans_id
    and ic.line_id = his.line_id
    and ic.staged_ind = 0
    and ic.delete_mark = 0
    and ic.doc_type = 'OMSO'
    ;
Line: 110

  Select abs(sum(trans_qty)),abs(sum(trans_qty2))
  From ic_tran_pnd ic
    ,  gml_batch_so_alloc_history his
  Where his.batch_trans_id = p_gme_trans_id
    and his.trans_id = ic.trans_id
    and his.delete_mark = 0
    and ic.delete_mark = 0
    and ic.completed_ind = 0
    ;
Line: 121

  Select alloc_rec_id
  From gml_batch_so_alloc_history
  Where batch_trans_id = p_gme_trans_id
    and delete_mark = 0
    ;
Line: 128

  Select scheduled_ship_date
  From gml_batch_so_reservations
  Where batch_line_id = p_batch_line_id
    and delete_mark = 0
    and reserved_qty <> 0
    ;
Line: 136

  Select distinct batch_line_id
  From gml_batch_so_reservations
  Where batch_id = p_batch_id
    and delete_mark = 0
    and reserved_qty <> 0
    ;
Line: 146

  l_update_history := 0;
Line: 175

     GML_GME_API_PVT.g_not_to_delete := 0; -- always delete reservation when availability is 0
Line: 227

  IF p_batch_action = 'DELETE' THEN
      /* 1) cancel-terminate batch -- batch level done here
      * 2) reserval batch at the trans level -- batch line level blocks below
      */
     IF p_batch_line_rec.batch_id is not null
        and p_batch_line_rec.batch_line_id is null
        and p_batch_line_rec.trans_id is null
     THEN
        GMI_RESERVATION_UTIL.PrintLn(' Batch level actions: DELETE');
Line: 345

     /* set g_not_to_delete to 1 if convertion is waiting for the lot status */
  END IF;
Line: 347

  IF p_batch_action = 'DELETE' THEN
     /* actions at the batch side could be
      * 1) cancel-terminate batch -- batch level, above
      * 2) reserval batch at the trans level
      */
      GMI_RESERVATION_UTIL.PrintLn(' In Process_om_reservations...... IF p_batch_action = DELETE');
Line: 379

      * p_gme_trans_row.trans_id will be passed as the new (to be updated) trans_id
      */
     IF p_batch_line_rec.trans_id is not null THEN
        GMI_RESERVATION_UTIL.println('Fetch old gme trans '||p_batch_line_rec.trans_id);
Line: 390

      * 2) update pending to complete
      */
     IF p_batch_line_rec.batch_line_id is not null THEN
        GMI_RESERVATION_UTIL.println('batch line level');
Line: 434

                 /* if planned qty becomes 0, delete all the res for this whse */
                 GMI_RESERVATION_UTIL.println(' global g_not_to_delete '||GML_GME_API_PVT.g_not_to_delete);
Line: 436

                 IF (nvl(l_planned_qty,0) <= 0 AND GML_GME_API_PVT.g_not_to_delete = 0) THEN
                    GML_BATCH_OM_RES_PVT.cancel_res_for_batch_line
                    (
                      P_Batch_line_id          => p_batch_line_rec.batch_line_id
                    , P_whse_code              => l_whse_code
                    , X_return_status          => x_return_status
                    , X_msg_cont               => l_msg_cont
                    , X_msg_data               => l_msg_data
                    ) ;
Line: 453

           GMI_RESERVATION_UTIL.println('UPDP, update pending to complete');
Line: 489

           GMI_RESERVATION_UTIL.println('UPDC, update the completed transaction');
Line: 520

              /* update history ? */
              /* increasing qty is to create neg orginal qty and create new trans with the new qty*/
              l_update_history := 1;
Line: 541

              l_update_history := 1;
Line: 555

                    GMI_TRANS_ENGINE_PUB.update_pending_transaction
                                    (p_api_version      => 1.0,
                                     p_init_msg_list    => FND_API.G_TRUE,
                                     p_commit           => FND_API.G_FALSE,
                                     p_validation_level => FND_API.G_VALID_LEVEL_NONE,
                                     p_tran_rec         => l_tran_rec,
                                     x_tran_row         => l_tran_row,
                                     x_return_status    => x_return_status,
                                     x_msg_count        => l_msg_cont,
                                     x_msg_data         => l_msg_data
                                    );
Line: 567

                       GMI_reservation_Util.PrintLn('update complete trans, alloc creation error');
Line: 587

                    l_update_history := 1;
Line: 603

                    GMI_TRANS_ENGINE_PUB.update_pending_transaction
                                    (p_api_version      => 1.0,
                                     p_init_msg_list    => FND_API.G_TRUE,
                                     p_commit           => FND_API.G_FALSE,
                                     p_validation_level => FND_API.G_VALID_LEVEL_NONE,
                                     p_tran_rec         => l_tran_rec,
                                     x_tran_row         => l_tran_row,
                                     x_return_status    => x_return_status,
                                     x_msg_count        => l_msg_cont,
                                     x_msg_data         => l_msg_data
                                    );
Line: 615

                       GMI_reservation_Util.PrintLn('update complete trans, alloc creation error');
Line: 623

              l_update_history := 1;
Line: 629

              GMI_RESERVATION_UTIL.println('Process_Om_reservations .....Completed batch tran is deleted');
Line: 652

              /* we don't change the history because old trans are deleted and still
               * linked with the old gme trans */
            END IF;
Line: 674

           /* the old trans is deleted and replaced by the new trans
            * need to update the history table to keep the link alive
            */
           /* just do the update */
           /* update gml_batch_so_alloc_history
           Set batch_trans_id = l_new_gme_trans_row.trans_id
           Where  batch_trans_id = l_old_gme_trans_row.trans_id
              and nvl(trans_id,0) <> 0
              and delete_mark = 0
           ;
Line: 686

           IF l_update_history = 1 THEN
              for his_rec in get_history_id (l_old_gme_trans_row.trans_id) LOOP
                 /* delete the old history record  */
                 update gml_batch_so_alloc_history
                 Set delete_mark = 1
                 Where  alloc_rec_id = his_rec.alloc_rec_id
                 ;
Line: 693

                 GMI_RESERVATION_UTIL.println('      delete history.alloc_rec_id '||his_rec.alloc_rec_id);
Line: 709

                 GML_BATCH_OM_UTIL.insert_alloc_history
                     (
                          P_alloc_history_rec      => l_history_rec
                        , X_return_status          => x_return_status
                        , X_msg_cont               => l_msg_cont
                        , X_msg_data               => l_msg_data
                     );
Line: 723

           GMI_RESERVATION_UTIL.println('UPDP, update complete to pending');
Line: 742

        END IF; -- update complted to pending