DBA Data[Home] [Help]

APPS.GME_API_PUB SQL Statements

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

Line: 52

         SELECT DISTINCT doc_id batch_id
                    FROM gme_resource_txns_gtmp
                ORDER BY batch_id;
Line: 192

         SELECT inventory_item_id
           FROM gmd_recipe_validity_rules
          WHERE recipe_validity_rule_id = v_vrule_id;
Line: 198

        SELECT inventory_item_id
	  FROM mtl_system_items_kfv
	 WHERE concatenated_segments = v_item_no;
Line: 204

         SELECT 1
           FROM DUAL
          WHERE EXISTS (SELECT 1
                          FROM mtl_units_of_measure
                         WHERE uom_code = v_uom_code);
Line: 1013

   #  update_actual_rsrc_usage
   # DESCRIPTION
   #
   # HISTORY :
   #  10-MAR-2005  Punit Kumar  Convergence changes
   #########################################################################*/
   PROCEDURE update_actual_rsrc_usage (
      p_api_version           IN              NUMBER := 2.0
     ,p_validation_level      IN              NUMBER := gme_common_pvt.g_max_errors
     ,p_init_msg_list         IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                IN              VARCHAR2 := fnd_api.g_false
     ,p_org_code              IN              VARCHAR2
     ,p_batch_no              IN              VARCHAR2 := NULL
     ,p_batchstep_no          IN              NUMBER := NULL
     ,p_activity              IN              VARCHAR2 := NULL
     ,p_resource              IN              VARCHAR2 := NULL
     ,p_instance_no           IN              NUMBER := NULL
     ,p_reason_name           IN              VARCHAR2 := NULL
     ,p_rsrc_txn_rec          IN              gme_resource_txns%ROWTYPE
     ,p_validate_flexfields   IN              VARCHAR2 := fnd_api.g_false
     ,x_rsrc_txn_rec          IN OUT NOCOPY   gme_resource_txns%ROWTYPE
     ,x_message_count         OUT NOCOPY      NUMBER
     ,x_message_list          OUT NOCOPY      VARCHAR2
     ,x_return_status         OUT NOCOPY      VARCHAR2)
   IS
      l_api_name       CONSTANT  VARCHAR2(30) := 'UPDATE_ACTUAL_RSRC_USAGE';
Line: 1052

         SELECT r.*
           FROM gme_resource_txns_gtmp t, gme_resource_txns r
          WHERE action_code = 'NONE' AND t.line_id = v_line_id
            AND t.poc_trans_id = r.poc_trans_id;
Line: 1057

      update_rsrc_usage          EXCEPTION;
Line: 1060

      SAVEPOINT update_actual_rsrc_usage;
Line: 1062

         gme_debug.log_initialize ('UpdateResource');
Line: 1092

                                         ,'update_actual_resource_usage'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 1107

            ||'BEFORE CALLING gme_resource_engine_pvt.update_actual_resource_usagep ' );
Line: 1110

      gme_resource_engine_pvt.update_actual_resource_usage
                                           (p_org_code           => p_org_code
                                           ,p_batch_no           => p_batch_no
                                           ,p_batchstep_no       => p_batchstep_no
                                           ,p_activity           => p_activity
                                           ,p_resource           => p_resource
                                           ,p_instance_no        => p_instance_no
                                           ,p_reason_name        => p_reason_name
                                           ,p_rsrc_txn_rec       => p_rsrc_txn_rec
                                           ,x_rsrc_txn_rec       => x_rsrc_txn_rec
                                           ,x_return_status      => x_return_status);
Line: 1140

         RAISE update_rsrc_usage;
Line: 1176

         ROLLBACK TO SAVEPOINT update_actual_rsrc_usage;
Line: 1180

      WHEN update_rsrc_usage THEN
         ROLLBACK TO SAVEPOINT update_actual_rsrc_usage;
Line: 1186

         ROLLBACK TO SAVEPOINT update_actual_rsrc_usage;
Line: 1191

   END update_actual_rsrc_usage;
Line: 1195

   #   insert_incr_actual_rsrc_txn
   # DESCRIPTION
   # HISTORY
   #  10-MAR-2005  Punit Kumar
   #    Convergence changes
   #########################################################################*/
   PROCEDURE insert_incr_actual_rsrc_txn (
      p_api_version           IN              NUMBER := 2.0
     ,p_validation_level      IN              NUMBER  := gme_common_pvt.g_max_errors
     ,p_init_msg_list         IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                IN              VARCHAR2 := fnd_api.g_false
     ,p_org_code              IN              VARCHAR2
     ,p_batch_no              IN              VARCHAR2 := NULL
     ,p_batchstep_no          IN              NUMBER := NULL
     ,p_activity              IN              VARCHAR2 := NULL
     ,p_resource              IN              VARCHAR2 := NULL
     ,p_instance_no           IN              NUMBER := NULL
     ,p_reason_name           IN              VARCHAR2 := NULL
     ,p_rsrc_txn_rec          IN              gme_resource_txns%ROWTYPE
     ,p_validate_flexfields   IN              VARCHAR2 := fnd_api.g_false
     ,x_rsrc_txn_rec          IN OUT NOCOPY   gme_resource_txns%ROWTYPE
     ,x_message_count         OUT NOCOPY      NUMBER
     ,x_message_list          OUT NOCOPY      VARCHAR2
     ,x_return_status         OUT NOCOPY      VARCHAR2)
   IS
      l_api_name       CONSTANT  VARCHAR2(30) := 'INSERT_INCR_ACTUAL_RSRC_TXN';
Line: 1225

      SAVEPOINT insert_incr_actual_rsrc_txn;
Line: 1228

         gme_debug.log_initialize ('InsertIncr');
Line: 1257

                                         ,'insert_incr_actual_rsrc_txn'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 1272

            ||'BEFORE CALLING gme_resource_engine_pvt.insert_incr_actual_rsrc_txnp ' );
Line: 1274

      gme_resource_engine_pvt.insert_incr_actual_rsrc_txn
                                           (p_org_code           => p_org_code
                                           ,p_batch_no           => p_batch_no
                                           ,p_batchstep_no       => p_batchstep_no
                                           ,p_activity           => p_activity
                                           ,p_resource           => p_resource
                                           ,p_instance_no        => p_instance_no
                                           ,p_reason_name        => p_reason_name
                                           ,p_rsrc_txn_rec       => p_rsrc_txn_rec
                                           ,x_rsrc_txn_rec       => x_rsrc_txn_rec
                                           ,x_return_status      => x_return_status);
Line: 1307

         gme_debug.put_line (   'Insert Incr Actual rsrc usage at '
                             || TO_CHAR (SYSDATE, 'MM/DD/YYYY HH24:MI:SS') );
Line: 1318

         ROLLBACK TO SAVEPOINT insert_incr_actual_rsrc_txn;
Line: 1323

         ROLLBACK TO SAVEPOINT insert_incr_actual_rsrc_txn;
Line: 1328

   END insert_incr_actual_rsrc_txn;
Line: 1332

   #   insert_timed_actual_rsrc_txn
   # DESCRIPTION
   #   This procedure calculates the resource usage based on
   #   difference of p_end_date and p_start_date converted in resource UOM.
   # HISTORY
   # 10-MAR-2005  Punit Kumar
   #   Convergence changes
   #########################################################################*/
   PROCEDURE insert_timed_actual_rsrc_txn (
      p_api_version           IN              NUMBER := 2.0
     ,p_validation_level      IN              NUMBER  := gme_common_pvt.g_max_errors
     ,p_init_msg_list         IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                IN              VARCHAR2 := fnd_api.g_false
     ,p_org_code              IN              VARCHAR2
     ,p_batch_no              IN              VARCHAR2 := NULL
     ,p_batchstep_no          IN              NUMBER := NULL
     ,p_activity              IN              VARCHAR2 := NULL
     ,p_resource              IN              VARCHAR2 := NULL
     ,p_instance_no           IN              NUMBER := NULL
     ,p_reason_name           IN              VARCHAR2 := NULL
     ,p_rsrc_txn_rec          IN              gme_resource_txns%ROWTYPE
     ,p_validate_flexfields   IN              VARCHAR2 := fnd_api.g_false
     ,x_rsrc_txn_rec          IN OUT NOCOPY   gme_resource_txns%ROWTYPE
     ,x_message_count         OUT NOCOPY      NUMBER
     ,x_message_list          OUT NOCOPY      VARCHAR2
     ,x_return_status         OUT NOCOPY      VARCHAR2)
   IS
      l_api_name       CONSTANT VARCHAR2(30) := 'INSERT_TIMED_ACTUAL_RSRC_TXN';
