DBA Data[Home] [Help]

APPS.OE_ORDER_PVT SQL Statements

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

Line: 340

    select UPGRADED_FLAG, booked_flag into
    g_upgraded_flag, g_booked_flag
    from oe_order_headers_all
    where header_id = p_header_id;
Line: 498

    ELSIF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
    OR    p_x_header_rec.operation = OE_GLOBALS.G_OPR_DELETE
    THEN

     IF l_debug_level  > 0 THEN
         oe_debug_pub.add(  'OPERATION = UPDATE SO QUERY OLD' , 2 ) ;
Line: 549

 OE_MSG_PUB.update_msg_context(
    p_entity_code  => 'HEADER'
     ,p_entity_id           => p_x_header_rec.header_id
       ,p_header_id           => p_x_header_rec.header_id
       ,p_line_id             => null
          ,p_order_source_id            => p_x_header_rec.order_source_id
       ,p_orig_sys_document_ref => p_x_header_rec.orig_sys_document_ref
       ,p_orig_sys_document_line_ref => null
       ,p_source_document_id  => p_x_header_rec.source_document_id
       ,p_source_document_line_id => null );
Line: 562

  IF ( p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
    OR p_x_header_rec.operation = OE_GLOBALS.G_OPR_CREATE
    OR p_x_header_rec.operation = OE_GLOBALS.G_OPR_DELETE)  THEN


   -- Check security
   IF l_control_rec.check_security
    AND (p_x_header_rec.operation = OE_GLOBALS.G_OPR_CREATE
         OR p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
   THEN

        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CALLING CHECK ATTRIBUTES SECURITY',0.5 ) ;  -- debug level 0.5 added for bug 13435459
Line: 699

        IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

            OE_Validate_Header.Entity_Delete
            (   x_return_status               => l_return_status
            ,   p_header_rec                  => p_x_header_rec
            );
Line: 741

    IF NOT (p_x_header_rec.operation  = OE_GLOBALS.G_OPR_UPDATE
               AND OE_Header_Security.g_check_all_cols_constraint = 'Y')
       AND l_control_rec.check_security
    THEN
        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ENTITY SECURITY' ,0.5 ) ;  --debug level 0.5 added for bug 13435459
Line: 783

        IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

            OE_Header_Util.Delete_Row
            (   p_header_id                   => p_x_header_rec.header_id
            );
Line: 793

            p_x_header_rec.last_update_date  := SYSDATE;
Line: 794

            p_x_header_rec.last_updated_by   := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
Line: 795

            p_x_header_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 801

            IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

   IF l_debug_level  > 0 THEN
       oe_debug_pub.add(  'HEADER FLOW STATUS :'||P_X_HEADER_REC.FLOW_STATUS_CODE , 1 ) ;
Line: 806

                OE_Header_Util.Update_Row (p_x_header_rec);
Line: 824

                OE_Header_Util.Insert_Row (p_x_header_rec);
Line: 866

              oe_debug_pub.add(  'DELETE REQUEST1' , 2 ) ;
Line: 882

              oe_debug_pub.add(  'DELETE REQUEST2' , 2 ) ;
Line: 906

              oe_debug_pub.add(  'DELETE REQUEST3' , 2 ) ;
Line: 1011

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id
               FROM   OE_ORDER_HEADERS_ALL
               WHERE  header_id = l_header_Scredit_rec.header_id;
Line: 1054

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id
               FROM   OE_ORDER_HEADERS_ALL
               WHERE  header_id = l_old_header_Scredit_rec.header_id;
Line: 1113

        ELSIF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Header_Scredit_rec.db_flag := FND_API.G_TRUE;
Line: 1145

            OE_MSG_PUB.update_msg_context(
   p_entity_code   => 'HEADER_SCREDIT'
    ,p_entity_id           => l_header_Scredit_rec.sales_credit_id
      ,p_header_id           => l_header_Scredit_rec.header_Id);
Line: 1162

         OR l_header_scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
   THEN

        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ATTRIBUTES SECURITY' ) ;
Line: 1247

            IF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Validate_Header_Scredit.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Header_Scredit_rec          => l_Header_Scredit_rec
                );
