DBA Data[Home] [Help]

APPS.GMD_RECIPE_DETAIL SQL Statements

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

Line: 13

  /*   inserting a recipe */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Create_Recipe_Process_loss */
  /* Type         : Public */
  /* Function     : */
  /* parameters   : */
  /* IN           :       p_api_version IN NUMBER   Required */
  /*                      p_init_msg_list IN Varchar2 Optional */
  /*                      p_commit     IN Varchar2  Optional */
  /*                      p_recipe_tbl IN Required */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
  /*                      x_msg_count        OUT NOCOPY Number */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
  /* */
  /* Version :  Current Version 1.0 */
  /* */
  /* Notes  :   p_called_from_forms parameter not currently used */
  /*            originally included for returning error messages */
  /* */
  /* End of comments */

   PROCEDURE CREATE_RECIPE_PROCESS_LOSS
   ( p_api_version           IN  NUMBER
    ,p_init_msg_list         IN  VARCHAR2 := FND_API.G_FALSE
    ,p_commit                IN  VARCHAR2 := FND_API.G_FALSE
    ,p_called_from_forms     IN  VARCHAR2 := 'NO'
    ,x_return_status         OUT NOCOPY      VARCHAR2
    ,x_msg_count             OUT NOCOPY      NUMBER
    ,x_msg_data              OUT NOCOPY      VARCHAR2
    ,p_recipe_detail_tbl     IN              recipe_detail_tbl
   ) IS
     /*  Defining all local variables */
     l_api_name              CONSTANT    VARCHAR2(30)        := 'CREATE_RECIPE_PROCESS_LOSS';
Line: 70

     SAVEPOINT  Insert_Recipe_Process_loss;
Line: 198

          ROLLBACK to Insert_Recipe_Process_loss;
Line: 204

     	 ROLLBACK to Insert_Recipe_Process_loss;
Line: 211

          ROLLBACK to Insert_Recipe_Process_loss;
Line: 226

   /*   inserting a recipe */
   /* */
   /* =============================================  */
   /* Start of commments */
   /* API name     : Create_Recipe_Customers */
   /* Type         : Public */
   /* Function     : */
   /* Parameters   : */
   /* IN           :       p_api_version IN NUMBER   Required */
   /*                      p_init_msg_list IN Varchar2 Optional */
   /*                      p_commit     IN Varchar2  Optional */
   /*                      p_recipe_tbl IN Required */
   /* */
   /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
   /*                      x_msg_count        OUT NOCOPY Number */
   /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
   /* */
   /* Version :  Current Version 1.0 */
   /* */
   /* Notes  : p_called_from_forms parameter not currently used   */
   /*            originally included for returning error messages */
   /* */
   /* End of comments */

   PROCEDURE CREATE_RECIPE_CUSTOMERS
   (p_api_version           IN          NUMBER                       ,
    p_init_msg_list         IN          VARCHAR2 := FND_API.G_FALSE  ,
    p_commit                IN          VARCHAR2 := FND_API.G_FALSE  ,
    p_called_from_forms     IN          VARCHAR2 := 'NO'             ,
    x_return_status         OUT NOCOPY  VARCHAR2                     ,
    x_msg_count             OUT NOCOPY  NUMBER                       ,
    x_msg_data              OUT NOCOPY  VARCHAR2                     ,
    p_recipe_detail_tbl     IN          recipe_detail_tbl
   ) IS
     /*  Defining all local variables */
     l_api_name              CONSTANT    VARCHAR2(30)        := 'CREATE_RECIPE_CUSTOMERS';
Line: 285

     SAVEPOINT  Insert_Recipe_Customers;
Line: 462

          ROLLBACK to Insert_Recipe_Customers;
Line: 469

     	  ROLLBACK to Insert_Recipe_Customers;
Line: 476

          ROLLBACK to Insert_Recipe_Customers;
Line: 490

  /*   inserting a recipe */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Create_Recipe_VR */
  /* Type         : Public */
  /* Function     : */
  /* parameters   : */
  /* IN           :       p_api_version IN NUMBER   Required */
  /*                      p_init_msg_list IN Varchar2 Optional */
  /*                      p_commit     IN Varchar2  Optional */
  /*                      p_recipe_tbl IN Required */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
  /*                      x_msg_count        OUT NOCOPY Number */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
  /* */
  /* Version :  Current Version 1.0 */
  /* */
  /* Notes  :   p_called_from_forms parameter not currently used */
  /*            originally included for returning error messages */
  /*   kkillams 23-03-2004 Added call to modify_status to set recipe   */
  /*                       status to default status if default status is*/
  /*                       defined organization level w.r.t. bug 3408799*/
  /* */
  /* End of comments */

  PROCEDURE CREATE_RECIPE_VR
  ( p_api_version           IN             NUMBER
   ,p_init_msg_list         IN             VARCHAR2 := FND_API.G_FALSE
   ,p_commit                IN             VARCHAR2 := FND_API.G_FALSE
   ,p_called_from_forms     IN             VARCHAR2 := 'NO'
   ,x_return_status         OUT NOCOPY     VARCHAR2
   ,x_msg_count             OUT NOCOPY     NUMBER
   ,x_msg_data              OUT NOCOPY     VARCHAR2
   ,p_recipe_vr_tbl         IN             recipe_vr_tbl
   ,p_recipe_vr_flex        IN             recipe_flex
  ) IS

    /*  Define all variables specific to this procedure */
    l_api_name              CONSTANT    VARCHAR2(30)        := 'CREATE_RECIPE_VR';
Line: 558

    SELECT inventory_item_id, qty, detail_uom
      FROM   fm_matl_dtl f, gmd_recipes_b r
      WHERE  f.formula_id = r.formula_id
      AND    r.recipe_id  = vRecipe_id
      AND    f.line_type = 1
      AND    f.line_no   = 1;
Line: 567

      SELECT qty, detail_uom
      FROM   fm_matl_dtl f, gmd_recipes_b r
      WHERE  f.formula_id = r.formula_id
      AND    r.recipe_id  = vRecipe_id
      AND    f.line_type IN  (1,2)
      AND    f.inventory_item_id = vItem_id
      AND    rownum = 1;
Line: 578

      SELECT primary_uom_code
      FROM   mtl_system_items
      WHERE  inventory_item_id = vItem_id;
Line: 584

     SELECT rt.Effective_Start_Date,
            rt.Effective_End_Date
     FROM   gmd_routings_b rt, gmd_recipes_b rc
     WHERE  rc.routing_id = rt.routing_id AND
            rc.recipe_id  = vRecipe_id AND
            rt.delete_mark = 0;
Line: 592

      SELECT 1
      FROM   sys.dual
      WHERE  EXISTS (Select h.formula_id
                     From  fm_form_mst h, gmd_recipes_b r
                     WHERE r.formula_id = h.formula_id AND
                           r.recipe_id  = vRecipe_id AND
                           h.scale_type = 0);
Line: 604

    Recipe_VR_insert_failure     EXCEPTION;
Line: 610

                SELECT uom_code
                  FROM mtl_units_of_measure_vl
                 WHERE uom_code = vDetail_uom;
Line: 616

    SAVEPOINT  Insert_Recipe_VR;
Line: 678

              RAISE Recipe_VR_insert_failure;
Line: 688

         RAISE Recipe_VR_insert_failure;
Line: 698

           RAISE Recipe_VR_insert_failure;
Line: 737

            RAISE Recipe_VR_insert_failure;
Line: 763

          RAISE Recipe_VR_insert_failure;
Line: 777

            RAISE Recipe_VR_insert_failure;
Line: 786

            RAISE Recipe_VR_insert_failure;
Line: 801

      /* Insert into the recipe validity rules table */
      gmd_recipe_detail_pvt.pkg_recipe_validity_rule_id :=  NULL;
Line: 808

          RAISE Recipe_VR_insert_failure;
Line: 849

          ROLLBACK to Insert_Recipe_VR;
Line: 855

     WHEN setup_failure OR Recipe_VR_insert_failure THEN
     	  ROLLBACK to Insert_Recipe_VR;
Line: 872

              ROLLBACK to Insert_Recipe_VR;
Line: 879

          ROLLBACK to Insert_Recipe_VR;
Line: 894

  /*   inserting a recipe */
  /* */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Create_Recipe_Mtl */
  /* Type         : Public */
  /* Function     : */
  /* parameters   : */
  /* IN           :       p_api_version IN NUMBER   Required */
  /*                      p_init_msg_list IN Varchar2 Optional */
  /*                      p_commit     IN Varchar2  Optional */
  /*                      p_recipe_tbl IN Required */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
  /*                      x_msg_count        OUT NOCOPY Number */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
  /* */
  /* Version :  Current Version 1.0 */
  /* */
  /* Notes  :   p_called_from_forms parameter not currently used */
  /*            originally included for returning error messages */
  /* */
  /* End of comments */

   PROCEDURE CREATE_RECIPE_MTL
   (  p_api_version         IN  NUMBER                          ,
      p_init_msg_list       IN  VARCHAR2 := FND_API.G_FALSE     ,
      p_commit              IN  VARCHAR2 := FND_API.G_FALSE     ,
      p_called_from_forms   IN  VARCHAR2 := 'NO'                ,
      x_return_status       OUT NOCOPY  VARCHAR2                ,
      x_msg_count           OUT NOCOPY  NUMBER                  ,
      x_msg_data            OUT NOCOPY  VARCHAR2                ,
      p_recipe_mtl_tbl      IN          recipe_mtl_tbl		,
      p_recipe_mtl_flex     IN          recipe_flex
   ) IS
     /*  Define all variables specific to this procedure */
     l_api_name              CONSTANT    VARCHAR2(30)        := 'CREATE_RECIPE_MTL';