Line: 1365

      SAVEPOINT insert_timed_actual_rsrc_txn;
Line: 1369

         gme_debug.log_initialize ('InsertTimed');
Line: 1397

                                         ,'insert_timed_actual_rsrc_txn'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 1413

            ||'BEFORE CALLING gme_resource_engine_pvt.insert_timed_actual_rsrc_txnp ');
Line: 1416

      gme_resource_engine_pvt.insert_timed_actual_rsrc_txn
                                           (p_org_code           => p_org_code
                                           ,p_batch_no           => p_batch_no
                                           ,p_batchstep_no       => p_batchstep_no
                                           ,p_activity           => p_activity
                                           ,p_resource           => p_resource
                                           ,p_instance_no        => p_instance_no
                                           ,p_reason_name        => p_reason_name
                                           ,p_rsrc_txn_rec       => p_rsrc_txn_rec
                                           ,x_rsrc_txn_rec       => x_rsrc_txn_rec
                                           ,x_return_status      => x_return_status);
Line: 1449

         gme_debug.put_line (   'Insert timed Actual rsrc usage at '
                             || TO_CHAR (SYSDATE, 'MM/DD/YYYY HH24:MI:SS') );
Line: 1460

         ROLLBACK TO SAVEPOINT insert_timed_actual_rsrc_txn;
Line: 1465

         ROLLBACK TO SAVEPOINT insert_timed_actual_rsrc_txn;
Line: 1470

   END insert_timed_actual_rsrc_txn;
Line: 1478

   #    At a later time this transaction is updated with the usage
   #    by calling gme_api_pub.end_cmplt_actual_rsrc_txn (It passes
   #    the end date and the usage is calculated as diferrence between
   #    end_date and start_date)
   # HISTORY
   #   10-MAR-2005  Punit Kumar
   #     Convergence changes
   #    Pawan kumar corrected check for organization_id and various parameters
   #########################################################################*/
   PROCEDURE start_cmplt_actual_rsrc_txn (
      p_api_version           IN              NUMBER := 2.0
     ,p_validation_level      IN              NUMBER
            := gme_common_pvt.g_max_errors
     ,p_init_msg_list         IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                IN              VARCHAR2 := fnd_api.g_false
     ,p_org_code              IN              VARCHAR2
     ,p_batch_no              IN              VARCHAR2 := NULL
     ,p_batchstep_no          IN              NUMBER := NULL
     ,p_activity              IN              VARCHAR2 := NULL
     ,p_resource              IN              VARCHAR2 := NULL
     ,p_instance_no           IN              NUMBER
     ,p_reason_name           IN              VARCHAR2 := NULL
     ,p_rsrc_txn_rec          IN              gme_resource_txns%ROWTYPE
     ,p_validate_flexfields   IN              VARCHAR2 := fnd_api.g_false
     ,x_rsrc_txn_rec          IN OUT NOCOPY   gme_resource_txns%ROWTYPE
     ,x_message_count         OUT NOCOPY      NUMBER
     ,x_message_list          OUT NOCOPY      VARCHAR2
     ,x_return_status         OUT NOCOPY      VARCHAR2)
   IS
      l_api_name       CONSTANT  VARCHAR2(30) := 'START_CMPLT_ACTUAL_RSRC_TXN';
Line: 1724

         gme_debug.put_line (   'Insert Incr Actual rsrc usage at '
                             || TO_CHAR (SYSDATE, 'MM/DD/YYYY HH24:MI:SS') );
Line: 2372

                                         ,'insert_batchstep_resource'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 2490

                                         ,'insert_batchstep_resource'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 2539

      /* Verify that update_inventory is permitted for this batch */
      IF l_batch_header_rec.update_inventory_ind <> 'Y' THEN
         gme_common_pvt.log_message ('GME_INVENTORY_UPDATE_BLOCKED');
Line: 2599

   PROCEDURE insert_process_parameter (
      p_api_version           IN              NUMBER := 2.0
     ,p_validation_level      IN              NUMBER
     ,p_init_msg_list         IN              VARCHAR2
     ,p_commit                IN              VARCHAR2
     ,x_message_count         OUT NOCOPY      NUMBER
     ,x_message_list          OUT NOCOPY      VARCHAR2
     ,x_return_status         OUT NOCOPY      VARCHAR2
     ,p_batch_no              IN              VARCHAR2
     ,p_org_code              IN              VARCHAR2
     ,p_validate_flexfields   IN              VARCHAR2
     ,p_batchstep_no          IN              NUMBER
     ,p_activity              IN              VARCHAR2
     ,p_parameter             IN              VARCHAR2
     ,p_process_param_rec     IN              gme_process_parameters%ROWTYPE
     ,x_process_param_rec     OUT NOCOPY      gme_process_parameters%ROWTYPE)
   IS
      insert_parameter_failed   EXCEPTION;
Line: 2617

      l_api_name       CONSTANT VARCHAR2 (30) := 'INSERT_PROCESS_PARAMETER';
Line: 2625

      SAVEPOINT insert_process_parameter;
Line: 2628

         gme_debug.log_initialize ('InsertProcessParameters');
Line: 2640

                                         ,'Insert_process_parameter'
                                         ,g_pkg_name) THEN
         x_return_status := fnd_api.g_ret_sts_error;
Line: 2656

         gme_debug.put_line ('Calling Insert process parameters');
Line: 2660

      gme_process_parameters_pvt.insert_process_parameter
                              (p_batch_no                 => p_batch_no
                              ,p_org_code                 => p_org_code
                              ,p_validate_flexfields      => p_validate_flexfields
                              ,p_batchstep_no             => p_batchstep_no
                              ,p_activity                 => p_activity
                              ,p_parameter                => p_parameter
                              ,p_process_param_rec        => p_process_param_rec
                              ,x_process_param_rec        => x_process_param_rec
                              ,x_return_status            => x_return_status);
Line: 2673

               (   'Came back from Pvt insert process parameter with status '
                || x_return_status);
Line: 2683

         RAISE insert_parameter_failed;
Line: 2698

         ROLLBACK TO SAVEPOINT insert_process_parameter;
Line: 2702

      WHEN insert_parameter_failed THEN
         ROLLBACK TO SAVEPOINT insert_process_parameter;
Line: 2708

        ROLLBACK TO SAVEPOINT insert_process_parameter;
Line: 2713

   END insert_process_parameter;
Line: 2716

   PROCEDURE update_process_parameter (
      p_api_version           IN              NUMBER
     ,p_validation_level      IN              NUMBER
     ,p_init_msg_list         IN              VARCHAR2
     ,p_commit                IN              VARCHAR2
     ,x_message_count         OUT NOCOPY      NUMBER
     ,x_message_list          OUT NOCOPY      VARCHAR2
     ,x_return_status         OUT NOCOPY      VARCHAR2
     ,p_batch_no              IN              VARCHAR2
     ,p_org_code              IN              VARCHAR2
     ,p_validate_flexfields   IN              VARCHAR2
     ,p_batchstep_no          IN              NUMBER
     ,p_activity              IN              VARCHAR2
     ,p_parameter             IN              VARCHAR2
     ,p_process_param_rec     IN              gme_process_parameters%ROWTYPE
     ,x_process_param_rec     OUT NOCOPY      gme_process_parameters%ROWTYPE)
   IS
      update_parameter_failed   EXCEPTION;
Line: 2734

      l_api_name       CONSTANT VARCHAR2 (30) := 'UPDATE_PROCESS_PARAMETER';
Line: 2742

      SAVEPOINT update_process_parameter;
Line: 2745

         gme_debug.log_initialize ('UpdateProcessParameter');
Line: 2759

                                         ,'Insert_process_parameter'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 2773

      gme_process_parameters_pvt.update_process_parameter
                              (p_batch_no                 => p_batch_no
                              ,p_org_code                 => p_org_code
                              ,p_validate_flexfields      => p_validate_flexfields
                              ,p_batchstep_no             => p_batchstep_no
                              ,p_activity                 => p_activity
                              ,p_parameter                => p_parameter
                              ,p_process_param_rec        => p_process_param_rec
                              ,x_process_param_rec        => x_process_param_rec
                              ,x_return_status            => x_return_status);