Line: 1282

    IF NOT (l_header_scredit_rec.operation  = OE_GLOBALS.G_OPR_UPDATE
               AND OE_Header_Scredit_Security.g_check_all_cols_constraint = 'Y')
       AND l_control_rec.check_security
    THEN
        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ENTITY SECURITY' ) ;
Line: 1317

            IF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
               SAVEPOINT DELETE_SCREDIT_FAILED; --bug 5331854
Line: 1320

                select quota_flag into l_quota_flag from oe_sales_credit_types where sales_credit_type_id = l_header_scredit_rec.sales_credit_type_id;
Line: 1321

                select booked_flag into l_booked_flag from oe_order_headers where header_id = l_header_scredit_rec.header_id;
Line: 1322

                OE_Header_Scredit_Util.Delete_Row
                (   p_sales_credit_id             => l_Header_Scredit_rec.sales_credit_id
                );
Line: 1330

                      oe_debug_pub.add('after delete_row and hdr validate_hsc_quota_total rt status : ' || l_header_scredit_rec.return_status);
Line: 1340

                l_Header_Scredit_rec.last_update_date := SYSDATE;
Line: 1341

                l_Header_Scredit_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
Line: 1342

                l_Header_Scredit_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 1344

                IF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Header_Scredit_Util.Update_Row (l_Header_Scredit_rec);
Line: 1353

                    OE_Header_Scredit_Util.Insert_Row (l_Header_Scredit_rec);
Line: 1393

                   oe_debug_pub.add(  'DELETE REQUEST4' , 2 ) ;
Line: 1395

               oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
                 (p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_SCREDIT,
                  p_entity_id => l_header_scredit_rec.sales_credit_id,
                  x_return_status => l_return_status);
Line: 1405

                      ROLLBACK TO SAVEPOINT DELETE_SCREDIT_FAILED;
Line: 1460

              oe_debug_pub.add(  'DELETE REQUEST5' , 2 ) ;
Line: 1474

              oe_debug_pub.add(  'DELETE REQUEST6' , 2 ) ;
Line: 1488

              oe_debug_pub.add(  'DELETE REQUEST7' , 2 ) ;
Line: 1594

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id
               FROM   OE_ORDER_HEADERS_ALL
               WHERE  header_id = l_header_Payment_rec.header_id;
Line: 1637

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id
               FROM   OE_ORDER_HEADERS_ALL
               WHERE  header_id = l_old_header_Payment_rec.header_id;
Line: 1702

        ELSIF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Header_Payment_rec.db_flag := FND_API.G_TRUE;
Line: 1753

            OE_MSG_PUB.update_msg_context(
   p_entity_code   => 'HEADER_PAYMENT'
    ,p_entity_id           => l_header_Payment_rec.payment_number
      ,p_header_id           => l_header_Payment_rec.header_Id);
Line: 1770

         OR l_header_payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
   THEN

        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ATTRIBUTES SECURITY' ) ;
Line: 1885

            IF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                IF l_debug_level  > 0 THEN
                   oe_debug_pub.add('Payment:before OE_Validate_Header_Payment.Entity_Delete', 5);
Line: 1890

                OE_Validate_Header_Payment.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Header_Payment_rec          => l_Header_Payment_rec
                );
Line: 1895

                   oe_debug_pub.add('Payment:after OE_Validate_Header_Payment.Entity_Delete', 5);
Line: 1932

    IF NOT (l_header_payment_rec.operation  = OE_GLOBALS.G_OPR_UPDATE
               AND OE_Header_Payment_Security.g_check_all_cols_constraint = 'Y')
       AND l_control_rec.check_security
    THEN
        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ENTITY SECURITY' ) ;
Line: 1980

            IF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
                IF l_debug_level  > 0 THEN
                   oe_debug_pub.add('Payment:before Oe_Header_Payment_Util.Delete_Row',5);
Line: 1985

                OE_Header_Payment_Util.Delete_Row
                (   p_payment_number     => l_Header_Payment_rec.payment_number
                ,   p_header_id          => l_Header_Payment_rec.header_id
                );
Line: 1990

                   oe_debug_pub.add('Payment:after Oe_Header_Payment_Util.Delete_Row',5);
