DBA Data[Home] [Help]

APPS.GME_RESCHEDULE_BATCH_PVT SQL Statements

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

Line: 76

         SELECT status_type
           FROM gmd_status gs, gmd_recipe_validity_rules grvr
          WHERE grvr.recipe_validity_rule_id = v_validity_rule_id
            AND status_code = grvr.validity_rule_status;
Line: 85

         SELECT start_date, end_date
           FROM gmd_recipe_validity_rules
          WHERE recipe_validity_rule_id = v_validity_rule_id;
Line: 93

         SELECT material_detail_id, line_type
           FROM gme_material_details
          WHERE batch_id = v_batch_id;
Line: 99

         SELECT phantom_id, m.material_detail_id, release_type, line_type
               ,i.batchstep_id
           FROM gme_material_details m, gme_batch_step_items i
          WHERE m.batch_id = v_batch_id
            AND NVL (phantom_id, 0) > 0
            AND m.batch_id = i.batch_id(+)
            AND m.material_detail_id = i.material_detail_id(+);
Line: 109

         SELECT plan_start_date
           FROM gme_batch_steps
          WHERE batch_id = v_batch_id AND batchstep_id = v_batchstep_id;
Line: 118

         SELECT batchstep_no, plan_cmplt_date
           FROM gme_batch_steps
          WHERE batch_id = v_batch_id
            AND (plan_cmplt_date + l_diff) > v_plan_cmplt_date;
Line: 126

         SELECT *
           FROM gmd_recipe_validity_rules
          WHERE recipe_validity_rule_id = NVL (p_recipe_validity_rule_id, -1);
Line: 132

         SELECT primary_item_id
           FROM wip_entities
          WHERE wip_entity_id = v_batch_id;
Line: 140

         SELECT   plan_qty, dtl_um
             FROM gme_material_details
            WHERE batch_id = v_batch_id
              AND inventory_item_id = v_item_id
              AND line_type = 1
         ORDER BY line_no ASC;
Line: 151

         SELECT segment1
           FROM mtl_system_items
          WHERE organization_id = p_organization_id
            AND inventory_item_id = p_item_id;
Line: 158

         SELECT 1
           FROM DUAL
          WHERE EXISTS (SELECT 1
                          FROM gme_batch_step_charges
                         WHERE batch_id = v_batch_id);
Line: 303

         gme_debug.put_line ('Delete all the  pending resource transactions');
Line: 307

      IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
         DELETE FROM gme_resource_txns
               WHERE doc_id = x_batch_header_rec.batch_id
                 AND doc_type = l_doc_type
                 AND line_id IN (
                        SELECT batchstep_resource_id
                          FROM gme_batch_step_resources
                         WHERE batch_id = x_batch_header_rec.batch_id
                           AND batchstep_id IN (
                                  SELECT batchstep_id
                                    FROM gme_batch_steps
                                   WHERE batch_id =
                                                   x_batch_header_rec.batch_id
                                     AND step_status = 1) );
Line: 321

         DELETE FROM gme_resource_txns_gtmp
               WHERE doc_id = x_batch_header_rec.batch_id
                 AND doc_type = l_doc_type
                 AND line_id IN (
                        SELECT batchstep_resource_id
                          FROM gme_batch_step_resources
                         WHERE batch_id = x_batch_header_rec.batch_id
                           AND batchstep_id IN (
                                  SELECT batchstep_id
                                    FROM gme_batch_steps
                                   WHERE batch_id =
                                                   x_batch_header_rec.batch_id
                                     AND step_status = 1) );
Line: 430

         SELECT primary_uom_code
           INTO l_prim_item_um
           FROM mtl_system_items
          WHERE inventory_item_id =
                                  l_recipe_validity_rule_rec.inventory_item_id
            AND organization_id = l_batch_header_rec.organization_id;
Line: 677

            gme_debug.put_line ('Update gme_batch_header.');
Line: 680

         UPDATE gme_batch_header
            SET plan_start_date = x_batch_header_rec.plan_start_date
               ,plan_cmplt_date = x_batch_header_rec.plan_cmplt_date
               ,due_date =
                   NVL (x_batch_header_rec.due_date
                       ,x_batch_header_rec.plan_cmplt_date)
               ,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 batch_id = x_batch_header_rec.batch_id;