Line: 2786

               (   'Came back from Pvt update process parameter with status '
                || x_return_status);
Line: 2796

         RAISE update_parameter_failed;
Line: 2812

         ROLLBACK TO SAVEPOINT update_process_parameter;
Line: 2816

      WHEN update_parameter_failed THEN
         ROLLBACK TO SAVEPOINT update_process_parameter;
Line: 2822

        ROLLBACK TO SAVEPOINT update_process_parameter;
Line: 2827

   END update_process_parameter;
Line: 2830

   PROCEDURE delete_process_parameter (
      p_api_version         IN              NUMBER
     ,p_validation_level    IN              NUMBER
     ,p_init_msg_list       IN              VARCHAR2
     ,p_commit              IN              VARCHAR2
     ,x_message_count       OUT NOCOPY      NUMBER
     ,x_message_list        OUT NOCOPY      VARCHAR2
     ,x_return_status       OUT NOCOPY      VARCHAR2
     ,p_batch_no            IN              VARCHAR2
     ,p_org_code            IN              VARCHAR2
     ,p_batchstep_no        IN              NUMBER
     ,p_activity            IN              VARCHAR2
     ,p_parameter           IN              VARCHAR2
     ,p_process_param_rec   IN              gme_process_parameters%ROWTYPE)
   IS
      delete_parameter_failed   EXCEPTION;
Line: 2846

      l_api_name       CONSTANT VARCHAR2 (30) := 'DELETE_PROCESS_PARAMETER';
Line: 2854

      SAVEPOINT delete_process_parameter;
Line: 2857

         gme_debug.log_initialize ('DeleteProcessParameter');
Line: 2871

                                         ,'Insert_process_parameter'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 2885

         gme_debug.put_line ('Calling Insert process parameters');
Line: 2889

      gme_process_parameters_pvt.delete_process_parameter
                                  (p_batch_no               => p_batch_no
                                  ,p_org_code               => p_org_code
                                  ,p_batchstep_no           => p_batchstep_no
                                  ,p_activity               => p_activity
                                  ,p_parameter              => p_parameter
                                  ,p_process_param_rec      => p_process_param_rec
                                  ,x_return_status          => x_return_status);
Line: 2900

               (   'Came back from Pvt delete process parameter with status '
                || x_return_status);
Line: 2910

         RAISE delete_parameter_failed;
Line: 2921

         ROLLBACK TO SAVEPOINT delete_process_parameter;
Line: 2925

      WHEN delete_parameter_failed THEN
         ROLLBACK TO SAVEPOINT delete_process_parameter;
Line: 2931

         ROLLBACK TO SAVEPOINT delete_process_parameter;
Line: 2936

   END delete_process_parameter;
Line: 2939

   PROCEDURE delete_step (
      p_api_version        IN              NUMBER := 2.0
     ,p_validation_level   IN              NUMBER
            := gme_common_pvt.g_max_errors
     ,p_init_msg_list      IN              VARCHAR2 := fnd_api.g_false
     ,p_commit             IN              VARCHAR2
     ,p_org_code           IN              VARCHAR2
     ,p_batch_no           IN              VARCHAR2
     ,x_message_count      OUT NOCOPY      NUMBER
     ,x_message_list       OUT NOCOPY      VARCHAR2
     ,x_return_status      OUT NOCOPY      VARCHAR2
     ,p_batch_step_rec     IN              gme_batch_steps%ROWTYPE)
   IS
      l_api_name   CONSTANT VARCHAR2 (30) := 'DELETE_STEP';
Line: 2954

      delete_step_failed    EXCEPTION;
Line: 2960

      SAVEPOINT delete_step;
Line: 2978

                                         ,'delete_step'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 2983

      gme_api_main.delete_step (p_validation_level      => p_validation_level
                               ,p_init_msg_list         => fnd_api.g_false
                               ,x_message_count         => x_message_count
                               ,x_message_list          => x_message_list
                               ,x_return_status         => x_return_status
                               ,p_batch_header_rec      => l_batch_header_rec
                               ,p_batch_step_rec        => p_batch_step_rec);
Line: 2992

         RAISE delete_step_failed;
Line: 3014

         ROLLBACK TO SAVEPOINT delete_step;
Line: 3019

      WHEN delete_step_failed THEN
         ROLLBACK TO SAVEPOINT delete_step;
Line: 3025

          ROLLBACK TO SAVEPOINT delete_step;
Line: 3030

   END delete_step;
Line: 3034

    *    insert_step
    * History
    * Punit Kumar 07-Apr-2005
    *   Convergence Changes
    * SivakumarG 16-NOV-2005 FPBug#4395561
    *  Added new argument p_validate_flexfields
   /*************************************************************************/
   PROCEDURE insert_step (
      p_api_version         IN              NUMBER := 2.0
     ,p_validation_level    IN              NUMBER  := gme_common_pvt.g_max_errors
     ,p_init_msg_list       IN              VARCHAR2 := fnd_api.g_false
     ,p_commit              IN              VARCHAR2
     ,p_org_code            IN              VARCHAR2
     ,p_validate_flexfields IN              VARCHAR2 := fnd_api.g_false
     ,p_oprn_no             IN              VARCHAR2
     ,p_oprn_vers           IN              NUMBER
     ,p_batch_header_rec    IN              gme_batch_header%ROWTYPE
     ,p_batch_step_rec      IN              gme_batch_steps%ROWTYPE
     ,x_batch_step_rec      OUT NOCOPY      gme_batch_steps%ROWTYPE
     ,x_message_count       OUT NOCOPY      NUMBER
     ,x_message_list        OUT NOCOPY      VARCHAR2
     ,x_return_status       OUT NOCOPY      VARCHAR2)
   IS
      l_api_name         CONSTANT VARCHAR2 (30)              := 'INSERT_STEP';
Line: 3058

      insert_step_failed          EXCEPTION;
Line: 3069

         SELECT oprn_no, oprn_vers
           FROM gmd_operations_b
          WHERE oprn_id = l_oprn_id;
Line: 3078

         SELECT 1
           FROM DUAL
          WHERE EXISTS (
                   SELECT 1
                     FROM gmd_operations_b
                    WHERE oprn_no = l_oprn_no
                      AND oprn_vers = l_oprn_vers
                      AND owner_organization_id = l_org_id);
Line: 3091

      SAVEPOINT insert_step;
Line: 3109

                                         ,'insert_step'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 3129

      /* Bug 2766460 Added check not to allow insert step if batch is completed/closed or cancelled */
      IF (l_batch_header_rec.batch_status IN (gme_common_pvt.g_batch_cancelled,
                                              gme_common_pvt.g_batch_completed,
                                              gme_common_pvt.g_batch_closed) ) THEN
         gme_common_pvt.log_message ('GME_INV_STATUS_INSERT_STEP');
Line: 3154

         gme_common_pvt.log_message ('GME_INV_STATUS_INSERT_STEP');
Line: 3174

               RAISE insert_step_failed;
Line: 3194

               RAISE insert_step_failed;
Line: 3202

            RAISE insert_step_failed;
Line: 3211

       gme_api_main.insert_step (p_validation_level      => p_validation_level
                               ,p_init_msg_list         => fnd_api.g_false
                               ,x_message_count         => x_message_count
                               ,x_message_list          => x_message_list
                               ,x_return_status         => x_return_status
                               ,p_batch_header_rec      => l_batch_header_rec
                               ,p_batch_step_rec        => p_batch_step_rec
                               ,x_batch_step            => x_batch_step_rec);
Line: 3223

         RAISE insert_step_failed;
Line: 3249

         ROLLBACK TO SAVEPOINT insert_step;
Line: 3254

      WHEN insert_step_failed THEN
         ROLLBACK TO SAVEPOINT insert_step;
Line: 3261

         ROLLBACK TO SAVEPOINT insert_step;
Line: 3267

   END insert_step;