Line: 1997

                l_Header_Payment_rec.last_update_date := SYSDATE;
Line: 1998

                l_Header_Payment_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 1999

                l_Header_Payment_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 2001

                IF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Header_Payment_Util.Update_Row (l_Header_Payment_rec);
Line: 2011

                       oe_debug_pub.add('Payment:before Oe_Header_Payment_Util.Insert_Row', 5);
Line: 2013

                    OE_Header_Payment_Util.Insert_Row (l_Header_Payment_rec);
Line: 2015

                       oe_debug_pub.add('Payment:after Oe_Header_Payment_Util.Insert_Row', 5);
Line: 2055

                   oe_debug_pub.add(  'DELETE REQUEST4' , 2 ) ;
Line: 2057

               oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
                 (p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_PAYMENT,
                  p_entity_id => l_header_payment_rec.header_id,
                  x_return_status => l_return_status);
Line: 2112

              oe_debug_pub.add(  'DELETE REQUEST5' , 2 ) ;
Line: 2124

              oe_debug_pub.add(  'DELETE REQUEST6' , 2 ) ;
Line: 2136

              oe_debug_pub.add(  'DELETE REQUEST7' , 2 ) ;
Line: 2291

  4) There is no change if the operation is UPDATE or DELETE on
     class/options lines.
  5) If the call is made from configurator code or options window
     code, on all the classl lines, item_type_code is passed.


LOGIC:
 only the new stuff is explained here(at a high level), rest is same.
 ***: indiactes previous code.

 if boolean COMPLETE_AND_CLASS_SAVE_MODE is TRUE, we create CLASSES
 if it is fales, we create OPTIONS.


MODE = standard_and_models and check_item_type = 1
  l_process_this_line = TRUE;
Line: 2318

    go to end_of_lines (e.g class during option create, or update of option)
  END IF;
Line: 2450

L_event_tbl.DELETE;
Line: 2668

      ELSIF l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE OR
            l_line_rec.operation = OE_GLOBALS.G_OPR_DELETE
      THEN

        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'OPERATION = UPDATE SO QUERY OLD' , 1 ) ;
Line: 2733

        OE_MSG_PUB.update_msg_context
        ( p_entity_code             => 'LINE'
         ,p_entity_id               => l_line_rec.line_id
         ,p_header_id               => l_line_rec.header_id
         ,p_line_id                 => l_line_rec.line_id
         ,p_order_source_id         => l_line_rec.order_source_id
         ,p_orig_sys_document_ref   => l_line_rec.orig_sys_document_ref
         ,p_orig_sys_document_line_ref  => l_line_rec.orig_sys_line_ref
         ,p_source_document_type_id     => l_line_rec.source_document_type_id
         ,p_source_document_id      => l_line_rec.source_document_id
         ,p_source_document_line_id => l_line_rec.source_document_line_id );
Line: 2887

                   SELECT bom_item_type
                   INTO   l_bom_item_type
                   FROM   mtl_system_items
                   WHERE  inventory_item_id = l_line_rec.inventory_item_id
                   AND    organization_id
                   = OE_Sys_Parameters.VALUE('MASTER_ORGANIZATION_ID');
Line: 3199

          l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
      THEN

        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ATTRIBUTES SECURITY' , 0.5 ) ; -- debug level changed to 0.5 for bug 13435459
Line: 3378

        IF l_line_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

          OE_Validate_Line.Entity_Delete
          ( x_return_status               => l_return_status
           ,p_line_rec                    => l_line_rec );
Line: 3422

      IF NOT (l_line_rec.operation  = OE_GLOBALS.G_OPR_UPDATE AND
         OE_Line_Security.g_check_all_cols_constraint = 'Y') AND
         l_control_rec.check_security THEN

        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ENTITY SECURITY' , 0.5 ) ;  --13435459
Line: 3475

        IF l_line_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
           OE_Line_Util.Delete_Row
          ( p_line_id   => l_line_rec.line_id);
Line: 3506

        ELSE -- operation is update or create

          --  Get Who Information

          l_line_rec.last_update_date    := SYSDATE;
Line: 3511

          l_line_rec.last_updated_by     :=  NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