Line: 954

  	SELECT line_type
		FROM   fm_matl_dtl f
		WHERE f.FORMULALINE_ID= cp_formulaline_id;
Line: 960

     insert_rcp_mat_failure  EXCEPTION;
Line: 965

     SAVEPOINT  Insert_Recipe_Materials;
Line: 1038

           RAISE insert_rcp_mat_failure;
Line: 1051

            RAISE insert_rcp_mat_failure;
Line: 1068

            RAISE insert_rcp_mat_failure;
Line: 1071

        /* Validations so as to insert minimum_transfer_qty,minimum_delay,maximum_delay. Bug : 10109808 */
        /*  Minimum_delay
Line: 1110

        /* END of Validations so as to insert minimum_transfer_qty,minimum_delay,maximum_delay. Bug : 10109808 */
        /* ======================================= */

        /* Insert into the recipe materials table */
        IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
            GMD_RECIPE_DETAIL_PVT.create_recipe_mtl (p_recipe_mtl_rec => p_recipe_mtl_rec
            					    ,p_recipe_mtl_flex_rec => p_recipe_mtl_flex_rec
                                                    ,x_return_status => x_return_status);
Line: 1119

              RAISE insert_rcp_mat_failure;
Line: 1136

       ROLLBACK to Insert_Recipe_Materials;
Line: 1141

     WHEN setup_failure OR insert_rcp_mat_failure THEN
       ROLLBACK to Insert_Recipe_Materials;
Line: 1149

       ROLLBACK to Insert_Recipe_Materials;
Line: 1156

       ROLLBACK to Insert_Recipe_Materials;
Line: 1163

       ROLLBACK to Insert_Recipe_Materials;
Line: 1174

  /*   Update_Recipe_Process_Loss */
  /* */
  /* DESCRIPTION: */
  /*   This PL/SQL procedure is responsible for  */
  /*   updating recipe process loss */
  /* */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Update_Recipe_Process_loss */
  /* Type         : Public */
  /* Function     : */
  /* parameters   : */
  /* IN           :       p_api_version         IN NUMBER   Required */
  /*                      p_init_msg_list       IN Varchar2 Optional */
  /*                      p_commit              IN Varchar2  Optional */
  /*                      p_recipe_detail_tbl   IN Required */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
  /*                      x_msg_count        OUT NOCOPY Number */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
  /* */
  /* Version :  Current Version 1.0 */
  /* */
  /* Notes  :   p_called_from_forms parameter not currently used */
  /*            originally included for returning error messages */
  /* */
  /* End of comments */

  PROCEDURE UPDATE_RECIPE_PROCESS_LOSS
   (p_api_version           IN      NUMBER                          ,
    p_init_msg_list         IN      VARCHAR2 := FND_API.G_FALSE     ,
    p_commit                IN      VARCHAR2 := FND_API.G_FALSE     ,
    p_called_from_forms     IN      VARCHAR2 := 'NO'                ,
    x_return_status         OUT NOCOPY      VARCHAR2                ,
    x_msg_count             OUT NOCOPY      NUMBER                  ,
    x_msg_data              OUT NOCOPY      VARCHAR2                ,
    p_recipe_detail_tbl     IN      recipe_detail_tbl
   ) IS
      /*  Defining all local variables */
     l_api_name              CONSTANT    VARCHAR2(30)        := 'UPDATE_RECIPE_PROCESS_LOSS';
Line: 1228

       Select *
       From   gmd_recipe_process_loss
       Where  Recipe_process_loss_id = VProcess_loss_id;
Line: 1236

     update_pr_loss_failure  EXCEPTION;
Line: 1240

     SAVEPOINT  Update_Recipe_Process_loss;
Line: 1279

        /* For updates we expect the surrogate  */
        /* key to be provided */
        /* ================================== */
        IF (p_recipe_detail_rec.recipe_process_loss_id IS NULL) THEN
           FND_MESSAGE.SET_NAME ('GMI', 'GMI_MISSING');
Line: 1286

           RAISE update_pr_loss_failure;
Line: 1342

           RAISE update_pr_loss_failure;
Line: 1346

           RAISE update_pr_loss_failure;
Line: 1349

        /* Update into the recipe process loss table */
        IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
          GMD_RECIPE_DETAIL_PVT.update_recipe_process_loss (p_recipe_detail_rec => p_recipe_detail_rec
                                                           ,x_return_status => x_return_status);
Line: 1354

            RAISE update_pr_loss_failure;
Line: 1371

       ROLLBACK to Update_Recipe_Process_loss;
Line: 1377

     WHEN setup_failure OR update_pr_loss_failure THEN
       x_return_status := FND_API.G_RET_STS_ERROR;
Line: 1379

       ROLLBACK to Update_Recipe_Process_loss;
Line: 1385

       ROLLBACK to Update_Recipe_Process_loss;
Line: 1392

   END UPDATE_RECIPE_PROCESS_LOSS;
Line: 1396

  /*   Update_Recipe_Customers */
  /* */
  /* DESCRIPTION: */
  /*   This PL/SQL procedure is responsible for  */
  /*   updating recipe process loss */
  /* */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Update_Recipe_Customers */
  /* Type         : Public */
  /* Function     : */
  /* parameters   : */
  /* IN           :       p_api_version         IN NUMBER   Required */
  /*                      p_init_msg_list       IN Varchar2 Optional */
  /*                      p_commit              IN Varchar2  Optional */
  /*                      p_recipe_detail_tbl   IN Required */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
  /*                      x_msg_count        OUT NOCOPY Number */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
  /* */
  /* Version :  Current Version 1.0 */
  /* */
  /* Notes  :   p_called_from_forms parameter not currently used */
  /*            originally included for returning error messages */
  /* */
  /* End of comments */

   PROCEDURE UPDATE_RECIPE_CUSTOMERS
   (p_api_version           IN          NUMBER                      ,
    p_init_msg_list         IN          VARCHAR2 := FND_API.G_FALSE ,
    p_commit                IN          VARCHAR2 := FND_API.G_FALSE ,
    p_called_from_forms     IN          VARCHAR2 := 'NO'            ,
    x_return_status         OUT NOCOPY  VARCHAR2                    ,
    x_msg_count             OUT NOCOPY  NUMBER                      ,
    x_msg_data              OUT NOCOPY  VARCHAR2                    ,
    p_recipe_detail_tbl     IN          recipe_detail_tbl
   ) IS
    /*  Defining all local variables */
    l_api_name              CONSTANT    VARCHAR2(30)        := 'UPDATE_RECIPE_CUSTOMERS';
Line: 1455

      Select text_code
      from   gmd_recipe_customers
      where  recipe_id   = rc_id
        and  customer_id = cust_id;
Line: 1464

    update_rcp_cust_failure EXCEPTION;
Line: 1468

     SAVEPOINT  Update_Recipe_Customers;
Line: 1525

              RAISE update_rcp_cust_failure;
Line: 1535

           RAISE update_rcp_cust_failure;
Line: 1553

             RAISE update_rcp_cust_failure;
Line: 1559

        /* Only updateable field is text code */
        IF (p_recipe_detail_rec.text_Code IS NULL) THEN
           OPEN  get_rc_text_code(p_recipe_detail_rec.recipe_id,
                                 p_recipe_detail_rec.customer_id);
Line: 1569

        /* Update the recipe customer table */
        /* only who columns needs to be updated */
        IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
          GMD_RECIPE_DETAIL_PVT.update_recipe_customers (p_recipe_detail_rec => p_recipe_detail_rec
                                                        ,x_return_status => x_return_status);
Line: 1575

            RAISE update_rcp_cust_failure;
Line: 1591

         ROLLBACK to Update_Recipe_Customers;
Line: 1597

     WHEN setup_failure OR update_rcp_cust_failure THEN
     	 ROLLBACK to Update_Recipe_Customers;
Line: 1605

         ROLLBACK to Update_Recipe_Customers;
Line: 1612

   END UPDATE_RECIPE_CUSTOMERS;