Line: 3271

      insert_material_line
    Description
      This procedure is used to insert a material line

    Parameters
      p_batch_header_rec (R)          batch for which material line has to be updated
      p_material_detail_rec (R)       material line details that has to be inserted
      p_locator_code (O)              Default Consumption/Yield Locator Code
      p_org_code (O)                  organization code
      p_batchstep_no(O)               batch step no
      p_validate_flexfields (O)       Whether to validate the flexfields
      x_material_detail_rec           inserted material detail record
      x_return_status                 outcome of the API call
                                      S - Success
                                      E - Error
                                      U - Unexpected Error
    HISTORY
     SivakumarG Bug#5078853 02-MAR-2006
      Procedure Created
  ================================================================================*/
    PROCEDURE insert_material_line (
         p_api_version           IN           NUMBER := 2.0
        ,p_validation_level      IN           NUMBER := gme_common_pvt.g_max_errors
        ,p_init_msg_list         IN           VARCHAR2 DEFAULT fnd_api.g_false
        ,p_commit                IN           VARCHAR2 DEFAULT fnd_api.g_false
        ,p_batch_header_rec      IN           gme_batch_header%ROWTYPE
        ,p_material_detail_rec   IN           gme_material_details%ROWTYPE
        ,p_locator_code          IN           VARCHAR2
        ,p_org_code              IN           VARCHAR2
        ,p_batchstep_no          IN           NUMBER := NULL
        ,p_validate_flexfields   IN           VARCHAR2 DEFAULT fnd_api.g_false
        ,x_material_detail_rec   OUT NOCOPY   gme_material_details%ROWTYPE
        ,x_message_count         OUT NOCOPY   NUMBER
        ,x_message_list          OUT NOCOPY   VARCHAR2
        ,x_return_status         OUT NOCOPY   VARCHAR2 )
    IS
    /* get the locator id */
    CURSOR c_get_locator(v_org_id NUMBER,v_sub_inv VARCHAR2) IS
     SELECT inventory_location_id locator_id
       FROM mtl_item_locations_kfv
      WHERE organization_id = v_org_id
        AND subinventory_code = v_sub_inv
        AND concatenated_segments = p_locator_code;
Line: 3315

    l_api_name                    CONSTANT VARCHAR2 (30) := 'INSERT_MATERIAL_LINE';
Line: 3327

         gme_debug.log_initialize ('INSERT_MATERIAL_LINE');
Line: 3338

       SAVEPOINT insert_material_line;
Line: 3343

                                           ,'insert_material_line'
                                           ,g_pkg_name) THEN
          gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 3442

       gme_api_main.insert_material_line (
          p_validation_level    => p_validation_level
         ,p_init_msg_list       => p_init_msg_list
         ,x_message_count       => x_message_count
         ,x_message_list        => x_message_list
         ,x_return_status       => x_return_status
         ,p_batch_header_rec    => l_batch_header_rec
         ,p_material_detail_rec => l_material_detail_rec
         ,p_batch_step_rec      => l_batch_step_rec
         ,p_trans_id            => NULL
         ,x_transacted          => x_transacted
         ,x_material_detail_rec => x_material_detail_rec);
Line: 3480

          ROLLBACK TO SAVEPOINT insert_material_line;
Line: 3487

          ROLLBACK TO SAVEPOINT insert_material_line;
Line: 3493

    END insert_material_line;
Line: 3497

          update_material_line
        Description
          This procedure is used to update a material line

        Parameters
          p_batch_header_rec (R)          batch for which material line has to be updated
          p_material_detail_rec (R)       material line that has to be updated
          p_locator_code (O)              Default Consumption/Yield Locator Code
          p_org_code (O)                  organization code
          p_scale_phantom (O)             to scale phantom product only or total batch
          p_validate_flexfields (O)       Whether to validate the flexfields
          x_material_detail_rec           updated material detail record
          x_return_status                 outcome of the API call
                                          S - Success
                                          E - Error
                                          U - Unexpected Error
        HISTORY
         SivakumarG Bug#5078853 02-MAR-2006
          Procedure Created
      ================================================================================*/
    PROCEDURE update_material_line (
          p_api_version           IN           NUMBER := 2.0
         ,p_validation_level      IN           NUMBER := gme_common_pvt.g_max_errors
         ,p_init_msg_list         IN           VARCHAR2 DEFAULT fnd_api.g_false
         ,p_commit                IN           VARCHAR2 DEFAULT fnd_api.g_false
         ,p_batch_header_rec      IN           gme_batch_header%ROWTYPE
         ,p_material_detail_rec   IN           gme_material_details%ROWTYPE
         ,p_locator_code          IN           VARCHAR2
         ,p_org_code              IN           VARCHAR2
         ,p_scale_phantom         IN           VARCHAR2 DEFAULT fnd_api.g_false
         ,p_validate_flexfields   IN           VARCHAR2 DEFAULT fnd_api.g_false
         ,x_material_detail_rec   OUT NOCOPY   gme_material_details%ROWTYPE
         ,x_message_count         OUT NOCOPY   NUMBER
         ,x_message_list          OUT NOCOPY   VARCHAR2
         ,x_return_status         OUT NOCOPY   VARCHAR2 )
    IS
      /* get the locator id */
      CURSOR c_get_locator(v_org_id NUMBER,v_sub_inv VARCHAR2,v_locator VARCHAR2) IS
       SELECT inventory_location_id locator_id
         FROM mtl_item_locations_kfv
        WHERE organization_id = v_org_id
          AND subinventory_code = v_sub_inv
          AND concatenated_segments = v_locator;
Line: 3542

       SELECT batchstep_id
         FROM gme_batch_step_items
        WHERE material_detail_id = v_mat_id;
Line: 3546

      l_api_name                   CONSTANT VARCHAR2 (30) := 'UPDATE_MATERIAL_LINE';
Line: 3574

       SAVEPOINT update_material_line;
Line: 3579

                                           ,'update_material_line'
                                           ,g_pkg_name) THEN
          gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 3690

       gme_api_main.update_material_line (
          p_validation_level             => p_validation_level
         ,p_init_msg_list                => p_init_msg_list
         ,x_message_count                => x_message_count
         ,x_message_list                 => x_message_list
         ,x_return_status                => x_return_status
         ,p_batch_header_rec             => l_batch_header_rec
         ,p_material_detail_rec          => l_material_detail_rec
         ,p_stored_material_detail_rec   => l_stored_material_detail_rec
         ,p_batch_step_rec               => l_batch_step_rec
         ,p_scale_phantom                => p_scale_phantom
         ,p_trans_id                     => NULL
         ,x_transacted                   => x_transacted
         ,x_material_detail_rec          => x_material_detail_rec);
Line: 3732

          ROLLBACK TO SAVEPOINT update_material_line;
Line: 3739

          ROLLBACK TO SAVEPOINT update_material_line;
Line: 3745

    END update_material_line;
Line: 3749

          delete_material_line
        Description
          This procedure is used to delete a material line

        Parameters
          p_batch_header_rec (R)          batch for which material line has to be updated
          p_material_detail_rec (R)       material line that has to be updated
          p_org_code (O)                  organization code
          x_return_status                 outcome of the API call
                                          S - Success
                                          E - Error
                                          U - Unexpected Error
        HISTORY
         SivakumarG Bug#5078853 02-MAR-2006
          Procedure Created
    ================================================================================*/
    PROCEDURE delete_material_line (
          p_api_version           IN           NUMBER := 2.0
         ,p_validation_level      IN           NUMBER := gme_common_pvt.g_max_errors
         ,p_init_msg_list         IN           VARCHAR2 DEFAULT fnd_api.g_false
         ,p_commit                IN           VARCHAR2 DEFAULT fnd_api.g_false
         ,p_batch_header_rec      IN           gme_batch_header%ROWTYPE
         ,p_material_detail_rec   IN           gme_material_details%ROWTYPE
         ,p_org_code              IN           VARCHAR2
         ,x_message_count         OUT NOCOPY   NUMBER
         ,x_message_list          OUT NOCOPY   VARCHAR2
         ,x_return_status         OUT NOCOPY   VARCHAR2 )
    IS
      CURSOR c_get_step_id(v_mat_id NUMBER) IS
       SELECT batchstep_id
         FROM gme_batch_step_items
        WHERE material_detail_id = v_mat_id;
Line: 3782

      l_api_name         CONSTANT VARCHAR2 (30) := 'DELETE_MATERIAL_LINE';
Line: 3794

         gme_debug.log_initialize ('DELETE_MATERIAL_LINE');
Line: 3804

       SAVEPOINT delete_material_line;