Line: 3512

          l_line_rec.last_update_login   := FND_GLOBAL.LOGIN_ID;
Line: 3517

          IF l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
            IF l_debug_level  > 0 THEN
                oe_debug_pub.add(  'CALLING UPDATE ROW' , 0.5 ) ;  --debug changed to 0.5 for 13435459
Line: 3522

            OE_Line_Util.Update_Row (l_line_rec);
Line: 3524

                oe_debug_pub.add(  'AFTER CALLING UPDATE ROW' , 0.5 ) ;  --debug changed to 0.5 for 13435459
Line: 3538

                oe_debug_pub.add(  'CALLING INSERT ROW' , 0.5 ) ;  --debug added for 13435459
Line: 3541

            OE_Line_Util.Insert_Row (l_line_rec);
Line: 3543

                oe_debug_pub.add(  'AFTER CALLING INSERT ROW' , 0.5 ) ;  --debug added for 13435459
Line: 3548

        END IF; -- operation = delete
Line: 3624

                oe_debug_pub.add(  'DELETE REQUEST8' , 2 ) ;
Line: 3627

            oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
            (p_entity_code   => OE_GLOBALS.G_ENTITY_LINE,
             p_entity_id     => l_line_rec.line_id,
             x_return_status => l_return_status);
Line: 3720

           l_options_index_tbl.DELETE;
Line: 3768

    OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
Line: 3769

    OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
Line: 3778

          oe_debug_pub.add(  'DELETE REQUEST9' , 2 ) ;
Line: 3784

                OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
Line: 3800

    OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
Line: 3801

    OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
Line: 3810

          oe_debug_pub.add(  'DELETE REQUEST10' , 2 ) ;
Line: 3816

                OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
Line: 3830

    OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
Line: 3831

    OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
Line: 3836

          oe_debug_pub.add(  'DELETE REQUEST11' , 2 ) ;
Line: 3842

  OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
Line: 3944

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id, orig_sys_line_ref,
               source_document_line_id, orig_sys_shipment_ref
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
               l_source_document_line_id, l_orig_sys_shipment_ref
               FROM   OE_ORDER_LINES_ALL
               WHERE  line_id = l_line_Scredit_rec.line_id;
Line: 3995

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id, orig_sys_line_ref,
               source_document_line_id, orig_sys_shipment_ref
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
               l_source_document_line_id, l_orig_sys_shipment_ref
               FROM   OE_ORDER_LINES_ALL
               WHERE  line_id = l_old_line_Scredit_rec.line_id;
Line: 4063

        ELSIF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Line_Scredit_rec.db_flag := FND_API.G_TRUE;
Line: 4094

           OE_MSG_PUB.update_msg_context(
   p_entity_code   => 'LINE_SCREDIT'
    ,p_entity_id           => l_line_Scredit_rec.sales_credit_id
      ,p_header_id           => l_line_Scredit_rec.header_id
      ,p_line_id             => l_line_Scredit_rec.line_id);
Line: 4111

         OR l_line_scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
   THEN

        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ATTRIBUTES SECURITY' ) ;
Line: 4206

            IF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Validate_Line_Scredit.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Line_Scredit_rec            => l_Line_Scredit_rec
                );
Line: 4242

    IF NOT (l_line_scredit_rec.operation  = OE_GLOBALS.G_OPR_UPDATE
           AND OE_Line_Scredit_Security.g_check_all_cols_constraint = 'Y')
           AND l_control_rec.check_security
    THEN

        IF l_debug_level  > 0 THEN
            oe_debug_pub.add(  'CHECK ENTITY SECURITY' ) ;
Line: 4279

            IF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Line_Scredit_Util.Delete_Row
                (   p_sales_credit_id             => l_Line_Scredit_rec.sales_credit_id
                );
Line: 4289

                l_Line_Scredit_rec.last_update_date := SYSDATE;
Line: 4290

                l_Line_Scredit_rec.last_updated_by :=  NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
Line: 4291

                l_Line_Scredit_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 4293

                IF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Line_Scredit_Util.Update_Row (l_Line_Scredit_rec);