Line: 694

                (   ' After update gme_batch_header. Final plan_start_date '
                 || TO_CHAR (x_batch_header_rec.plan_start_date
                            ,'yyyy/mon/dd hh24:mi:ss')
                 || ' Final plan_cmplt_date '
                 || TO_CHAR (x_batch_header_rec.plan_cmplt_date
                            ,'yyyy/mon/dd hh24:mi:ss') );
Line: 706

         SELECT MIN (plan_start_date)
           INTO min_start_date
           FROM gme_batch_steps
          WHERE batch_id = p_batch_header_rec.batch_id;
Line: 733

         SELECT MAX (plan_cmplt_date)
           INTO max_cmplt_date
           FROM gme_batch_steps
          WHERE batch_id = p_batch_header_rec.batch_id;
Line: 782

            UPDATE gme_batch_header
               SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
               --Bug 13256866
		      ,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 batch_id = x_batch_header_rec.batch_id;
Line: 821

      /*  for the current batch if the update inventory ind is set for the batch  */
      IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
         IF (NVL (g_debug, 0) IN
                       (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
            gme_debug.put_line
               ('Load all the transactions and resources to the temporary table.');
Line: 843

      END IF;           /* IF x_batch_header_rec.update_inventory_ind = 'Y' */
Line: 891

      /* Now we have to update the transaction dates of pending transactions */
      /* for the material lines which are not of step release type           */
      OPEN cur_get_material (x_batch_header_rec.batch_id);
Line: 915

            SELECT plan_start_date, plan_cmplt_date
            INTO   l_start_date, l_cmplt_date
            FROM   gme_batch_steps
            WHERE  batch_id = x_batch_header_rec.batch_id
              AND  batchstep_id = (SELECT batchstep_id
                                   FROM   gme_batch_step_items
                                   WHERE  batch_id = x_batch_header_rec.batch_id
                                     AND  material_detail_id = l_material_detail_ids(i));
Line: 981

	  R: When reservations are deleted for a material line
	  M: When MO Allocations are deleted for a material line
	  B: When Both reservations and material lines are deleted for a material line
	 */
	 IF x_return_status = 'R' THEN
 	   l_R_count := l_R_count + 1;
Line: 999

       gme_common_pvt.log_message('GME_EXPIRED_RESERV_MO_DELETED');
Line: 1002

       gme_common_pvt.log_message('GME_EXPIRED_RESERV_DELETED');
Line: 1005

       gme_common_pvt.log_message('GME_EXPIRED_MO_DELETED');
Line: 1032

         UPDATE gme_batch_header
            SET FINITE_SCHEDULED_IND = 0
            --Bug 13256866
		      ,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 batch_id = x_batch_header_rec.batch_id;
Line: 1043

      /* Update the row who columns */
      x_batch_header_rec.last_update_date := gme_common_pvt.g_timestamp;
Line: 1045

      x_batch_header_rec.last_updated_by := gme_common_pvt.g_user_ident;
Line: 1046

      x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;
Line: 1123

      This particular procedure is used to update the pending transactions of the material detail
      line passed in to the trans date to the plan_start or completion dates of the batch/
    Parameters

      P_batch_header     Batch Header Row.
      p_date             number possible values = 0 for start date and 1 for end date
      x_return_status    outcome of the API call
                S - Success
                E - Error
                U - Unexpected error
      Revision History
                Rishi Varma bug # 3446787.
                       Added the p_batchstep_id parameter for updating only the steps,actvities,
                       resources,resource transactions.
                       For this modified the sql query to include the condition
                       "AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id)" for
                       steps,activities,resources and resource transactions.
   ***********************************************************************************/
   PROCEDURE truncate_date (
      p_batch_header_rec   IN              gme_batch_header%ROWTYPE
     ,p_date               IN              NUMBER
     ,p_batchstep_id       IN              gme_batch_steps.batchstep_id%TYPE
            DEFAULT NULL
     ,x_return_status      OUT NOCOPY      VARCHAR2)
   IS
      l_api_name   CONSTANT VARCHAR2 (30) := 'UPDATE_TRANSACTION';
Line: 1174

            UPDATE gme_batch_header
               SET plan_start_date = p_batch_header_rec.plan_start_date
                  ,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 batch_id = l_batch_id;
Line: 1182

            UPDATE gme_batch_header
               SET plan_cmplt_date = p_batch_header_rec.plan_start_date
                  ,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 batch_id = l_batch_id
               AND plan_cmplt_date < p_batch_header_rec.plan_start_date;
Line: 1191

            UPDATE gme_batch_header
               SET due_date = p_batch_header_rec.plan_start_date
                  ,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 batch_id = l_batch_id
               AND due_date < p_batch_header_rec.plan_start_date;
Line: 1201

         UPDATE gme_batch_steps
            SET plan_start_date = p_batch_header_rec.plan_start_date
               ,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 batch_id = l_batch_id
            AND plan_start_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1211

         UPDATE gme_batch_steps
            SET plan_cmplt_date = p_batch_header_rec.plan_start_date
               ,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 batch_id = l_batch_id
            AND plan_cmplt_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1221

         UPDATE gme_batch_steps
            SET due_date = p_batch_header_rec.plan_start_date
               ,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 batch_id = l_batch_id
            AND due_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1231

         UPDATE gme_batch_step_activities
            SET plan_start_date = p_batch_header_rec.plan_start_date
               ,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 batch_id = l_batch_id
            AND plan_start_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1241

         UPDATE gme_batch_step_activities
            SET plan_cmplt_date = p_batch_header_rec.plan_start_date
               ,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 batch_id = l_batch_id
            AND plan_cmplt_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1251

         UPDATE gme_batch_step_resources
            SET plan_start_date = p_batch_header_rec.plan_start_date
               ,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 batch_id = l_batch_id
            AND plan_start_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1261

         UPDATE gme_batch_step_resources
            SET plan_cmplt_date = p_batch_header_rec.plan_start_date
               ,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 batch_id = l_batch_id
            AND plan_cmplt_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1271

         UPDATE gme_resource_txns
            SET start_date = p_batch_header_rec.plan_start_date
               ,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 doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND start_date < p_batch_header_rec.plan_start_date;
Line: 1281

         UPDATE gme_resource_txns
            SET end_date = p_batch_header_rec.plan_start_date
               ,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 doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND end_date < p_batch_header_rec.plan_start_date;
Line: 1291

         UPDATE gme_resource_txns
            SET trans_date = p_batch_header_rec.plan_start_date
               ,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 doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND trans_date < p_batch_header_rec.plan_start_date;
Line: 1302

            UPDATE gme_batch_header
               SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
                  ,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 batch_id = l_batch_id;
Line: 1310

            UPDATE gme_batch_header
               SET plan_start_date = p_batch_header_rec.plan_cmplt_date
                  ,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 batch_id = l_batch_id
               AND plan_start_date > p_batch_header_rec.plan_cmplt_date;
Line: 1322

            UPDATE gme_batch_header
               SET due_date = p_batch_header_rec.due_date
                  ,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 batch_id = l_batch_id
               AND due_date > p_batch_header_rec.plan_cmplt_date;
Line: 1332

         UPDATE gme_batch_steps
            SET plan_start_date = p_batch_header_rec.plan_cmplt_date
               ,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 batch_id = l_batch_id
            AND plan_start_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1342

         UPDATE gme_batch_steps
            SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
               ,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 batch_id = l_batch_id
            AND plan_cmplt_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1352

         UPDATE gme_batch_steps
            SET due_date = p_batch_header_rec.plan_cmplt_date
               ,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 batch_id = l_batch_id
            AND due_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1362

         UPDATE gme_batch_step_activities
            SET plan_start_date = p_batch_header_rec.plan_cmplt_date
               ,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 batch_id = l_batch_id
            AND plan_start_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1372

         UPDATE gme_batch_step_activities
            SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
               ,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 batch_id = l_batch_id
            AND plan_cmplt_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1382

         UPDATE gme_batch_step_resources
            SET plan_start_date = p_batch_header_rec.plan_cmplt_date
               ,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 batch_id = l_batch_id
            AND plan_start_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1392

         UPDATE gme_batch_step_resources
            SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
               ,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 batch_id = l_batch_id
            AND plan_cmplt_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1402

         UPDATE gme_resource_txns
            SET start_date = p_batch_header_rec.plan_cmplt_date
               ,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 doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND start_date > p_batch_header_rec.plan_cmplt_date;
Line: 1412

         UPDATE gme_resource_txns
            SET end_date = p_batch_header_rec.plan_cmplt_date
               ,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 doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND end_date > p_batch_header_rec.plan_cmplt_date;
Line: 1422

         UPDATE gme_resource_txns
            SET trans_date = p_batch_header_rec.plan_cmplt_date
               ,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 doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND trans_date > p_batch_header_rec.plan_cmplt_date;