Line: 3809

                                           ,'delete_material_line'
                                           ,g_pkg_name) THEN
          gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 3865

       gme_api_main.delete_material_line (
          p_validation_level    => p_validation_level
         ,p_init_msg_list       => p_init_msg_list
         ,x_message_count       => x_message_count
         ,x_message_list        => x_message_list
         ,x_return_status       => x_return_status
         ,p_batch_header_rec    => l_batch_header_rec
         ,p_material_detail_rec => l_material_detail_rec
         ,p_batch_step_rec      => l_batch_step_rec
         ,x_transacted          => x_transacted );
Line: 3887

          ROLLBACK TO SAVEPOINT delete_material_line;
Line: 3893

          ROLLBACK TO SAVEPOINT delete_material_line;
Line: 3898

    END delete_material_line;
Line: 4377

     ,p_delete_pending     IN              VARCHAR2 := fnd_api.g_false
     ,p_org_code           IN              VARCHAR2
     ,p_batch_no           IN              VARCHAR2
     ,x_batch_step_rec     OUT NOCOPY      gme_batch_steps%ROWTYPE)
   IS
      l_api_name      CONSTANT VARCHAR2 (30)              := 'CLOSE_STEP';
Line: 4465

                              ,p_delete_pending        => p_delete_pending
                              ,x_batch_step_rec        => x_batch_step_rec);
Line: 4917

         SELECT *
           FROM mtl_system_items_b
          WHERE inventory_item_id = v_item_id AND organization_id = v_org_id;
Line: 4923

         SELECT *
           FROM mtl_material_transactions
          WHERE transaction_set_id = v_header_id;
Line: 5256

   PROCEDURE update_material_txn (
      p_api_version           IN              NUMBER := 2.0
     ,p_validation_level      IN              NUMBER
            := gme_common_pvt.g_max_errors
     ,p_init_msg_list         IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                IN              VARCHAR2 := fnd_api.g_false
     ,x_message_count         OUT NOCOPY      NUMBER
     ,x_message_list          OUT NOCOPY      VARCHAR2
     ,x_return_status         OUT NOCOPY      VARCHAR2
     ,p_transaction_id        IN              NUMBER
     ,p_mmti_rec              IN              mtl_transactions_interface%ROWTYPE
     ,p_mmli_tbl              IN              gme_common_pvt.mtl_trans_lots_inter_tbl
     ,p_create_lot            IN              VARCHAR2 := NULL
     ,p_generate_lot          IN              VARCHAR2 := NULL
     ,p_generate_parent_lot   IN              VARCHAR2 := NULL
     ,x_mmt_rec               OUT NOCOPY      mtl_material_transactions%ROWTYPE
     ,x_mmln_tbl              OUT NOCOPY      gme_common_pvt.mtl_trans_lots_num_tbl)
   IS
      CURSOR cur_get_item_rec (v_item_id NUMBER, v_org_id NUMBER)
      IS
         SELECT *
           FROM mtl_system_items_b
          WHERE inventory_item_id = v_item_id AND organization_id = v_org_id;
Line: 5282

         SELECT *
           FROM mtl_material_transactions
          WHERE transaction_set_id = v_header_id;
Line: 5288

         SELECT organization_id, transaction_source_id, trx_source_line_id, transaction_type_id
           FROM mtl_material_transactions
          WHERE transaction_id = v_transaction_id;
Line: 5292

      l_api_name   CONSTANT VARCHAR2 (30)            := 'UPDATE_MATERIAL_TXN';
Line: 5317

      update_txn_fail       EXCEPTION;
Line: 5318

      update_txn_mismatch   EXCEPTION;
Line: 5321

         gme_debug.log_initialize ('UpdateTxn');
Line: 5330

      SAVEPOINT update_transaction;
Line: 5340

                                         ,'update_material_txn'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 5381

        RAISE update_txn_mismatch;
Line: 5523

      gme_transactions_pvt.update_material_txn
                                        (p_transaction_id      => p_transaction_id
                                        ,p_mmti_rec            => l_mmti_rec
                                        ,p_mmli_tbl            => l_mmli_tbl
                                        ,x_return_status       => l_return_status);
Line: 5550

         RAISE update_txn_fail;
Line: 5576

      WHEN update_txn_mismatch THEN
        ROLLBACK TO SAVEPOINT update_transaction;
Line: 5578

        gme_common_pvt.log_message('GME_TXN_UPDATE_MISMATCH');
Line: 5583

      WHEN update_txn_fail THEN
         ROLLBACK TO SAVEPOINT update_transaction;
Line: 5589

         ROLLBACK TO SAVEPOINT update_transaction;
Line: 5599

   END update_material_txn;
Line: 5602

   PROCEDURE delete_material_txn (
      p_api_version        IN              NUMBER := 2.0
     ,p_validation_level   IN              NUMBER
            := gme_common_pvt.g_max_errors
     ,p_init_msg_list      IN              VARCHAR2 := fnd_api.g_false
     ,p_commit             IN              VARCHAR2 := fnd_api.g_false
     ,x_message_count      OUT NOCOPY      NUMBER
     ,x_message_list       OUT NOCOPY      VARCHAR2
     ,x_return_status      OUT NOCOPY      VARCHAR2
     ,p_transaction_id     IN              NUMBER)
   IS
      l_api_name   CONSTANT VARCHAR2 (30)   := 'DELETE_MATERIAL_TXN';
Line: 5626

      delete_txn_fail       EXCEPTION;
Line: 5631

         SELECT organization_id
           FROM mtl_material_transactions
          WHERE transaction_id = v_transaction_id;
Line: 5636

         gme_debug.log_initialize ('DeleteTxn');
Line: 5645

      SAVEPOINT delete_transaction;
Line: 5656

                                         ,'delete_material_txn'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 5688

      gme_transactions_pvt.delete_material_txn
                                        (p_transaction_id      => l_transaction_id
                                        ,x_return_status       => x_return_status);
Line: 5707

         RAISE delete_txn_fail;
Line: 5715

      WHEN delete_txn_fail THEN
         ROLLBACK TO SAVEPOINT delete_transaction;
Line: 5721

         ROLLBACK TO SAVEPOINT delete_transaction;
Line: 5731

   END delete_material_txn;
Line: 6125

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

         SELECT reason_id
           FROM mtl_transaction_reasons
          WHERE NVL (disable_date, SYSDATE + 1) > SYSDATE
            AND reason_name = v_reason_name;
Line: 6362

         SELECT *
           FROM mtl_reservations
          WHERE reservation_id = v_reservation_id;
Line: 6541

   PROCEDURE insert_batchstep_resource (
      p_api_version              IN              NUMBER
     ,p_validation_level         IN              NUMBER
            := gme_common_pvt.g_max_errors
     ,p_init_msg_list            IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                   IN              VARCHAR2 := fnd_api.g_false
     ,p_batchstep_resource_rec   IN              gme_batch_step_resources%ROWTYPE
     ,p_org_code                 IN              VARCHAR2 := NULL
     ,p_batch_no                 IN              VARCHAR2 := NULL
     ,p_batchstep_no             IN              NUMBER := NULL
     ,p_activity                 IN              VARCHAR2 := NULL
     ,p_ignore_qty_below_cap     IN              VARCHAR2 := fnd_api.g_false
     ,p_validate_flexfields      IN              VARCHAR2 := fnd_api.g_false
     ,x_batchstep_resource_rec   OUT NOCOPY      gme_batch_step_resources%ROWTYPE
     ,x_message_count            OUT NOCOPY      NUMBER
     ,x_message_list             OUT NOCOPY      VARCHAR2
     ,x_return_status            OUT NOCOPY      VARCHAR2)
   IS
      l_api_name            CONSTANT VARCHAR2 (30)
                                               := 'INSERT_BATCHSTEP_RESOURCE';
Line: 6570

      l_delete_mark                  NUMBER;
Line: 6580

      insert_rsrc_failed             EXCEPTION;
Line: 6585

         SELECT batchstep_id, batch_id
           FROM gme_batch_step_activities
          WHERE batchstep_activity_id = v_activity_id;
Line: 6591

         SELECT 1
           FROM gme_batch_header a, gme_batch_step_activities b
          WHERE a.batch_id = b.batch_id
            AND b.batchstep_activity_id = v_activity_id
            AND a.batch_type = 10;
Line: 6599

         SELECT min_capacity, max_capacity, capacity_constraint, capacity_um
               ,usage_uom, delete_mark, capacity_tolerance
           FROM cr_rsrc_dtl
          WHERE resources = v_resources
                AND organization_id = v_organization_id;