Line: 4302

                    OE_Line_Scredit_Util.Insert_Row (l_Line_Scredit_rec);
Line: 4341

                  oe_debug_pub.add(  'DELETE REQUEST12' , 2 ) ;
Line: 4343

              oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
                    (p_entity_code =>OE_GLOBALS.G_ENTITY_LINE_SCREDIT,
                    p_entity_id => l_line_scredit_rec.sales_credit_id,
                    x_return_status => l_return_status);
Line: 4401

              oe_debug_pub.add(  'DELETE REQUEST13' , 2 ) ;
Line: 4415

              oe_debug_pub.add(  'DELETE REQUEST14' , 2 ) ;
Line: 4429

              oe_debug_pub.add(  'DELETE REQUEST15' , 2 ) ;
Line: 4526

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id, orig_sys_line_ref,
               source_document_line_id, orig_sys_shipment_ref
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
               l_source_document_line_id, l_orig_sys_shipment_ref
               FROM   OE_ORDER_LINES_ALL
               WHERE  line_id = l_line_Payment_rec.line_id;
Line: 4577

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id, orig_sys_line_ref,
               source_document_line_id, orig_sys_shipment_ref
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
               l_source_document_line_id, l_orig_sys_shipment_ref
               FROM   OE_ORDER_LINES_ALL
               WHERE  line_id = l_old_line_Payment_rec.line_id;
Line: 4651

        ELSIF l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Line_Payment_rec.db_flag := FND_API.G_TRUE;
Line: 4696

           OE_MSG_PUB.update_msg_context(
   p_entity_code   => 'LINE_PAYMENT'
    ,p_entity_id           => l_line_Payment_rec.payment_number
      ,p_header_id           => l_line_Payment_rec.header_id
      ,p_line_id             => l_line_Payment_rec.line_id);
Line: 4713

         OR l_line_payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
   THEN

           IF l_debug_level  > 0 THEN
              oe_debug_pub.add('Payment:before OE_Line_Payment_Security.Attributes', 5);
Line: 4834

            IF l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                IF l_debug_level  > 0 THEN
                   oe_debug_pub.add('Payment:before OE_Validate_Line_Payment.Entity_Delete', 5);
Line: 4839

                OE_Validate_Line_Payment.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Line_Payment_rec            => l_Line_Payment_rec
                );
Line: 4844

                   oe_debug_pub.add('Payment:after OE_Validate_Line_Payment.Entity_Delete', 5);
Line: 4882

    IF NOT (l_line_payment_rec.operation  = OE_GLOBALS.G_OPR_UPDATE
           AND OE_Line_Payment_Security.g_check_all_cols_constraint = 'Y')
           AND l_control_rec.check_security
    THEN

           IF l_debug_level  > 0 THEN
              oe_debug_pub.add('Payment:before OE_Line_Payment_Security.Entity', 5);
Line: 4927

            IF l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                IF l_debug_level  > 0 THEN
                   oe_debug_pub.add('Payment:before OE_Line_Payment_Util.Delete_Row', 5);
Line: 4932

                OE_Line_Payment_Util.Delete_Row
                (   p_payment_number        => l_Line_Payment_rec.payment_number
                ,   p_line_id               => l_Line_Payment_rec.line_id
                ,   p_header_id             => l_Line_Payment_rec.header_id
                );
Line: 4938

                   oe_debug_pub.add('Payment:after OE_Line_Payment_Util.Delete_Row', 5);
Line: 4945

                l_Line_Payment_rec.last_update_date := SYSDATE;
Line: 4946

                l_Line_Payment_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
Line: 4947

                l_Line_Payment_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 4949

                IF l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    IF l_debug_level  > 0 THEN
                       oe_debug_pub.add('Payment:before OE_Line_Payment_Util.Update_Row', 5);
Line: 4954

                    OE_Line_Payment_Util.Update_Row (l_Line_Payment_rec);
Line: 4956

                       oe_debug_pub.add('Payment:after OE_Line_Payment_Util.Update_Row', 5);
Line: 4965

                       oe_debug_pub.add('Payment:before OE_Line_Payment_Util.Insert_Row', 5);
Line: 4967

                    OE_Line_Payment_Util.Insert_Row (l_Line_Payment_rec);
