DBA Data[Home] [Help]

APPS.OE_ORDER_PVT SQL Statements

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

Line: 335

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

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

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

  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(  'CHECK ATTRIBUTES SECURITY' ) ;
Line: 670

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

    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' ) ;
Line: 746

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

            p_x_header_rec.last_update_date  := SYSDATE;
Line: 757

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

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

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

                OE_Header_Util.Update_Row (p_x_header_rec);
Line: 787

                OE_Header_Util.Insert_Row (p_x_header_rec);
Line: 829

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                l_Header_Scredit_rec.last_update_date := SYSDATE;
Line: 1304

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

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

                IF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Header_Scredit_Util.Update_Row (l_Header_Scredit_rec);
Line: 1316

                    OE_Header_Scredit_Util.Insert_Row (l_Header_Scredit_rec);
Line: 1356

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

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

                      ROLLBACK TO SAVEPOINT DELETE_SCREDIT_FAILED;
Line: 1423

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                l_Header_Payment_rec.last_update_date := SYSDATE;
Line: 1961

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

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

                IF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Header_Payment_Util.Update_Row (l_Header_Payment_rec);
Line: 1974

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

                    OE_Header_Payment_Util.Insert_Row (l_Header_Payment_rec);
Line: 1978

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

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

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

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

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

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

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

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

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

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

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

          l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
      THEN

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

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

      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' , 2 ) ;
Line: 3357

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

        ELSE -- operation is update or create

          --  Get Who Information

          l_line_rec.last_update_date    := SYSDATE;
Line: 3393

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

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

          IF l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
            IF l_debug_level  > 0 THEN
                oe_debug_pub.add(  'CALLING UPDATE ROW' , 1 ) ;
Line: 3404

            OE_Line_Util.Update_Row (l_line_rec);
Line: 3415

            OE_Line_Util.Insert_Row (l_line_rec);
Line: 3419

        END IF; -- operation = delete
Line: 3488

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

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

           l_options_index_tbl.DELETE;
Line: 3626

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

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

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

                OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
Line: 3658

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

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

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

                OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
Line: 3688

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

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

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

	 OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
Line: 3802

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

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

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

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

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

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

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

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

                l_Line_Scredit_rec.last_update_date := SYSDATE;
Line: 4148

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

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

                IF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Line_Scredit_Util.Update_Row (l_Line_Scredit_rec);
Line: 4160

                    OE_Line_Scredit_Util.Insert_Row (l_Line_Scredit_rec);
Line: 4199

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                l_Line_Payment_rec.last_update_date := SYSDATE;
Line: 4804

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

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

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

                    OE_Line_Payment_Util.Update_Row (l_Line_Payment_rec);
Line: 4814

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

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

                    OE_Line_Payment_Util.Insert_Row (l_Line_Payment_rec);
Line: 4827

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

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

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

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

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

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

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

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

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

                l_Lot_Serial_rec.last_update_date := SYSDATE;
Line: 5169

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

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

                IF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Lot_Serial_Util.Update_Row (l_Lot_Serial_rec);
Line: 5181

                    OE_Lot_Serial_Util.Insert_Row (l_Lot_Serial_rec);
Line: 5242

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

           l_Header_Adj_Att_tbl.delete;   --6052770
Line: 11139

           l_Header_Adj_Assoc_Tbl.delete;  --6052770
Line: 11191

            l_Line_Adj_tbl.delete;  --6052770
Line: 11210

                l_Line_Price_Att_tbl.delete;  --6052770
Line: 11231

                  l_Line_Adj_Att_tbl.delete;  --6052770
Line: 11250

                 l_Line_Adj_Assoc_tbl.delete;   --6052770
Line: 11272

            l_Line_Scredit_tbl.delete;  --6052770
Line: 11293

               l_Line_Payment_tbl.delete;  --6052770
Line: 11313

            l_Lot_Serial_tbl.delete;  --6052770
Line: 11545

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

     ,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: 11616

     ,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: 11647

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

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

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

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

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

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

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

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

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

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

              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;