Line: 6607

         SELECT min_capacity, max_capacity, capacity_constraint, capacity_um
               ,std_usage_uom, delete_mark, capacity_tolerance
           FROM cr_rsrc_mst
          WHERE resources = v_resources;
Line: 6614

         SELECT step_status
           FROM gme_batch_steps
          WHERE batch_id = v_batch_id AND batchstep_id = v_batchstep_id;
Line: 6619

         gme_debug.log_initialize ('InsertBatchstepResource');
Line: 6628

      SAVEPOINT insert_batchstep_rsrc;
Line: 6636

                                         ,'insert_batchstep_resource'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 6793

           ,l_capacity_um, l_usage_uom, l_delete_mark, l_capacity_tolerance;
Line: 6800

              ,l_capacity_um, l_usage_uom, l_delete_mark
              ,l_capacity_tolerance;
Line: 6807

         IF cur_get_rsrc_hdr%NOTFOUND OR l_delete_mark = 1 THEN
            CLOSE cur_get_rsrc_dtl;
Line: 6871

             ,p_action                      => 'INSERT'
             ,x_batchstep_resource_rec      => l_batchstep_resource_rec_out
             ,x_step_status                 => l_step_status
             ,x_return_status               => l_return_status);
Line: 6920

                             || ' invoke private layer insert_batchstep_rsrc');
Line: 6923

      gme_batchstep_rsrc_pvt.insert_batchstep_rsrc
                        (p_batchstep_resource_rec      => l_batchstep_resource_rec
                        ,x_batchstep_resource_rec      => x_batchstep_resource_rec
                        ,x_return_status               => x_return_status);
Line: 6930

         insert_batchstep_rsrc returns '|| x_return_status);
Line: 6955

         RAISE insert_rsrc_failed;
Line: 6968

      WHEN insert_rsrc_failed THEN
         ROLLBACK TO SAVEPOINT insert_batchstep_rsrc;
Line: 6975

         ROLLBACK TO SAVEPOINT insert_batchstep_rsrc;
Line: 6980

        ROLLBACK TO SAVEPOINT insert_batchstep_rsrc;
Line: 6985

   END insert_batchstep_resource;
Line: 6988

   PROCEDURE update_batchstep_resource (
      p_api_version              IN              NUMBER
     ,p_validation_level         IN              NUMBER   := gme_common_pvt.g_max_errors
     ,p_init_msg_list            IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                   IN              VARCHAR2 := fnd_api.g_false
     ,p_batchstep_resource_rec   IN              gme_batch_step_resources%ROWTYPE
     ,p_org_code                 IN              VARCHAR2 := NULL
     ,p_batch_no                 IN              VARCHAR2 := NULL
     ,p_batchstep_no             IN              NUMBER := NULL
     ,p_activity                 IN              VARCHAR2 := NULL
     ,p_ignore_qty_below_cap     IN              VARCHAR2 := fnd_api.g_false
     ,p_validate_flexfields      IN              VARCHAR2 := fnd_api.g_false
     ,x_batchstep_resource_rec   OUT NOCOPY      gme_batch_step_resources%ROWTYPE
     ,x_message_count            OUT NOCOPY      NUMBER
     ,x_message_list             OUT NOCOPY      VARCHAR2
     ,x_return_status            OUT NOCOPY      VARCHAR2)
   IS
      l_api_name             CONSTANT VARCHAR2 (30)
                                               := 'UPDATE_BATCHSTEP_RESOURCE';
Line: 7018

         SELECT step_status
           FROM gme_batch_steps
          WHERE batchstep_id = v_batchstep_id AND batch_id = v_batch_id;
Line: 7022

      update_rsrc_failed              EXCEPTION;
Line: 7025

      SAVEPOINT update_batchstep_rsrc;
Line: 7028

         gme_debug.log_initialize ('UpdateBatchstepResource');
Line: 7042

                                         ,'update_batchstep_resource'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 7059

      /* Retrieve the row to be updated              */
      IF g_debug <= gme_debug.g_log_statement THEN
         gme_debug.put_line (   g_pkg_name
                             || '.'
                             || l_api_name
                             || 'Invoke get_batchstep_rsrc');
Line: 7086

      /* Don't overwrite any other input data which carries the updates    */
      l_batchstep_resource_rec.organization_id :=
                                  l_batchstep_resource_rec_out.organization_id;
Line: 7183

             ,p_action                      => 'UPDATE'
             ,x_batchstep_resource_rec      => l_batchstep_resource_rec_out
             ,x_step_status                 => l_step_status
             ,x_return_status               => l_return_status);
Line: 7206

                       || ' Invoke gme_batchstep_rsrc_pvt.update_batchstep_rsrc');
Line: 7209

      gme_batchstep_rsrc_pvt.update_batchstep_rsrc
                        (p_batchstep_resource_rec      => l_batchstep_resource_rec
                        ,x_batchstep_resource_rec      => x_batchstep_resource_rec
                        ,x_return_status               => x_return_status);
Line: 7218

                             || ' update_batchstep_rsrc returns '
                             || x_return_status);
Line: 7249

         RAISE update_rsrc_failed;
Line: 7262

      WHEN update_rsrc_failed THEN
         ROLLBACK TO SAVEPOINT update_batchstep_rsrc;
Line: 7269

         ROLLBACK TO SAVEPOINT update_batchstep_rsrc;
Line: 7274

         ROLLBACK TO SAVEPOINT update_batchstep_rsrc;
Line: 7279

   END update_batchstep_resource;
Line: 7282

   PROCEDURE delete_batchstep_resource (
      p_api_version             IN              NUMBER := 2.0
     ,p_validation_level        IN              NUMBER
            := gme_common_pvt.g_max_errors
     ,p_init_msg_list           IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                  IN              VARCHAR2 := fnd_api.g_false
     ,p_batchstep_resource_id   IN              NUMBER := NULL
     ,p_org_code                IN              VARCHAR2 := NULL
     ,p_batch_no                IN              VARCHAR2 := NULL
     ,p_batchstep_no            IN              NUMBER := NULL
     ,p_activity                IN              VARCHAR2 := NULL
     ,p_resource                IN              VARCHAR2 := NULL
     ,x_message_count           OUT NOCOPY      NUMBER
     ,x_message_list            OUT NOCOPY      VARCHAR2
     ,x_return_status           OUT NOCOPY      VARCHAR2)
   IS
      l_api_name        CONSTANT VARCHAR2 (30) := 'DELETE_BATCHSTEP_RESOURCE';
Line: 7312

         SELECT c.organization_id, a.step_status, a.batch_id, a.batchstep_id
               ,b.batchstep_activity_id, c.batch_status
           FROM gme_batch_steps a
               ,gme_batch_step_resources b
               ,gme_batch_header c
          WHERE a.batch_id = b.batch_id
            AND a.batchstep_id = b.batchstep_id
            AND b.batchstep_resource_id = v_batchstep_rsrc_id
            AND a.batch_id = c.batch_id;
Line: 7324

         SELECT 1
           FROM gme_batch_header a, gme_batch_step_resources b
          WHERE a.batch_id = b.batch_id
            AND b.batchstep_resource_id = v_rsrc_id
            AND a.batch_type = 10;
Line: 7330

      delete_rsrc_failed         EXCEPTION;
Line: 7333

      SAVEPOINT delete_batchstep_rsrc;
Line: 7336

         gme_debug.log_initialize ('DeleteBatchstepResource');
Line: 7350

                                         ,'delete_batchstep_resource'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 7529

         			' invoke gme_batchstep_rsrc_pvt.delete_batchstep_rsrc ');
Line: 7542

      gme_batchstep_rsrc_pvt.delete_batchstep_rsrc
                        (p_batchstep_resource_rec      => l_batchstep_resource_rec
                        ,x_return_status               => x_return_status);
Line: 7548

         			status from delete is ' || x_return_status);
Line: 7573

         RAISE delete_rsrc_failed;
Line: 7585

      WHEN delete_rsrc_failed THEN
         ROLLBACK TO SAVEPOINT delete_batchstep_rsrc;
Line: 7592

         ROLLBACK TO SAVEPOINT delete_batchstep_rsrc;
Line: 7597

         ROLLBACK TO SAVEPOINT delete_batchstep_rsrc;
Line: 7602

   END delete_batchstep_resource;
Line: 7628

         SELECT *
           FROM mtl_reservations
          WHERE reservation_id = v_reservation_id;