Line: 4969

                       oe_debug_pub.add('Payment:after OE_Line_Payment_Util.Insert_Row', 5);
Line: 5009

                  oe_debug_pub.add(  'DELETE REQUEST12' , 2 ) ;
Line: 5011

              oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
                    (p_entity_code =>OE_GLOBALS.G_ENTITY_LINE_PAYMENT,
                    p_entity_id => l_line_payment_rec.line_id,
                    x_return_status => l_return_status);
Line: 5065

              oe_debug_pub.add(  'DELETE REQUEST13' , 2 ) ;
Line: 5077

              oe_debug_pub.add(  'DELETE REQUEST14' , 2 ) ;
Line: 5089

              oe_debug_pub.add(  'DELETE REQUEST15' , 2 ) ;
Line: 5182

        ELSIF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Lot_Serial_rec.db_flag := FND_API.G_TRUE;
Line: 5271

            IF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Validate_Lot_Serial.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Lot_Serial_rec              => l_Lot_Serial_rec
                );
Line: 5300

            IF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Lot_Serial_Util.Delete_Row
                (   p_lot_serial_id               => l_Lot_Serial_rec.lot_serial_id
                );
Line: 5310

                l_Lot_Serial_rec.last_update_date := SYSDATE;
Line: 5311

                l_Lot_Serial_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
Line: 5312

                l_Lot_Serial_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 5314

                IF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Lot_Serial_Util.Update_Row (l_Lot_Serial_rec);
Line: 5323

                    OE_Lot_Serial_Util.Insert_Row (l_Lot_Serial_rec);
Line: 5384

              oe_debug_pub.add(  'DELETE REQUEST17' , 2 ) ;
Line: 5395

              oe_debug_pub.add(  'DELETE REQUEST18' , 2 ) ;
Line: 5406

              oe_debug_pub.add(  'DELETE REQUEST19' , 2 ) ;
Line: 5573

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5584

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5595

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5606

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5617

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5628

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5639

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5650

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5661

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5672

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5683

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5694

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5705

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 5980

          SELECT header_id
    INTO l_header_id
    FROM OE_ORDER_LINES_ALL
    WHERE line_id = l_line_id;
Line: 6207

    OE_DBI_UTIL.Update_DBI_Log( x_return_status  => l_return_status);
Line: 6445

              OE_GLOBALS.G_OPR_DELETE, OE_GLOBALS.G_OPR_UPDATE,
              OE_GLOBALS.G_OPR_NONE) THEN
           FND_MESSAGE.SET_NAME('ONT','OE_OI_OPERATION_CODE');
Line: 6570

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 6644

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 6868

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 6979

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 7002

                    OE_GLOBALS.G_OPR_DELETE, OE_GLOBALS.G_OPR_UPDATE,
                    OE_GLOBALS.G_OPR_INSERT, OE_GLOBALS.G_OPR_NONE) THEN
           FND_MESSAGE.SET_NAME('ONT','OE_OI_OPERATION_CODE');
Line: 7009

        IF p_x_line_tbl(I).operation = oe_globals.g_opr_update
           AND p_x_line_tbl(I).split_action_code = 'SPLIT' THEN

          -- Negotiation check has been added for bug 4758902
          BEGIN
            SELECT transaction_phase_code
            INTO   l_transaction_phase_code
            FROM   oe_order_lines_all
            WHERE  line_id = p_x_line_tbl(I).line_id;
Line: 7163

                OE_Line_Scredit_Util.Delete_Row(p_line_id =>p_x_line_scredit_tbl(I).line_id);
Line: 7299

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 7338

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 7390

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 7449

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 7613

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 7936

            SELECT flow_status_code into p_x_header_rec.flow_status_code
            FROM   oe_order_headers_all
            WHERE  header_id = p_x_header_rec.header_id;
Line: 8668

              OE_GLOBALS.G_OPR_DELETE, OE_GLOBALS.G_OPR_UPDATE,
              OE_GLOBALS.G_OPR_NONE) THEN
           FND_MESSAGE.SET_NAME('ONT','OE_OI_OPERATION_CODE');