Line: 1616

  /*   Update_Recipe_VR */
  /* */
  /* DESCRIPTION: */
  /*   This PL/SQL procedure is responsible for  */
  /*   updating recipe Validity Rules */
  /* */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Update_Recipe_VR */
  /* Type         : Public */
  /* Function     : */
  /* parameters   : */
  /* IN           :       p_api_version         IN NUMBER   Required */
  /*                      p_init_msg_list       IN Varchar2 Optional */
  /*                      p_commit              IN Varchar2  Optional */
  /*                      p_recipe_detail_tbl   IN Required */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
  /*                      x_msg_count        OUT NOCOPY Number */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
  /* */
  /* Version :  Current Version 1.0 */
  /* */
  /* Notes  :   p_called_from_forms parameter not currently used */
  /*            originally included for returning error messages */
  /* */
  /* End of comments */
   PROCEDURE UPDATE_RECIPE_VR
   ( p_api_version           IN         NUMBER
    ,p_init_msg_list         IN         VARCHAR2 := FND_API.G_FALSE
    ,p_commit                IN         VARCHAR2 := FND_API.G_FALSE
    ,p_called_from_forms     IN         VARCHAR2 := 'NO'
    ,x_return_status         OUT NOCOPY VARCHAR2
    ,x_msg_count             OUT NOCOPY NUMBER
    ,x_msg_data              OUT NOCOPY VARCHAR2
    ,p_recipe_vr_tbl         IN         recipe_vr_tbl
    ,p_recipe_update_flex    IN         recipe_update_flex
   ) IS
     /*  Define all variables specific to this procedure */
     l_api_name              CONSTANT    VARCHAR2(30)        := 'UPDATE_RECIPE_VR';
Line: 1673

     p_flex_update_rec       UPDATE_FLEX;
Line: 1675

     l_flex_update_rec       update_flex;
Line: 1677

     /* Define a cursor for dealing with updates  */
     CURSOR Flex_cur(vRecipe_VR_id NUMBER) IS
        SELECT attribute_category, attribute1, attribute2, attribute3, attribute4,
               attribute5, attribute6, attribute7, attribute8, attribute9, attribute10,
               attribute11, attribute12, attribute13, attribute14, attribute15,
               attribute16, attribute17, attribute18, attribute19, attribute20,
               attribute21, attribute22, attribute23, attribute24,attribute25,
               attribute26, attribute27, attribute28, attribute29, attribute30
        FROM   gmd_recipe_validity_rules
        WHERE  Recipe_Validity_Rule_id = NVL(vRecipe_VR_id,-1);
Line: 1689

     /* Define a cursor for dealing with updates  */
     CURSOR update_vr_cur(vRecipe_VR_id NUMBER) IS
        SELECT recipe_id, orgn_code, end_date, planned_process_loss
        FROM   gmd_recipe_validity_rules
        WHERE  Recipe_Validity_Rule_id = NVL(vRecipe_VR_id,-1);
Line: 1697

       SELECT inventory_item_id
       FROM   mtl_system_items_kfv
       WHERE  concatenated_segments = pItem_no;
Line: 1702

     Update_VR_Failure       EXCEPTION;
Line: 1709

                SELECT uom_code
                  FROM mtl_units_of_measure_vl
                 WHERE uom_code = vDetail_uom;
Line: 1715

     SAVEPOINT  Update_Recipe_VR;
Line: 1757

            RAISE Update_VR_Failure;
Line: 1777

         /* as the user is intending to update the field to NULL */
         FOR update_rec IN update_vr_Cur(p_recipe_vr_rec.recipe_validity_rule_id) LOOP
           IF (p_recipe_vr_rec.orgn_code = FND_API.G_MISS_CHAR) THEN
               p_recipe_vr_rec.orgn_code := NULL;
Line: 1782

               p_recipe_vr_rec.orgn_code := update_rec.orgn_code;
Line: 1788

               p_recipe_vr_rec.planned_process_loss := update_rec.planned_process_loss;
Line: 1794

               p_recipe_vr_rec.end_date := update_rec.end_date;
Line: 1798

               p_recipe_vr_rec.recipe_id := update_rec.recipe_id;
Line: 1807

            RAISE Update_VR_Failure;
Line: 1812

            RAISE Update_VR_Failure;
Line: 1820

            RAISE Update_VR_Failure;
Line: 1835

               RAISE Update_VR_Failure;
Line: 1841

         FETCH   Flex_cur INTO l_flex_update_rec;
Line: 1844

         /* If no flex field is updated retain the old values */
         IF (p_recipe_update_flex.count = 0) THEN
            p_flex_update_rec    := l_flex_update_rec;
Line: 1848

            p_flex_update_rec    := p_recipe_update_flex(i);