Line: 7894

     /* Verify that update_inventory is permitted for this batch */
     IF l_batch_header_rec.update_inventory_ind <> 'Y' THEN
       gme_common_pvt.log_message ('GME_INVENTORY_UPDATE_BLOCKED');
Line: 7970

      insert_batchstep_activity
    Description
      This procedure is used to insert an activity for a step

    Parameters
      p_batchstep_activity_rec (R)    activity to be inserted for a step
      p_batchstep_resource_tbl (R) one or more resources to be inserted for the activity
      p_org_code (O)              organization code
      p_batch_no (O)              batch number
      p_batchstep_no(O)           batch step number
      p_ignore_qty_below_cap (O)  controls - allow rsrc_qty going below rsrc capacity
      p_validate_flexfield (O)    Whether to validate the flexfields
      x_batchstep_activity_rec        newly inserted activity row, can be used for update etc
      x_return_status             outcome of the API call
                                  S - Success
                                  E - Error
                                  U - Unexpected Error
    HISTORY
     Sivakumar.G FPBug#4395561 16-NOV-2005
     Code changes made to set global flex field validate flag
  ================================================================================*/
   PROCEDURE insert_batchstep_activity (
      p_api_version              IN              NUMBER ,
      p_validation_level         IN              NUMBER
            := gme_common_pvt.g_max_errors,
      p_init_msg_list            IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      p_commit                   IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      p_org_code                 IN              VARCHAR2,
      p_batchstep_activity_rec   IN              gme_batch_step_activities%ROWTYPE,
      p_batchstep_resource_tbl   IN              gme_create_step_pvt.resources_tab,
      p_batch_no                 IN              VARCHAR2 := NULL,
      p_batchstep_no             IN              NUMBER := NULL,
      p_ignore_qty_below_cap     IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      p_validate_flexfield       IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      x_batchstep_activity_rec   OUT NOCOPY      gme_batch_step_activities%ROWTYPE,
      x_message_count            OUT NOCOPY      NUMBER,
      x_message_list             OUT NOCOPY      VARCHAR2,
      x_return_status            OUT NOCOPY      VARCHAR2
   )
   IS
      l_api_name            CONSTANT VARCHAR2 (30) := 'INSERT_BATCHSTEP_ACTIVITY';
Line: 8016

      insert_activity_failed         EXCEPTION;
Line: 8019

      SAVEPOINT insert_activity_pub;
Line: 8023

         gme_debug.log_initialize ('InsertBatchstepActivity');
Line: 8066

      gme_batchstep_act_pvt.insert_batchstep_activity (p_batchstep_activity_rec      => p_batchstep_activity_rec,
                                                       p_batchstep_resource_tbl      => p_batchstep_resource_tbl,
                                                       p_org_code                    => p_org_code,
                                                       p_batch_no                    => p_batch_no,
                                                       p_batchstep_no                => p_batchstep_no,
                                                       p_ignore_qty_below_cap        => p_ignore_qty_below_cap,
                                                       p_validate_flexfield          => p_validate_flexfield,
                                                       x_batchstep_activity_rec      => x_batchstep_activity_rec,
                                                       x_return_status               => x_return_status
                                                      );
Line: 8080

         RAISE insert_activity_failed;
Line: 8101

      WHEN insert_activity_failed THEN
         ROLLBACK TO SAVEPOINT insert_activity_pub;
Line: 8108

         ROLLBACK TO SAVEPOINT insert_activity_pub;
Line: 8115

         ROLLBACK TO SAVEPOINT insert_activity_pub;
Line: 8120

   END insert_batchstep_activity;
Line: 8124

      update_batchstep_activity
    Description
      This procedure is used to update an activity for a step

    Parameters
      p_batchstep_activity (R)    activity to be updated
      p_org_code (O)              organization code
      p_batch_no (O)              batch number
      p_batchstep_no(O)           batch step number
      p_validate_flexfield (O)    Whether to validate the flexfields
      x_batchstep_activity        updated activity row
      x_return_status             outcome of the API call
                                  S - Success
                                  E - Error
                                  U - Unexpected Error
   HISTORY
     Sivakumar.G FPBug#4395561 16-NOV-2005
     Code changes made to set global flex field validate flag
  ================================================================================*/
   PROCEDURE update_batchstep_activity (
      p_api_version              IN              NUMBER ,
      p_validation_level         IN              NUMBER
            := gme_common_pvt.g_max_errors,
      p_init_msg_list            IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      p_commit                   IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      p_org_code                 IN              VARCHAR2,
      p_batchstep_activity_rec   IN              gme_batch_step_activities%ROWTYPE,
      p_batch_no                 IN              VARCHAR2 := NULL,
      p_batchstep_no             IN              NUMBER := NULL,
      p_validate_flexfield       IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      x_batchstep_activity_rec   OUT NOCOPY      gme_batch_step_activities%ROWTYPE,
      x_message_count            OUT NOCOPY      NUMBER,
      x_message_list             OUT NOCOPY      VARCHAR2,
      x_return_status            OUT NOCOPY      VARCHAR2
   )
   IS
      l_api_name   CONSTANT  VARCHAR2 (30) := 'UPDATE_BATCHSTEP_ACTIVITY';
Line: 8164

      update_activity_failed EXCEPTION;
Line: 8167

      SAVEPOINT update_activity_pub;
Line: 8170

         gme_debug.log_initialize ('UpdateBatchstepActivity');
Line: 8210

      gme_batchstep_act_pvt.update_batchstep_activity (p_batchstep_activity_rec      => p_batchstep_activity_rec,
                                                       p_org_code                    => p_org_code,
                                                       p_batch_no                    => p_batch_no,
                                                       p_batchstep_no                => p_batchstep_no,
                                                       p_validate_flexfield          => p_validate_flexfield,
                                                       x_batchstep_activity_rec      => x_batchstep_activity_rec,
                                                       x_return_status               => x_return_status
                                                      );
Line: 8222

         RAISE update_activity_failed;
Line: 8242

     WHEN update_activity_failed THEN
         ROLLBACK TO SAVEPOINT update_activity_pub;
Line: 8249

         ROLLBACK TO SAVEPOINT update_activity_pub;
Line: 8256

         ROLLBACK TO SAVEPOINT update_activity_pub;
Line: 8261

   END update_batchstep_activity;
Line: 8265

      delete_batchstep_activity
    Description
      This procedure is used to delete an activity from a step.  Note that either the
      activity_id must be provided or the combination of organization_code, batch_no, batchstep_no,
      and activity in order to uniquely identify an activity to be deleted.

    Parameters
      p_batchstep_activity_id (O) activity_id to be deleted
      p_org_code (O)              organization code
      p_batch_no (O)              batch number
      p_batchstep_no(O)           batch step number
      p_activity(O)               activity
      x_return_status             outcome of the API call
                                  S - Success
                                  E - Error
                                  U - Unexpected Error
  ================================================================================*/
   PROCEDURE delete_batchstep_activity (
      p_api_version             IN              NUMBER := 2.0,
      p_validation_level        IN              NUMBER
            := gme_common_pvt.g_max_errors,
      p_init_msg_list           IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      p_commit                  IN              VARCHAR2
            DEFAULT fnd_api.g_false,
      p_org_code                IN              VARCHAR2,
      p_batchstep_activity_id   IN              NUMBER := NULL,
      p_batch_no                IN              VARCHAR2 := NULL,
      p_batchstep_no            IN              NUMBER := NULL,
      p_activity                IN              VARCHAR2 := NULL,
      x_message_count           OUT NOCOPY      NUMBER,
      x_message_list            OUT NOCOPY      VARCHAR2,
      x_return_status           OUT NOCOPY      VARCHAR2
   )
   IS
      l_api_name   CONSTANT  VARCHAR2 (30) := 'DELETE_BATCHSTEP_ACTIVITY';
Line: 8302

      delete_activity_failed EXCEPTION;
Line: 8305

      SAVEPOINT delete_activity_pub;
Line: 8341

      gme_batchstep_act_pvt.delete_batchstep_activity (p_batchstep_activity_id      => p_batchstep_activity_id,
                                                       p_org_code                   => p_org_code,
                                                       p_batch_no                   => p_batch_no,
                                                       p_batchstep_no               => p_batchstep_no,
                                                       p_activity                   => p_activity,
                                                       x_return_status              => x_return_status
                                                      );
Line: 8349

         RAISE delete_activity_failed;