Line: 8794

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 8870

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 8960

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 9064

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 9155

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 9210

               OE_GLOBALS.G_OPR_DELETE, OE_GLOBALS.G_OPR_UPDATE,
               OE_GLOBALS.G_OPR_INSERT, OE_GLOBALS.G_OPR_NONE) THEN
           FND_MESSAGE.SET_NAME('ONT','OE_OI_OPERATION_CODE');
Line: 9217

        IF l_line_rec.operation = oe_globals.g_opr_update
           AND l_line_rec.split_action_code = 'SPLIT' THEN
           l_call_split := TRUE;
Line: 9449

                OE_Line_Scredit_Util.Delete_Row(p_line_id =>l_Line_Scredit_tbl(I).line_id);
Line: 9541

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 9580

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 9632

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 9802

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 9889

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 10008

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => l_return_status
          );
Line: 10513

        OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
Line: 10514

        OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
Line: 10519

          oe_debug_pub.add(  'DELETE REQUEST11' , 2 ) ;
Line: 10545

        OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
Line: 10546

        OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
Line: 10551

          oe_debug_pub.add(  'DELETE REQUEST12' , 2 ) ;
Line: 10578

        OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
Line: 10579

        OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
Line: 10584

          oe_debug_pub.add(  'DELETE REQUEST13' , 2 ) ;
Line: 11348

           l_Header_Adj_Att_tbl.delete;   --6052770
Line: 11368

           l_Header_Adj_Assoc_Tbl.delete;  --6052770
Line: 11420

            l_Line_Adj_tbl.delete;  --6052770
Line: 11439

                l_Line_Price_Att_tbl.delete;  --6052770
Line: 11460

                  l_Line_Adj_Att_tbl.delete;  --6052770
Line: 11479

                 l_Line_Adj_Assoc_tbl.delete;   --6052770
Line: 11501

            l_Line_Scredit_tbl.delete;  --6052770
Line: 11522

               l_Line_Payment_tbl.delete;  --6052770
Line: 11542

            l_Lot_Serial_tbl.delete;  --6052770
Line: 11774

we have to always do a select from bom_explosions. This is so that
we can figure out nocopy if all the items are currenlty part of the Bill.


Should not come here for split lines.

2221666 : order import sends option in already create model.
2299910 : copy order, sort_order for MI.
-------------------------------------------------------------------------*/
PROCEDURE Complete_Config_Line
( p_x_line_rec       IN OUT NOCOPY OE_ORDER_PUB.Line_Rec_Type
 ,p_item_type        IN     NUMBER
 ,p_x_line_tbl       IN     OE_ORDER_PUB.Line_Tbl_Type
 ,p_process_partial  IN     BOOLEAN := FALSE)
IS
  l_model_seq_id              NUMBER;
Line: 11812

     ,p_do_update             => FALSE
     ,p_check_effective_date  => 'N'
     ,x_config_effective_date => l_rev_date
     ,x_frozen_model_bill     => l_frozen_model_bill
     ,x_return_status         => l_return_status);
Line: 11845

     ,p_do_update             => FALSE
     ,x_config_effective_date => l_rev_date
     ,x_frozen_model_bill     => l_frozen_model_bill
     ,x_return_status         => l_return_status);
Line: 11876

      SELECT component_code, component_sequence_id, bom_sort_order,
             uom_code, bom_item_type
      INTO   p_x_line_rec.component_code, p_x_line_rec.component_sequence_id,
             p_x_line_rec.sort_order, p_x_line_rec.order_quantity_uom,
             l_bom_item_type
      FROM   cz_config_details_v
      WHERE  config_hdr_id  = p_x_line_rec.config_header_id
      AND    config_rev_nbr = p_x_line_rec.config_rev_nbr
      AND    config_item_id = p_x_line_rec.configuration_id;
Line: 11898

        SELECT component_code, component_sequence_id, sort_order,
               primary_uom_code, bom_item_type
        INTO   p_x_line_rec.component_code, p_x_line_rec.component_sequence_id,
               p_x_line_rec.sort_order, p_x_line_rec.order_quantity_uom,
               l_bom_item_type
        FROM   bom_explosions
        WHERE  component_item_id    = p_x_line_rec.inventory_item_id
        AND    explosion_type       = Oe_Config_Util.OE_BMX_OPTION_COMPS
        AND    top_bill_sequence_id = l_model_seq_id
        AND    effectivity_date     <= l_rev_date
        AND    disable_date         >  l_rev_date
        AND    organization_id      =  l_validation_org
        AND    component_code       =  p_x_line_rec.component_code;