Line: 1851

         IF (p_flex_update_rec.attribute1 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute1 := NULL;
Line: 1853

         ELSIF (p_flex_update_rec.attribute1 IS NULL) THEN
             p_flex_update_rec.attribute1 := l_flex_update_rec.attribute1;
Line: 1857

         IF (p_flex_update_rec.attribute2 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute2 := NULL;
Line: 1859

         ELSIF (p_flex_update_rec.attribute2 IS NULL) THEN
             p_flex_update_rec.attribute2 := l_flex_update_rec.attribute2;
Line: 1863

         IF (p_flex_update_rec.attribute3 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute3 := NULL;
Line: 1865

         ELSIF (p_flex_update_rec.attribute3 IS NULL) THEN
             p_flex_update_rec.attribute3 := l_flex_update_rec.attribute3;
Line: 1869

         IF (p_flex_update_rec.attribute4 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute4 := NULL;
Line: 1871

         ELSIF (p_flex_update_rec.attribute4 IS NULL) THEN
             p_flex_update_rec.attribute4 := l_flex_update_rec.attribute4;
Line: 1875

         IF (p_flex_update_rec.attribute5 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute5 := NULL;
Line: 1877

         ELSIF (p_flex_update_rec.attribute5 IS NULL) THEN
             p_flex_update_rec.attribute5 := l_flex_update_rec.attribute5;
Line: 1881

         IF (p_flex_update_rec.attribute6 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute6 := NULL;
Line: 1883

         ELSIF (p_flex_update_rec.attribute6 IS NULL) THEN
             p_flex_update_rec.attribute6 := l_flex_update_rec.attribute6;
Line: 1887

         IF (p_flex_update_rec.attribute7 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute7 := NULL;
Line: 1889

         ELSIF (p_flex_update_rec.attribute7 IS NULL) THEN
             p_flex_update_rec.attribute7 := l_flex_update_rec.attribute7;
Line: 1893

         IF (p_flex_update_rec.attribute8 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute8 := NULL;
Line: 1895

         ELSIF (p_flex_update_rec.attribute8 IS NULL) THEN
             p_flex_update_rec.attribute8 := l_flex_update_rec.attribute8;
Line: 1899

         IF (p_flex_update_rec.attribute9 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute9 := NULL;
Line: 1901

         ELSIF (p_flex_update_rec.attribute9 IS NULL) THEN
             p_flex_update_rec.attribute9 := l_flex_update_rec.attribute9;
Line: 1905

         IF (p_flex_update_rec.attribute10 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute10 := NULL;
Line: 1907

         ELSIF (p_flex_update_rec.attribute10 IS NULL) THEN
             p_flex_update_rec.attribute10 := l_flex_update_rec.attribute10;
Line: 1911

         IF (p_flex_update_rec.attribute11 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute11 := NULL;
Line: 1913

         ELSIF (p_flex_update_rec.attribute11 IS NULL) THEN
             p_flex_update_rec.attribute11 := l_flex_update_rec.attribute11;
Line: 1917

         IF (p_flex_update_rec.attribute12 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute12 := NULL;
Line: 1919

         ELSIF (p_flex_update_rec.attribute12 IS NULL) THEN
             p_flex_update_rec.attribute12 := l_flex_update_rec.attribute12;
Line: 1923

         IF (p_flex_update_rec.attribute13 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute13 := NULL;
Line: 1925

         ELSIF (p_flex_update_rec.attribute13 IS NULL) THEN
             p_flex_update_rec.attribute13 := l_flex_update_rec.attribute13;
Line: 1929

         IF (p_flex_update_rec.attribute14 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute14 := NULL;
Line: 1931

         ELSIF (p_flex_update_rec.attribute14 IS NULL) THEN
             p_flex_update_rec.attribute14 := l_flex_update_rec.attribute14;
Line: 1935

         IF (p_flex_update_rec.attribute15 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute15 := NULL;
Line: 1937

         ELSIF (p_flex_update_rec.attribute15 IS NULL) THEN
             p_flex_update_rec.attribute15 := l_flex_update_rec.attribute15;
Line: 1941

         IF (p_flex_update_rec.attribute16 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute16 := NULL;
Line: 1943

         ELSIF (p_flex_update_rec.attribute16 IS NULL) THEN
             p_flex_update_rec.attribute16 := l_flex_update_rec.attribute16;
Line: 1947

         IF (p_flex_update_rec.attribute17 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute17 := NULL;
Line: 1949

         ELSIF (p_flex_update_rec.attribute17 IS NULL) THEN
             p_flex_update_rec.attribute17 := l_flex_update_rec.attribute17;
Line: 1953

         IF (p_flex_update_rec.attribute18 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute18 := NULL;
Line: 1955

         ELSIF (p_flex_update_rec.attribute18 IS NULL) THEN
             p_flex_update_rec.attribute18 := l_flex_update_rec.attribute18;
Line: 1959

         IF (p_flex_update_rec.attribute19 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute19 := NULL;
Line: 1961

         ELSIF (p_flex_update_rec.attribute19 IS NULL) THEN
             p_flex_update_rec.attribute19 := l_flex_update_rec.attribute19;
Line: 1965

         IF (p_flex_update_rec.attribute20 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute20 := NULL;
Line: 1967

         ELSIF (p_flex_update_rec.attribute20 IS NULL) THEN
             p_flex_update_rec.attribute20 := l_flex_update_rec.attribute20;
Line: 1971

         IF (p_flex_update_rec.attribute21 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute21 := NULL;
Line: 1973

         ELSIF (p_flex_update_rec.attribute21 IS NULL) THEN
             p_flex_update_rec.attribute21 := l_flex_update_rec.attribute21;
Line: 1977

         IF (p_flex_update_rec.attribute22 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute22 := NULL;
Line: 1979

         ELSIF (p_flex_update_rec.attribute22 IS NULL) THEN
             p_flex_update_rec.attribute22 := l_flex_update_rec.attribute22;
Line: 1983

         IF (p_flex_update_rec.attribute23 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute23 := NULL;
Line: 1985

         ELSIF (p_flex_update_rec.attribute23 IS NULL) THEN
             p_flex_update_rec.attribute23 := l_flex_update_rec.attribute23;
Line: 1989

         IF (p_flex_update_rec.attribute24 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute24 := NULL;
Line: 1991

         ELSIF (p_flex_update_rec.attribute24 IS NULL) THEN
             p_flex_update_rec.attribute24 := l_flex_update_rec.attribute24;
Line: 1995

         IF (p_flex_update_rec.attribute25 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute25 := NULL;
Line: 1997

         ELSIF (p_flex_update_rec.attribute25 IS NULL) THEN
             p_flex_update_rec.attribute25 := l_flex_update_rec.attribute25;
Line: 2001

         IF (p_flex_update_rec.attribute26 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute26 := NULL;
Line: 2003

         ELSIF (p_flex_update_rec.attribute26 IS NULL) THEN
             p_flex_update_rec.attribute26 := l_flex_update_rec.attribute26;
Line: 2007

         IF (p_flex_update_rec.attribute27 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute27 := NULL;
Line: 2009

         ELSIF (p_flex_update_rec.attribute27 IS NULL) THEN
             p_flex_update_rec.attribute27 := l_flex_update_rec.attribute27;
Line: 2013

         IF (p_flex_update_rec.attribute28 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute28 := NULL;
Line: 2015

         ELSIF (p_flex_update_rec.attribute28 IS NULL) THEN
             p_flex_update_rec.attribute28 := l_flex_update_rec.attribute28;
Line: 2019

         IF (p_flex_update_rec.attribute29 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute29 := NULL;
Line: 2021

         ELSIF (p_flex_update_rec.attribute29 IS NULL) THEN
             p_flex_update_rec.attribute29 := l_flex_update_rec.attribute29;
Line: 2025

         IF (p_flex_update_rec.attribute30 = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute30 := NULL;
Line: 2027

         ELSIF (p_flex_update_rec.attribute30 IS NULL) THEN
             p_flex_update_rec.attribute30 := l_flex_update_rec.attribute30;
Line: 2031

         IF (p_flex_update_rec.attribute_category = FND_API.G_MISS_CHAR) THEN
             p_flex_update_rec.attribute_category := NULL;
Line: 2033

         ELSIF (p_flex_update_rec.attribute_category IS NULL) THEN
             p_flex_update_rec.attribute_category := l_flex_update_rec.attribute_category;
Line: 2037

         /* Update recipe validity rules table */
         GMD_RECIPE_DETAIL_PVT.UPDATE_RECIPE_VR(p_recipe_vr_rec => p_recipe_vr_rec
                                                 ,p_flex_update_rec => p_flex_update_rec
                                                 ,x_return_status => x_return_status);
Line: 2042

           RAISE Update_VR_Failure;
Line: 2046

         WHEN Update_VR_Failure THEN
           x_return_status := FND_API.G_RET_STS_ERROR;
Line: 2059

     END LOOP; -- Loops thro all VR that needs to be updated
Line: 2069

       ROLLBACK to Update_Recipe_VR;
Line: 2075

       ROLLBACK to Update_Recipe_VR;
Line: 2082

       ROLLBACK to Update_Recipe_VR;
Line: 2089

   END UPDATE_RECIPE_VR;
Line: 2098

  /*   inserting and updating recipe Routing steps */
  /* */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Recipe_Routing_Steps */
  /* Type         : Public */
  /* Function     : */
  /* parameters   : */
  /*          p_called_from_forms parameter not currently used          */
  /*          originally included for returning error messages          */
  /* IN           :       p_api_version         IN NUMBER   Required        */
  /*                      p_init_msg_list       IN Varchar2 Optional        */
  /*                      p_commit              IN Varchar2  Optional       */
  /*                      p_recipe_detail_tbl   IN Required             */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1)            */
  /*                      x_msg_count        OUT NOCOPY Number                 */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000)         */
  /* */
  /* Version :  Current Version 1.1                                     */
  /* */
  /* Notes  : 24Jul2001  L.R.Jackson Added mass and volume fields.      */
  /*                     Changed routing step id validation             */
  /*                     Increased the version to 1.1                   */
  /*                     Removed the detail record.  Just use table(i)  */
  /*                     Removed check of user id/user name. There is   */
  /*                      no userid in this table.  WHO columns are     */
  /*                      passed in, not derived here.                  */
  /*                     Changed call to RECIPE_NAME to RECIPE_EXISTS.  */
  /* */
  /* End of comments */

   PROCEDURE RECIPE_ROUTING_STEPS
   (    p_api_version           IN         NUMBER                       ,
        p_init_msg_list         IN         VARCHAR2 := FND_API.G_FALSE  ,
        p_commit                IN         VARCHAR2 := FND_API.G_FALSE  ,
        p_called_from_forms     IN         VARCHAR2 := 'NO'             ,
        x_return_status         OUT NOCOPY VARCHAR2                     ,
        x_msg_count             OUT NOCOPY NUMBER                       ,
        x_msg_data              OUT NOCOPY VARCHAR2                     ,
        p_recipe_detail_tbl     IN         recipe_detail_tbl            ,
        p_recipe_insert_flex    IN         recipe_flex                  ,
        p_recipe_update_flex    IN         recipe_update_flex
   ) IS

        /*  Define all variables specific to this procedure */
        l_api_name    CONSTANT    VARCHAR2(30)  := 'RECIPE_ROUTING_STEPS';
Line: 2161

        /* flex field records for inserts and updates */
        p_flex_insert_rec            flex;
Line: 2163

        p_flex_update_rec            update_flex;
Line: 2166

        l_flex_update_rec            update_flex;
Line: 2168

        /* Define a cursor for dealing with updates  */
        CURSOR Flex_cur(vRecipe_id NUMBER, vRoutingStep_id NUMBER) IS
          Select attribute_category, attribute1, attribute2, attribute3, attribute4,
                 attribute5, attribute6, attribute7, attribute8, attribute9, attribute10,
                 attribute11, attribute12, attribute13, attribute14, attribute15,
                 attribute16, attribute17, attribute18, attribute19, attribute20,
                 attribute21, attribute22, attribute23, attribute24,attribute25,
                 attribute26, attribute27, attribute28, attribute29, attribute30
          From   gmd_recipe_routing_steps
         where   recipe_id = NVL(vRecipe_id,-1) AND
                 RoutingStep_id = NVL(vRoutingStep_id,-1);
Line: 2180

        CURSOR update_rt_cur(vRecipe_id NUMBER, vRoutingStep_id NUMBER) IS
          Select mass_qty, volume_qty, mass_std_uom, volume_std_uom
          From   gmd_recipe_routing_steps
         where   recipe_id = NVL(vRecipe_id,-1) AND
                 RoutingStep_id = NVL(vRoutingStep_id,-1);
Line: 2189

        /* Updating recipe routing step for first time is in fact inserting a new record */
        /* in gmd_recipe_routing_step table.  [Form initially shows values from          */
        /* fm_rout_dtl.  When user "changes" values, they are saved in recipe table.]    */

        /*  Define Savepoint */
        SAVEPOINT  Recipe_Routing_Steps;
Line: 2273

          IF (p_recipe_insert_flex.count = 0) THEN
             p_flex_insert_rec  := NULL;
Line: 2276

             p_flex_insert_rec  := p_recipe_insert_flex(i);
Line: 2279

          FOR update_rec IN update_rt_cur(p_recipe_detail_rec.recipe_id,
                                          p_recipe_detail_tbl(i).routingstep_id)
          LOOP

             IF (p_recipe_detail_rec.mass_qty = FND_API.G_MISS_NUM) THEN
                 p_recipe_detail_rec.mass_qty := NULL;
Line: 2286

                 p_recipe_detail_rec.mass_qty := update_rec.mass_qty;
Line: 2292

                 p_recipe_detail_rec.volume_qty := update_rec.volume_qty;
Line: 2298

                 p_recipe_detail_rec.mass_std_uom := update_rec.mass_std_uom;
Line: 2304

                 p_recipe_detail_rec.volume_std_uom := update_rec.volume_std_uom;
Line: 2311

          FETCH Flex_cur INTO l_flex_update_rec;
Line: 2313

             /* If no flex field is updated retain the old values */
             IF (p_recipe_update_flex.count = 0) THEN
                 p_flex_update_rec      := l_flex_update_rec;
Line: 2317

                 p_flex_update_rec      := p_recipe_update_flex(i);
Line: 2328

             /* as the user is intending to update the field to NULL */
             IF (p_flex_update_rec.attribute1 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute1 := NULL;
Line: 2331

             ELSIF (p_flex_update_rec.attribute1 IS NULL) THEN
                 p_flex_update_rec.attribute1 := l_flex_update_rec.attribute1;
Line: 2335

             IF (p_flex_update_rec.attribute2 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute2 := NULL;
Line: 2337

             ELSIF (p_flex_update_rec.attribute2 IS NULL) THEN
                 p_flex_update_rec.attribute2 := l_flex_update_rec.attribute2;
Line: 2341

             IF (p_flex_update_rec.attribute3 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute3 := NULL;
Line: 2343

             ELSIF (p_flex_update_rec.attribute3 IS NULL) THEN
                 p_flex_update_rec.attribute3 := l_flex_update_rec.attribute3;
Line: 2347

             IF (p_flex_update_rec.attribute4 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute4 := NULL;
Line: 2349

             ELSIF (p_flex_update_rec.attribute4 IS NULL) THEN
                 p_flex_update_rec.attribute4 := l_flex_update_rec.attribute4;
Line: 2353

             IF (p_flex_update_rec.attribute5 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute5 := NULL;
Line: 2355

             ELSIF (p_flex_update_rec.attribute5 IS NULL) THEN
                 p_flex_update_rec.attribute5 := l_flex_update_rec.attribute5;
Line: 2359

             IF (p_flex_update_rec.attribute6 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute6 := NULL;
Line: 2361

             ELSIF (p_flex_update_rec.attribute6 IS NULL) THEN
                 p_flex_update_rec.attribute6 := l_flex_update_rec.attribute6;
Line: 2365

             IF (p_flex_update_rec.attribute7 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute7 := NULL;
Line: 2367

             ELSIF (p_flex_update_rec.attribute7 IS NULL) THEN
                 p_flex_update_rec.attribute7 := l_flex_update_rec.attribute7;
Line: 2371

             IF (p_flex_update_rec.attribute8 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute8 := NULL;
Line: 2373

             ELSIF (p_flex_update_rec.attribute8 IS NULL) THEN
                 p_flex_update_rec.attribute8 := l_flex_update_rec.attribute8;
Line: 2377

             IF (p_flex_update_rec.attribute9 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute9 := NULL;
Line: 2379

             ELSIF (p_flex_update_rec.attribute9 IS NULL) THEN
                 p_flex_update_rec.attribute9 := l_flex_update_rec.attribute9;
Line: 2383

             IF (p_flex_update_rec.attribute10 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute10 := NULL;
Line: 2385

             ELSIF (p_flex_update_rec.attribute10 IS NULL) THEN
                 p_flex_update_rec.attribute10 := l_flex_update_rec.attribute10;
Line: 2389

             IF (p_flex_update_rec.attribute11 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute11 := NULL;
Line: 2391

             ELSIF (p_flex_update_rec.attribute11 IS NULL) THEN
                 p_flex_update_rec.attribute11 := l_flex_update_rec.attribute11;
Line: 2395

             IF (p_flex_update_rec.attribute12 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute12 := NULL;
Line: 2397

             ELSIF (p_flex_update_rec.attribute12 IS NULL) THEN
                 p_flex_update_rec.attribute12 := l_flex_update_rec.attribute12;
Line: 2401

             IF (p_flex_update_rec.attribute13 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute13 := NULL;
Line: 2403

             ELSIF (p_flex_update_rec.attribute13 IS NULL) THEN
                 p_flex_update_rec.attribute13 := l_flex_update_rec.attribute13;
Line: 2407

             IF (p_flex_update_rec.attribute14 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute14 := NULL;
Line: 2409

             ELSIF (p_flex_update_rec.attribute14 IS NULL) THEN
                 p_flex_update_rec.attribute14 := l_flex_update_rec.attribute14;
Line: 2413

             IF (p_flex_update_rec.attribute15 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute15 := NULL;
Line: 2415

             ELSIF (p_flex_update_rec.attribute15 IS NULL) THEN
                 p_flex_update_rec.attribute15 := l_flex_update_rec.attribute15;
Line: 2419

             IF (p_flex_update_rec.attribute16 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute16 := NULL;
Line: 2421

             ELSIF (p_flex_update_rec.attribute16 IS NULL) THEN
                 p_flex_update_rec.attribute16 := l_flex_update_rec.attribute16;
Line: 2425

             IF (p_flex_update_rec.attribute17 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute17 := NULL;
Line: 2427

             ELSIF (p_flex_update_rec.attribute17 IS NULL) THEN
                 p_flex_update_rec.attribute17 := l_flex_update_rec.attribute17;
Line: 2431

             IF (p_flex_update_rec.attribute18 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute18 := NULL;
Line: 2433

             ELSIF (p_flex_update_rec.attribute18 IS NULL) THEN
                 p_flex_update_rec.attribute18 := l_flex_update_rec.attribute18;
Line: 2437

             IF (p_flex_update_rec.attribute19 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute19 := NULL;
Line: 2439

             ELSIF (p_flex_update_rec.attribute19 IS NULL) THEN
                 p_flex_update_rec.attribute19 := l_flex_update_rec.attribute19;
Line: 2443

             IF (p_flex_update_rec.attribute20 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute20 := NULL;
Line: 2445

             ELSIF (p_flex_update_rec.attribute20 IS NULL) THEN
                 p_flex_update_rec.attribute20 := l_flex_update_rec.attribute20;
Line: 2449

             IF (p_flex_update_rec.attribute21 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute21 := NULL;
Line: 2451

             ELSIF (p_flex_update_rec.attribute21 IS NULL) THEN
                 p_flex_update_rec.attribute21 := l_flex_update_rec.attribute21;
Line: 2455

             IF (p_flex_update_rec.attribute22 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute22 := NULL;
Line: 2457

             ELSIF (p_flex_update_rec.attribute22 IS NULL) THEN
                 p_flex_update_rec.attribute22 := l_flex_update_rec.attribute22;
Line: 2461

             IF (p_flex_update_rec.attribute23 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute23 := NULL;
Line: 2463

             ELSIF (p_flex_update_rec.attribute23 IS NULL) THEN
                 p_flex_update_rec.attribute23 := l_flex_update_rec.attribute23;
Line: 2467

             IF (p_flex_update_rec.attribute24 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute24 := NULL;
Line: 2469

             ELSIF (p_flex_update_rec.attribute24 IS NULL) THEN
                 p_flex_update_rec.attribute24 := l_flex_update_rec.attribute24;
Line: 2473

             IF (p_flex_update_rec.attribute25 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute25 := NULL;
Line: 2475

             ELSIF (p_flex_update_rec.attribute25 IS NULL) THEN
                 p_flex_update_rec.attribute25 := l_flex_update_rec.attribute25;
Line: 2479

             IF (p_flex_update_rec.attribute26 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute26 := NULL;
Line: 2481

             ELSIF (p_flex_update_rec.attribute26 IS NULL) THEN
                 p_flex_update_rec.attribute26 := l_flex_update_rec.attribute26;
Line: 2485

             IF (p_flex_update_rec.attribute27 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute27 := NULL;
Line: 2487

             ELSIF (p_flex_update_rec.attribute27 IS NULL) THEN
                 p_flex_update_rec.attribute27 := l_flex_update_rec.attribute27;
Line: 2491

             IF (p_flex_update_rec.attribute28 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute28 := NULL;
Line: 2493

             ELSIF (p_flex_update_rec.attribute28 IS NULL) THEN
                 p_flex_update_rec.attribute28 := l_flex_update_rec.attribute28;
Line: 2497

             IF (p_flex_update_rec.attribute29 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute29 := NULL;
Line: 2499

             ELSIF (p_flex_update_rec.attribute29 IS NULL) THEN
                 p_flex_update_rec.attribute29 := l_flex_update_rec.attribute29;
Line: 2503

             IF (p_flex_update_rec.attribute30 = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute30 := NULL;
Line: 2505

             ELSIF (p_flex_update_rec.attribute30 IS NULL) THEN
                 p_flex_update_rec.attribute30 := l_flex_update_rec.attribute30;
Line: 2509

             IF (p_flex_update_rec.attribute_category = FND_API.G_MISS_CHAR) THEN
                 p_flex_update_rec.attribute_category := NULL;
Line: 2511

             ELSIF (p_flex_update_rec.attribute_category IS NULL) THEN
                 p_flex_update_rec.attribute_category := l_flex_update_rec.attribute_category;
Line: 2521

                                                        ,p_flex_insert_rec => p_flex_insert_rec
                                                        ,p_flex_update_rec => p_flex_update_rec
                                                        ,x_return_status => x_return_status);
Line: 2571

  /*   inserting and updating recipe orgn activities */
  /* */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Recipe_Orgn_operations */
  /* Type         : Public */
  /* Function     : */
  /* Parameters   : */
  /* IN           :       p_api_version         IN NUMBER   Required */
  /*                      p_init_msg_list       IN Varchar2 Optional */
  /*                      p_commit              IN Varchar2  Optional */
  /*                      p_recipe_detail_tbl   IN Required */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
  /*                      x_msg_count        OUT NOCOPY Number */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
  /* */
  /* Version :  Current Version 1.0 */
  /* */
  /* Notes  :     p_called_from_forms parameter not currently used          */
  /*              originally included for returning error messages          */
  /* */
  /* End of comments */
  PROCEDURE RECIPE_ORGN_OPERATIONS
  (     p_api_version           IN      NUMBER                          ,
        p_init_msg_list         IN      VARCHAR2 := FND_API.G_FALSE     ,
        p_commit                IN      VARCHAR2 := FND_API.G_FALSE     ,
        p_called_from_forms     IN      VARCHAR2 := 'NO'                ,
        x_return_status         OUT NOCOPY      VARCHAR2                        ,
        x_msg_count             OUT NOCOPY      NUMBER                          ,
        x_msg_data              OUT NOCOPY      VARCHAR2                        ,
        p_recipe_detail_tbl     IN      recipe_detail_tbl               ,
        p_recipe_insert_flex    IN      recipe_flex                     ,
        p_recipe_update_flex    IN      recipe_update_flex
  )  IS

       /*  Define all variables specific to this procedure */
        l_api_name              CONSTANT    VARCHAR2(30)        := 'RECIPE_ORGN_OPERATIONS';
Line: 2625

        /* flex field records for inserts and updates */
        p_flex_insert_rec       flex;
Line: 2627

        p_flex_update_rec       update_flex;
Line: 2630

        l_flex_update_rec       update_flex;
Line: 2632

        /* Define a cursor for dealing with updates  */
        CURSOR Flex_cur(vRecipe_Id NUMBER, vRoutingstep_Id NUMBER,
                        vOprn_Line_Id Number, vOrgn_id NUMBER) IS
                Select  attribute_category, attribute1, attribute2, attribute3, attribute4,
                        attribute5, attribute6, attribute7, attribute8, attribute9, attribute10,
                        attribute11, attribute12, attribute13, attribute14, attribute15,
                        attribute16, attribute17, attribute18, attribute19, attribute20,
                        attribute21, attribute22, attribute23, attribute24,attribute25,
                        attribute26, attribute27, attribute28, attribute29, attribute30
                From    gmd_recipe_orgn_activities
                where   recipe_id       = NVL(vRecipe_id,-1)    AND
                        RoutingStep_id  = NVL(vRoutingStep_id,-1) AND
                        oprn_line_id    = NVL(vOprn_line_id,-1) AND
                        organization_id  = vOrgn_id;
Line: 2650

        /* Updating recipe orgn activity for forst time infact insert a new record in  */
        /* gmd_recipe_orgn activities table */

        /*  Define Savepoint */
        SAVEPOINT  Recipe_Orgn_Activities;
Line: 2744

      IF (p_recipe_insert_flex.count = 0) THEN
         p_flex_insert_rec      := NULL;
Line: 2747

         p_flex_insert_rec      := p_recipe_insert_flex(i);
Line: 2755

      FETCH Flex_cur INTO l_flex_update_rec;
Line: 2758

        /* If no flex field is updated retain the old values */
        IF (p_recipe_update_flex.count = 0) THEN
           p_flex_update_rec    := l_flex_update_rec;
Line: 2762

           p_flex_update_rec    := p_recipe_update_flex(i);
Line: 2773

        /* as the user is intending to update the field to NULL */
        IF (p_flex_update_rec.attribute1 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute1 := NULL;
Line: 2776

        ELSIF (p_flex_update_rec.attribute1 IS NULL) THEN
            p_flex_update_rec.attribute1 := l_flex_update_rec.attribute1;
Line: 2780

        IF (p_flex_update_rec.attribute2 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute2 := NULL;
Line: 2782

        ELSIF (p_flex_update_rec.attribute2 IS NULL) THEN
            p_flex_update_rec.attribute2 := l_flex_update_rec.attribute2;
Line: 2786

        IF (p_flex_update_rec.attribute3 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute3 := NULL;
Line: 2788

        ELSIF (p_flex_update_rec.attribute3 IS NULL) THEN
            p_flex_update_rec.attribute3 := l_flex_update_rec.attribute3;
Line: 2792

        IF (p_flex_update_rec.attribute4 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute4 := NULL;
Line: 2794

        ELSIF (p_flex_update_rec.attribute4 IS NULL) THEN
            p_flex_update_rec.attribute4 := l_flex_update_rec.attribute4;
Line: 2798

        IF (p_flex_update_rec.attribute5 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute5 := NULL;
Line: 2800

        ELSIF (p_flex_update_rec.attribute5 IS NULL) THEN
            p_flex_update_rec.attribute5 := l_flex_update_rec.attribute5;
Line: 2804

        IF (p_flex_update_rec.attribute6 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute6 := NULL;
Line: 2806

        ELSIF (p_flex_update_rec.attribute6 IS NULL) THEN
            p_flex_update_rec.attribute6 := l_flex_update_rec.attribute6;
Line: 2810

        IF (p_flex_update_rec.attribute7 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute7 := NULL;
Line: 2812

        ELSIF (p_flex_update_rec.attribute7 IS NULL) THEN
            p_flex_update_rec.attribute7 := l_flex_update_rec.attribute7;
Line: 2816

        IF (p_flex_update_rec.attribute8 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute8 := NULL;
Line: 2818

        ELSIF (p_flex_update_rec.attribute8 IS NULL) THEN
            p_flex_update_rec.attribute8 := l_flex_update_rec.attribute8;
Line: 2822

        IF (p_flex_update_rec.attribute9 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute9 := NULL;
Line: 2824

        ELSIF (p_flex_update_rec.attribute9 IS NULL) THEN
            p_flex_update_rec.attribute9 := l_flex_update_rec.attribute9;
Line: 2828

        IF (p_flex_update_rec.attribute10 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute10 := NULL;
Line: 2830

        ELSIF (p_flex_update_rec.attribute10 IS NULL) THEN
            p_flex_update_rec.attribute10 := l_flex_update_rec.attribute10;
Line: 2834

        IF (p_flex_update_rec.attribute11 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute11 := NULL;
Line: 2836

        ELSIF (p_flex_update_rec.attribute11 IS NULL) THEN
            p_flex_update_rec.attribute11 := l_flex_update_rec.attribute11;
Line: 2840

        IF (p_flex_update_rec.attribute12 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute12 := NULL;
Line: 2842

        ELSIF (p_flex_update_rec.attribute12 IS NULL) THEN
            p_flex_update_rec.attribute12 := l_flex_update_rec.attribute12;
Line: 2846

        IF (p_flex_update_rec.attribute13 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute13 := NULL;
Line: 2848

        ELSIF (p_flex_update_rec.attribute13 IS NULL) THEN
            p_flex_update_rec.attribute13 := l_flex_update_rec.attribute13;
Line: 2852

        IF (p_flex_update_rec.attribute14 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute14 := NULL;
Line: 2854

        ELSIF (p_flex_update_rec.attribute14 IS NULL) THEN
            p_flex_update_rec.attribute14 := l_flex_update_rec.attribute14;
Line: 2858

        IF (p_flex_update_rec.attribute15 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute15 := NULL;
Line: 2860

        ELSIF (p_flex_update_rec.attribute15 IS NULL) THEN
            p_flex_update_rec.attribute15 := l_flex_update_rec.attribute15;
Line: 2864

        IF (p_flex_update_rec.attribute16 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute16 := NULL;
Line: 2866

        ELSIF (p_flex_update_rec.attribute16 IS NULL) THEN
            p_flex_update_rec.attribute16 := l_flex_update_rec.attribute16;
Line: 2870

        IF (p_flex_update_rec.attribute17 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute17 := NULL;
Line: 2872

        ELSIF (p_flex_update_rec.attribute17 IS NULL) THEN
            p_flex_update_rec.attribute17 := l_flex_update_rec.attribute17;
Line: 2876

        IF (p_flex_update_rec.attribute18 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute18 := NULL;
Line: 2878

        ELSIF (p_flex_update_rec.attribute18 IS NULL) THEN
            p_flex_update_rec.attribute18 := l_flex_update_rec.attribute18;
Line: 2882

        IF (p_flex_update_rec.attribute19 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute19 := NULL;
Line: 2884

        ELSIF (p_flex_update_rec.attribute19 IS NULL) THEN
            p_flex_update_rec.attribute19 := l_flex_update_rec.attribute19;
Line: 2888

        IF (p_flex_update_rec.attribute20 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute20 := NULL;
Line: 2890

        ELSIF (p_flex_update_rec.attribute20 IS NULL) THEN
            p_flex_update_rec.attribute20 := l_flex_update_rec.attribute20;
Line: 2894

        IF (p_flex_update_rec.attribute21 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute21 := NULL;
Line: 2896

        ELSIF (p_flex_update_rec.attribute21 IS NULL) THEN
            p_flex_update_rec.attribute21 := l_flex_update_rec.attribute21;
Line: 2900

        IF (p_flex_update_rec.attribute22 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute22 := NULL;
Line: 2902

        ELSIF (p_flex_update_rec.attribute22 IS NULL) THEN
            p_flex_update_rec.attribute22 := l_flex_update_rec.attribute22;
Line: 2906

        IF (p_flex_update_rec.attribute23 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute23 := NULL;
Line: 2908

        ELSIF (p_flex_update_rec.attribute23 IS NULL) THEN
            p_flex_update_rec.attribute23 := l_flex_update_rec.attribute23;
Line: 2912

        IF (p_flex_update_rec.attribute24 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute24 := NULL;
Line: 2914

        ELSIF (p_flex_update_rec.attribute24 IS NULL) THEN
            p_flex_update_rec.attribute24 := l_flex_update_rec.attribute24;
Line: 2918

        IF (p_flex_update_rec.attribute25 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute25 := NULL;
Line: 2920

        ELSIF (p_flex_update_rec.attribute25 IS NULL) THEN
            p_flex_update_rec.attribute25 := l_flex_update_rec.attribute25;
Line: 2924

        IF (p_flex_update_rec.attribute26 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute26 := NULL;
Line: 2926

        ELSIF (p_flex_update_rec.attribute26 IS NULL) THEN
            p_flex_update_rec.attribute26 := l_flex_update_rec.attribute26;
Line: 2930

        IF (p_flex_update_rec.attribute27 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute27 := NULL;
Line: 2932

        ELSIF (p_flex_update_rec.attribute27 IS NULL) THEN
            p_flex_update_rec.attribute27 := l_flex_update_rec.attribute27;
Line: 2936

        IF (p_flex_update_rec.attribute28 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute28 := NULL;
Line: 2938

        ELSIF (p_flex_update_rec.attribute28 IS NULL) THEN
            p_flex_update_rec.attribute28 := l_flex_update_rec.attribute28;
Line: 2942

        IF (p_flex_update_rec.attribute29 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute29 := NULL;
Line: 2944

        ELSIF (p_flex_update_rec.attribute29 IS NULL) THEN
            p_flex_update_rec.attribute29 := l_flex_update_rec.attribute29;
Line: 2948

        IF (p_flex_update_rec.attribute30 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute30 := NULL;
Line: 2950

        ELSIF (p_flex_update_rec.attribute30 IS NULL) THEN
            p_flex_update_rec.attribute30 := l_flex_update_rec.attribute30;
Line: 2954

        IF (p_flex_update_rec.attribute_category = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute_category := NULL;
Line: 2956

        ELSIF (p_flex_update_rec.attribute_category IS NULL) THEN
            p_flex_update_rec.attribute_category := l_flex_update_rec.attribute_category;
Line: 2966

                                                   ,p_flex_insert_rec => p_flex_insert_rec
                                                   ,p_flex_update_rec => p_flex_update_rec
                                                   ,x_return_status => x_return_status);
Line: 3016

  /*   inserting and updating recipe orgn resources */
  /* */
  /* =============================================  */
  /* Start of commments */
  /* API name     : Recipe_Orgn_Resources */
  /* Type         : Public */
  /* Function     : */
  /* parameters   : */
  /* IN           :       p_api_version         IN NUMBER   Required */
  /*                      p_init_msg_list       IN Varchar2 Optional */
  /*                      p_commit              IN Varchar2  Optional */
  /*                      p_recipe_detail_tbl   IN Required */
  /* */
  /* OUT                  x_return_status    OUT NOCOPY varchar2(1) */
  /*                      x_msg_count        OUT NOCOPY Number */
  /*                      x_msg_data         OUT NOCOPY varchar2(2000) */
  /* */
  /* Version :  Current Version 1.0 */
  /* */
  /* Notes  :     p_called_from_forms parameter not currently used          */
  /*              originally included for returning error messages          */
  /* */
  /* End of comments */
  PROCEDURE RECIPE_ORGN_RESOURCES
  (     p_api_version           IN              NUMBER                          ,
        p_init_msg_list         IN              VARCHAR2 := FND_API.G_FALSE     ,
        p_commit                IN              VARCHAR2 := FND_API.G_FALSE     ,
        p_called_from_forms     IN              VARCHAR2 := 'NO'                ,
        x_return_status         OUT NOCOPY      VARCHAR2                        ,
        x_msg_count             OUT NOCOPY      NUMBER                          ,
        x_msg_data              OUT NOCOPY      VARCHAR2                        ,
        p_recipe_detail_tbl     IN              recipe_detail_tbl               ,
        p_recipe_insert_flex    IN              recipe_flex                     ,
        p_recipe_update_flex    IN              recipe_update_flex
  )  IS

       /*  Define all variables specific to this procedure */
        l_dml_type              VARCHAR2(1)                     := 'I';
Line: 3071

        /* flex field records for inserts and updates */
        p_flex_insert_rec       flex;
Line: 3073

        p_flex_update_rec       update_flex;
Line: 3076

        l_flex_update_rec       update_flex;
Line: 3078

        /* Define a cursor for dealing with updates  */
        CURSOR Flex_cur(vRecipe_id NUMBER, vRoutingStep_id NUMBER,
                        vOprn_line_id NUMBER, vResources VARCHAR2, vOrgn_id NUMBER) IS
                Select  attribute_category, attribute1, attribute2, attribute3, attribute4,
                        attribute5, attribute6, attribute7, attribute8, attribute9, attribute10,
                        attribute11, attribute12, attribute13, attribute14, attribute15,
                        attribute16, attribute17, attribute18, attribute19, attribute20,
                        attribute21, attribute22, attribute23, attribute24,attribute25,
                        attribute26, attribute27, attribute28, attribute29, attribute30
                From    gmd_recipe_orgn_resources
                where   recipe_id       = NVL(vRecipe_id,-1)    AND
                        RoutingStep_id  = NVL(vRoutingStep_id,-1) AND
                        oprn_line_id    = NVL(vOprn_line_id,-1) AND
                        resources       = vResources AND
                        organization_id = vOrgn_id;
Line: 3094

        CURSOR update_res_cur(vRecipe_id NUMBER, vRoutingStep_id NUMBER,
                            vOprn_line_id NUMBER, vResources VARCHAR2, vOrgn_id NUMBER) IS
                Select  min_capacity, max_capacity, process_qty, usage_uom,
                        resource_usage
                From    gmd_recipe_orgn_resources
                where   recipe_id       = NVL(vRecipe_id,-1)    AND
                        RoutingStep_id  = NVL(vRoutingStep_id,-1) AND
                        oprn_line_id    = NVL(vOprn_line_id,-1) AND
                        resources       = vResources AND
                        organization_id = vOrgn_id;
Line: 3111

            SELECT gos.process_qty_uom
            FROM  gmd_operation_activities goa, gmd_operations gos
            WHERE goa.oprn_line_id = vOprn_line_id
            AND   gos.oprn_id = goa.oprn_id;
Line: 3122

        /* Updating recipe orgn resources for forst time infact insert a new record in  */
        /* gmd_recipe_orgn_resources table */

        /*  Define Savepoint */
        SAVEPOINT  Recipe_Orgn_Resources;
Line: 3246

        FOR update_rec IN update_res_cur (p_recipe_detail_rec.recipe_id,
                                          p_recipe_detail_rec.routingstep_id,
                                          p_recipe_detail_rec.oprn_line_id,
                                          p_recipe_detail_rec.resources,
                                          p_recipe_detail_rec.organization_id) LOOP

          IF (p_recipe_detail_rec.min_capacity = FND_API.G_MISS_NUM) THEN
              p_recipe_detail_rec.min_capacity := NULL;
Line: 3255

              p_recipe_detail_rec.min_capacity := update_rec.min_capacity;
Line: 3261

              p_recipe_detail_rec.max_capacity := update_rec.max_capacity;
Line: 3267

              p_recipe_detail_rec.process_qty := update_rec.process_qty;
Line: 3273

              p_recipe_detail_rec.resource_usage := update_rec.resource_usage;
Line: 3279

              p_recipe_detail_rec.usage_uom := update_rec.usage_uom;
Line: 3287

    IF (p_recipe_insert_flex.count = 0) THEN
      p_flex_insert_rec         := NULL;
Line: 3290

      p_flex_insert_rec := p_recipe_insert_flex(i);
Line: 3299

    FETCH Flex_cur INTO l_flex_update_rec;
Line: 3302

        /* If no flex field is updated retain the old values */
        IF (p_recipe_update_flex.count = 0) THEN
           p_flex_update_rec    := l_flex_update_rec;
Line: 3306

           p_flex_update_rec    := p_recipe_update_flex(i);
Line: 3317

        /* as the user is intending to update the field to NULL */
        IF (p_flex_update_rec.attribute1 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute1 := NULL;
Line: 3320

        ELSIF (p_flex_update_rec.attribute1 IS NULL) THEN
            p_flex_update_rec.attribute1 := l_flex_update_rec.attribute1;
Line: 3324

        IF (p_flex_update_rec.attribute2 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute2 := NULL;
Line: 3326

        ELSIF (p_flex_update_rec.attribute2 IS NULL) THEN
            p_flex_update_rec.attribute2 := l_flex_update_rec.attribute2;
Line: 3330

        IF (p_flex_update_rec.attribute3 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute3 := NULL;
Line: 3332

        ELSIF (p_flex_update_rec.attribute3 IS NULL) THEN
            p_flex_update_rec.attribute3 := l_flex_update_rec.attribute3;
Line: 3336

        IF (p_flex_update_rec.attribute4 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute4 := NULL;
Line: 3338

        ELSIF (p_flex_update_rec.attribute4 IS NULL) THEN
            p_flex_update_rec.attribute4 := l_flex_update_rec.attribute4;
Line: 3342

        IF (p_flex_update_rec.attribute5 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute5 := NULL;
Line: 3344

        ELSIF (p_flex_update_rec.attribute5 IS NULL) THEN
            p_flex_update_rec.attribute5 := l_flex_update_rec.attribute5;
Line: 3348

        IF (p_flex_update_rec.attribute6 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute6 := NULL;
Line: 3350

        ELSIF (p_flex_update_rec.attribute6 IS NULL) THEN
            p_flex_update_rec.attribute6 := l_flex_update_rec.attribute6;
Line: 3354

        IF (p_flex_update_rec.attribute7 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute7 := NULL;
Line: 3356

        ELSIF (p_flex_update_rec.attribute7 IS NULL) THEN
            p_flex_update_rec.attribute7 := l_flex_update_rec.attribute7;
Line: 3360

        IF (p_flex_update_rec.attribute8 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute8 := NULL;
Line: 3362

        ELSIF (p_flex_update_rec.attribute8 IS NULL) THEN
            p_flex_update_rec.attribute8 := l_flex_update_rec.attribute8;
Line: 3366

        IF (p_flex_update_rec.attribute9 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute9 := NULL;
Line: 3368

        ELSIF (p_flex_update_rec.attribute9 IS NULL) THEN
            p_flex_update_rec.attribute9 := l_flex_update_rec.attribute9;
Line: 3372

        IF (p_flex_update_rec.attribute10 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute10 := NULL;
Line: 3374

        ELSIF (p_flex_update_rec.attribute10 IS NULL) THEN
            p_flex_update_rec.attribute10 := l_flex_update_rec.attribute10;
Line: 3378

        IF (p_flex_update_rec.attribute11 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute11 := NULL;
Line: 3380

        ELSIF (p_flex_update_rec.attribute11 IS NULL) THEN
            p_flex_update_rec.attribute11 := l_flex_update_rec.attribute11;
Line: 3384

        IF (p_flex_update_rec.attribute12 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute12 := NULL;
Line: 3386

        ELSIF (p_flex_update_rec.attribute12 IS NULL) THEN
            p_flex_update_rec.attribute12 := l_flex_update_rec.attribute12;
Line: 3390

        IF (p_flex_update_rec.attribute13 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute13 := NULL;
Line: 3392

        ELSIF (p_flex_update_rec.attribute13 IS NULL) THEN
            p_flex_update_rec.attribute13 := l_flex_update_rec.attribute13;
Line: 3396

        IF (p_flex_update_rec.attribute14 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute14 := NULL;
Line: 3398

        ELSIF (p_flex_update_rec.attribute14 IS NULL) THEN
            p_flex_update_rec.attribute14 := l_flex_update_rec.attribute14;
Line: 3402

        IF (p_flex_update_rec.attribute15 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute15 := NULL;
Line: 3404

        ELSIF (p_flex_update_rec.attribute15 IS NULL) THEN
            p_flex_update_rec.attribute15 := l_flex_update_rec.attribute15;
Line: 3408

        IF (p_flex_update_rec.attribute16 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute16 := NULL;
Line: 3410

        ELSIF (p_flex_update_rec.attribute16 IS NULL) THEN
            p_flex_update_rec.attribute16 := l_flex_update_rec.attribute16;
Line: 3414

        IF (p_flex_update_rec.attribute17 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute17 := NULL;
Line: 3416

        ELSIF (p_flex_update_rec.attribute17 IS NULL) THEN
            p_flex_update_rec.attribute17 := l_flex_update_rec.attribute17;
Line: 3420

        IF (p_flex_update_rec.attribute18 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute18 := NULL;
Line: 3422

        ELSIF (p_flex_update_rec.attribute18 IS NULL) THEN
            p_flex_update_rec.attribute18 := l_flex_update_rec.attribute18;
Line: 3426

        IF (p_flex_update_rec.attribute19 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute19 := NULL;
Line: 3428

        ELSIF (p_flex_update_rec.attribute19 IS NULL) THEN
            p_flex_update_rec.attribute19 := l_flex_update_rec.attribute19;
Line: 3432

        IF (p_flex_update_rec.attribute20 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute20 := NULL;
Line: 3434

        ELSIF (p_flex_update_rec.attribute20 IS NULL) THEN
            p_flex_update_rec.attribute20 := l_flex_update_rec.attribute20;
Line: 3438

        IF (p_flex_update_rec.attribute21 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute21 := NULL;
Line: 3440

        ELSIF (p_flex_update_rec.attribute21 IS NULL) THEN
            p_flex_update_rec.attribute21 := l_flex_update_rec.attribute21;
Line: 3444

        IF (p_flex_update_rec.attribute22 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute22 := NULL;
Line: 3446

        ELSIF (p_flex_update_rec.attribute22 IS NULL) THEN
            p_flex_update_rec.attribute22 := l_flex_update_rec.attribute22;
Line: 3450

        IF (p_flex_update_rec.attribute23 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute23 := NULL;
Line: 3452

        ELSIF (p_flex_update_rec.attribute23 IS NULL) THEN
            p_flex_update_rec.attribute23 := l_flex_update_rec.attribute23;
Line: 3456

        IF (p_flex_update_rec.attribute24 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute24 := NULL;
Line: 3458

        ELSIF (p_flex_update_rec.attribute24 IS NULL) THEN
            p_flex_update_rec.attribute24 := l_flex_update_rec.attribute24;
Line: 3462

        IF (p_flex_update_rec.attribute25 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute25 := NULL;
Line: 3464

        ELSIF (p_flex_update_rec.attribute25 IS NULL) THEN
            p_flex_update_rec.attribute25 := l_flex_update_rec.attribute25;
Line: 3468

        IF (p_flex_update_rec.attribute26 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute26 := NULL;
Line: 3470

        ELSIF (p_flex_update_rec.attribute26 IS NULL) THEN
            p_flex_update_rec.attribute26 := l_flex_update_rec.attribute26;
Line: 3474

        IF (p_flex_update_rec.attribute27 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute27 := NULL;
Line: 3476

        ELSIF (p_flex_update_rec.attribute27 IS NULL) THEN
            p_flex_update_rec.attribute27 := l_flex_update_rec.attribute27;
Line: 3480

        IF (p_flex_update_rec.attribute28 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute28 := NULL;
Line: 3482

        ELSIF (p_flex_update_rec.attribute28 IS NULL) THEN
            p_flex_update_rec.attribute28 := l_flex_update_rec.attribute28;
Line: 3486

        IF (p_flex_update_rec.attribute29 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute29 := NULL;
Line: 3488

        ELSIF (p_flex_update_rec.attribute29 IS NULL) THEN
            p_flex_update_rec.attribute29 := l_flex_update_rec.attribute29;
Line: 3492

        IF (p_flex_update_rec.attribute30 = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute30 := NULL;
Line: 3494

        ELSIF (p_flex_update_rec.attribute30 IS NULL) THEN
            p_flex_update_rec.attribute30 := l_flex_update_rec.attribute30;
Line: 3498

        IF (p_flex_update_rec.attribute_category = FND_API.G_MISS_CHAR) THEN
            p_flex_update_rec.attribute_category := NULL;
Line: 3500

        ELSIF (p_flex_update_rec.attribute_category IS NULL) THEN
            p_flex_update_rec.attribute_category := l_flex_update_rec.attribute_category;
Line: 3510

                                                   ,p_flex_insert_rec => p_flex_insert_rec
                                                   ,p_flex_update_rec => p_flex_update_rec
                                                   ,x_return_status => x_return_status);