Line: 8370

      WHEN delete_activity_failed THEN
         ROLLBACK TO SAVEPOINT delete_activity_pub;
Line: 8377

         ROLLBACK TO SAVEPOINT delete_activity_pub;
Line: 8384

          ROLLBACK TO SAVEPOINT delete_activity_pub;
Line: 8389

   END delete_batchstep_activity;
Line: 8778

      update_pending_product_lot
    Description
      This procedure is used to update a pending product lot record for a specified
      pending product lot record
      Following key sequences can be specified:
      pending_product_lot_id OR
      batch_id, line_no, line_type, sequence OR
      batch_no, org_code, line_no, line_type, sequence (batch_type is assumed to be Batch)

    Parameters
      p_batch_header_rec (O)      batch header record
      p_org_code (O)              organization code
      p_material_detail_rec (O)   material detail record
      p_pending_product_lots_rec (R) pending product lots record
      x_return_status             outcome of the API call
                                  S - Success
                                  E - Error
                                  U - Unexpected Error
  ================================================================================*/

  PROCEDURE update_pending_product_lot
     (p_api_version              IN              NUMBER
     ,p_validation_level         IN              NUMBER
            := gme_common_pvt.g_max_errors
     ,p_init_msg_list            IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                   IN              VARCHAR2 := fnd_api.g_false
     ,x_message_count            OUT NOCOPY      NUMBER
     ,x_message_list             OUT NOCOPY      VARCHAR2
     ,x_return_status            OUT NOCOPY      VARCHAR2
     ,p_batch_header_rec         IN              gme_batch_header%ROWTYPE
     ,p_org_code                 IN              VARCHAR2
     ,p_material_detail_rec      IN              gme_material_details%ROWTYPE
     ,p_pending_product_lots_rec IN              gme_pending_product_lots%ROWTYPE
     ,x_pending_product_lots_rec OUT NOCOPY      gme_pending_product_lots%ROWTYPE)
   IS
      l_api_name           CONSTANT VARCHAR2 (30)  := 'UPDATE_PENDING_PRODUCT_LOT';
Line: 8824

      error_update_pp_lot        EXCEPTION;
Line: 8827

         gme_debug.log_initialize ('UpdatePendingProdLot');
Line: 8839

      SAVEPOINT update_pending_product_lot;
Line: 8847

                                         ,'update_pending_prod_lot'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 8911

      gme_pending_product_lots_pvt.validate_material_for_update
                        (p_batch_header_rec          => l_batch_header_rec
                        ,p_material_detail_rec       => l_material_detail_rec
                        ,x_return_status             => x_return_status);
Line: 8920

      gme_pending_product_lots_pvt.validate_record_for_update
                        (p_material_detail_rec             => l_material_detail_rec
                        ,p_db_pending_product_lots_rec     => l_db_pending_product_lots_rec
                        ,p_pending_product_lots_rec        => p_pending_product_lots_rec
                        ,x_pending_product_lots_rec        => l_pending_product_lots_rec
                        ,x_return_status                   => x_return_status);
Line: 8932

      gme_api_main.update_pending_product_lot
                         (p_validation_level            => p_validation_level
                         ,p_init_msg_list               => fnd_api.g_false
                         ,x_message_count               => x_message_count
                         ,x_message_list                => x_message_list
                         ,x_return_status               => x_return_status
                         ,p_org_id                      => l_batch_header_rec.organization_id
                         ,p_pending_product_lots_rec    => l_pending_product_lots_rec
                         ,x_pending_product_lots_rec    => x_pending_product_lots_rec);
Line: 8948

             || ' Return status from gme_api_main.update_pending_product_lot is '
             || x_return_status);
Line: 8953

         RAISE error_update_pp_lot;
Line: 8992

      WHEN error_update_pp_lot THEN
         ROLLBACK TO SAVEPOINT update_pending_product_lot;
Line: 8999

         ROLLBACK TO SAVEPOINT update_pending_product_lot;
Line: 9006

        ROLLBACK TO SAVEPOINT update_pending_product_lot;
Line: 9012

   END update_pending_product_lot;
Line: 9016

      Delete_pending_product_lot
    Description
      This procedure is used to delete a pending product lot record for a specified
      pending product lot record
      Following key sequences can be specified:
      pending_product_lot_id OR
      batch_id, line_no, line_type, sequence OR
      batch_no, org_code, line_no, line_type, sequence (batch_type is assumed to be Batch)

    Parameters
      p_batch_header_rec (O)      batch header record
      p_org_code (O)              organization code
      p_material_detail_rec (O)   material detail record
      p_pending_product_lots_rec (R) pending product lots record
      x_return_status             outcome of the API call
                                  S - Success
                                  E - Error
                                  U - Unexpected Error
  ================================================================================*/

  PROCEDURE delete_pending_product_lot
     (p_api_version              IN              NUMBER
     ,p_validation_level         IN              NUMBER
            := gme_common_pvt.g_max_errors
     ,p_init_msg_list            IN              VARCHAR2 := fnd_api.g_false
     ,p_commit                   IN              VARCHAR2 := fnd_api.g_false
     ,x_message_count            OUT NOCOPY      NUMBER
     ,x_message_list             OUT NOCOPY      VARCHAR2
     ,x_return_status            OUT NOCOPY      VARCHAR2
     ,p_batch_header_rec         IN              gme_batch_header%ROWTYPE
     ,p_org_code                 IN              VARCHAR2
     ,p_material_detail_rec      IN              gme_material_details%ROWTYPE
     ,p_pending_product_lots_rec IN              gme_pending_product_lots%ROWTYPE)
   IS
      l_api_name           CONSTANT VARCHAR2 (30)  := 'DELETE_PENDING_PRODUCT_LOT';
Line: 9066

      error_delete_pp_lot        EXCEPTION;
Line: 9070

         gme_debug.log_initialize ('DeletePendingProdLot');
Line: 9082

      SAVEPOINT delete_pending_product_lot;
Line: 9090

                                         ,'delete_pending_prod_lot'
                                         ,g_pkg_name) THEN
         gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
Line: 9152

      gme_pending_product_lots_pvt.validate_material_for_delete
                        (p_batch_header_rec          => l_batch_header_rec
                        ,p_material_detail_rec       => l_material_detail_rec
                        ,x_return_status             => x_return_status);
Line: 9161

      gme_pending_product_lots_pvt.validate_record_for_delete
                        (p_material_detail_rec             => l_material_detail_rec
                        ,p_db_pending_product_lots_rec     => l_db_pending_product_lots_rec
                        ,p_pending_product_lots_rec        => p_pending_product_lots_rec
                        ,x_pending_product_lots_rec        => l_pending_product_lots_rec
                        ,x_return_status                   => x_return_status);
Line: 9173

      gme_api_main.delete_pending_product_lot
                         (p_validation_level            => p_validation_level
                         ,p_init_msg_list               => fnd_api.g_false
                         ,x_message_count               => x_message_count
                         ,x_message_list                => x_message_list
                         ,x_return_status               => x_return_status
                         ,p_org_id                      => l_batch_header_rec.organization_id
                         ,p_pending_product_lots_rec    => l_pending_product_lots_rec);
Line: 9188

             || ' Return status from gme_api_main.delete_pending_product_lot is '
             || x_return_status);
Line: 9193

         RAISE error_delete_pp_lot;
Line: 9233

      WHEN error_delete_pp_lot THEN
         ROLLBACK TO SAVEPOINT delete_pending_product_lot;
Line: 9239

         ROLLBACK TO SAVEPOINT delete_pending_product_lot;
Line: 9245

        ROLLBACK TO SAVEPOINT delete_pending_product_lot;
Line: 9250

   END delete_pending_product_lot;
Line: 10574

         SELECT organization_id
           FROM mtl_parameters
          WHERE organization_code = p_org_code;
Line: 10580

         SELECT group_id
           FROM gme_batch_groups_b
          WHERE organization_id = l_org_id AND group_name = l_group_name;
Line: 10586

         SELECT lookup_code FROM gem_lookups
         WHERE lookup_type = 'GME_BATCH_GROUP_ACTION'
         AND lookup_code = l_lookup_code
         AND lookup_code NOT IN (1,2);
Line: 10593

         SELECT batch_id
         FROM gme_batch_groups_association
         WHERE group_id = l_group_id;
Line: 10599

         SELECT batch_status
         FROM gme_batch_header
         WHERE batch_id = l_batch_id
         and organization_id = l_org_id;