Line: 11917

        SELECT component_code, component_sequence_id, sort_order,
               primary_uom_code, bom_item_type
        INTO   p_x_line_rec.component_code, p_x_line_rec.component_sequence_id,
               p_x_line_rec.sort_order, p_x_line_rec.order_quantity_uom,
               l_bom_item_type
        FROM   bom_explosions
        WHERE  component_item_id    = p_x_line_rec.inventory_item_id
        AND    explosion_type       = Oe_Config_Util.OE_BMX_OPTION_COMPS
        AND    top_bill_sequence_id = l_model_seq_id
        AND    effectivity_date     <= l_rev_date
        AND    disable_date         > l_rev_date
        AND    organization_id      =  l_validation_org;
Line: 11935

          oe_debug_pub.add(  'SELECT COMP_CODE FAILED , NO DATA FOUND ' , 1 ) ;
Line: 11984

          oe_debug_pub.add(  'SELECT COMP_CODE FAILED , TOO_MANY ROWS ' , 1 ) ;
Line: 11996

          oe_debug_pub.add(  'SELECT COMP_CODE FAILED , OTHERS ' , 1 ) ;
Line: 12129

        SELECT ato_line_id
        INTO   l_ato_line_id
        FROM   oe_order_lines
        WHERE  top_model_line_id
               = p_x_line_tbl(l_option_index).top_model_line_id
        AND    component_code = l_component_code
        AND    open_flag = 'Y';
Line: 12195

                SELECT component_sequence_id, inventory_item_id,
                       bom_sort_order, uom_code, quantity, bom_item_type
                INTO  p_x_line_tbl(l_index).component_sequence_id,
                      p_x_line_tbl(l_index).inventory_item_id,
                      p_x_line_tbl(l_index).sort_order,
                      p_x_line_tbl(l_index).order_quantity_uom,
                      p_x_line_tbl(l_index).ordered_quantity,
                      l_bom_item_type
                FROM  cz_config_details_v
                WHERE component_code = l_component_code
                AND   config_hdr_id
                        = p_x_line_tbl(l_option_index).config_header_id
                AND   config_rev_nbr
                        = p_x_line_tbl(l_option_index).config_rev_nbr
                AND   config_item_id
                        = p_x_line_tbl(l_option_index).configuration_id;
Line: 12252

                  SELECT ordered_quantity, component_sequence_id
                  INTO   l_model_quantity, l_model_seq_id
                  FROM   oe_order_lines
                  WHERE  line_id =
                          p_x_line_tbl(l_option_index).top_model_line_id;
Line: 12270

                SELECT component_sequence_id, component_item_id, sort_order,
                       primary_uom_code, EXTENDED_QUANTITY * l_model_quantity,
                       bom_item_type
                INTO  p_x_line_tbl(l_index).component_sequence_id,
                      p_x_line_tbl(l_index).inventory_item_id,
                      p_x_line_tbl(l_index).sort_order,
                      p_x_line_tbl(l_index).order_quantity_uom,
                      p_x_line_tbl(l_index).ordered_quantity,
                      l_bom_item_type
                FROM  bom_explosions be
                WHERE be.explosion_type  = OE_Config_Util.OE_BMX_OPTION_COMPS
                AND   be.top_bill_sequence_id = l_model_seq_id
                AND   be.plan_level > 0
                AND   be.effectivity_date <= l_rev_date
                AND   be.disable_date > l_rev_date
                AND   be.component_code = l_component_code
                AND   rownum = 1;
Line: 12304

              SELECT concatenated_segments
              INTO   p_x_line_tbl(l_index).ordered_item
              FROM   MTL_SYSTEM_ITEMS_KFV
              WHERE  inventory_item_id = p_x_line_tbl(I).inventory_item_id
              AND    organization_id = l_validation_org;