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: 608

    SAVEPOINT  Insert_Recipe_VR;
Line: 670

              RAISE Recipe_VR_insert_failure;
Line: 680

         RAISE Recipe_VR_insert_failure;
Line: 690

           RAISE Recipe_VR_insert_failure;
Line: 715

            RAISE Recipe_VR_insert_failure;
Line: 741

          RAISE Recipe_VR_insert_failure;
Line: 755

            RAISE Recipe_VR_insert_failure;
Line: 764

            RAISE Recipe_VR_insert_failure;
Line: 779

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

          RAISE Recipe_VR_insert_failure;
Line: 827

          ROLLBACK to Insert_Recipe_VR;
Line: 833

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

          ROLLBACK to Insert_Recipe_VR;
Line: 864

  /*   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: 919

     insert_rcp_mat_failure  EXCEPTION;
Line: 922

     SAVEPOINT  Insert_Recipe_Materials;
Line: 995

           RAISE insert_rcp_mat_failure;
Line: 1008

            RAISE insert_rcp_mat_failure;
Line: 1025

            RAISE insert_rcp_mat_failure;
Line: 1028

        /* 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: 1034

              RAISE insert_rcp_mat_failure;
Line: 1051

       ROLLBACK to Insert_Recipe_Materials;
Line: 1056

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

       ROLLBACK to Insert_Recipe_Materials;
Line: 1075

  /*   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: 1129

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

     update_pr_loss_failure  EXCEPTION;
Line: 1141

     SAVEPOINT  Update_Recipe_Process_loss;
Line: 1180

        /* 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: 1187

           RAISE update_pr_loss_failure;
Line: 1243

           RAISE update_pr_loss_failure;
Line: 1247

           RAISE update_pr_loss_failure;
Line: 1250

        /* 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: 1255

            RAISE update_pr_loss_failure;
Line: 1272

       ROLLBACK to Update_Recipe_Process_loss;
Line: 1278

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

       ROLLBACK to Update_Recipe_Process_loss;
Line: 1286

       ROLLBACK to Update_Recipe_Process_loss;
Line: 1293

   END UPDATE_RECIPE_PROCESS_LOSS;
Line: 1297

  /*   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: 1356

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

    update_rcp_cust_failure EXCEPTION;
Line: 1369

     SAVEPOINT  Update_Recipe_Customers;
Line: 1426

              RAISE update_rcp_cust_failure;
Line: 1436

           RAISE update_rcp_cust_failure;
Line: 1454

             RAISE update_rcp_cust_failure;
Line: 1460

        /* 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: 1470

        /* 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: 1476

            RAISE update_rcp_cust_failure;
Line: 1492

         ROLLBACK to Update_Recipe_Customers;
Line: 1498

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

         ROLLBACK to Update_Recipe_Customers;
Line: 1513

   END UPDATE_RECIPE_CUSTOMERS;
Line: 1517

  /*   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: 1574

     p_flex_update_rec       UPDATE_FLEX;
Line: 1576

     l_flex_update_rec       update_flex;
Line: 1578

     /* 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: 1590

     /* 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: 1598

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

     Update_VR_Failure       EXCEPTION;
Line: 1608

     SAVEPOINT  Update_Recipe_VR;
Line: 1650

            RAISE Update_VR_Failure;
Line: 1656

         /* 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: 1661

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

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

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

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

            RAISE Update_VR_Failure;
Line: 1691

            RAISE Update_VR_Failure;
Line: 1699

            RAISE Update_VR_Failure;
Line: 1714

               RAISE Update_VR_Failure;
Line: 1720

         FETCH   Flex_cur INTO l_flex_update_rec;
Line: 1723

         /* 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: 1727

            p_flex_update_rec    := p_recipe_update_flex(i);
Line: 1730

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

         /* 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: 1921

           RAISE Update_VR_Failure;
Line: 1925

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

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

       ROLLBACK to Update_Recipe_VR;
Line: 1948

       ROLLBACK to Update_Recipe_VR;
Line: 1955

       ROLLBACK to Update_Recipe_VR;
Line: 1962

   END UPDATE_RECIPE_VR;
Line: 1971

  /*   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: 2034

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

        p_flex_update_rec            update_flex;
Line: 2039

        l_flex_update_rec            update_flex;
Line: 2041

        /* 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: 2053

        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: 2062

        /* 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: 2146

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

             p_flex_insert_rec  := p_recipe_insert_flex(i);
Line: 2152

          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: 2159

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

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

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

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

          FETCH Flex_cur INTO l_flex_update_rec;
Line: 2186

             /* 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: 2190

                 p_flex_update_rec      := p_recipe_update_flex(i);
Line: 2201

             /* 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: 2204

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /*   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: 2498

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

        p_flex_update_rec       update_flex;
Line: 2503

        l_flex_update_rec       update_flex;
Line: 2505

        /* 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: 2523

        /* 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: 2617

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

         p_flex_insert_rec      := p_recipe_insert_flex(i);
Line: 2628

      FETCH Flex_cur INTO l_flex_update_rec;
Line: 2631

        /* 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: 2635

           p_flex_update_rec    := p_recipe_update_flex(i);
Line: 2646

        /* 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: 2649

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /*   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: 2944

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

        p_flex_update_rec       update_flex;
Line: 2949

        l_flex_update_rec       update_flex;
Line: 2951

        /* 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: 2967

        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: 2980

        /* 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: 3083

        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: 3092

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

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

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

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

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

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

      p_flex_insert_rec := p_recipe_insert_flex(i);
Line: 3136

    FETCH Flex_cur INTO l_flex_update_rec;
Line: 3139

        /* 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: 3143

           p_flex_update_rec    := p_recipe_update_flex(i);
Line: 3154

        /* 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: 3157

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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