DBA Data[Home] [Help]

APPS.OE_LINE_FULLFILL SQL Statements

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

Line: 18

PROCEDURE Update_Blanket_Qty
     (p_line_rec              IN OE_Order_PUB.Line_Rec_Type
     ,p_fulfilled_quantity    IN NUMBER DEFAULT NULL
      )
IS

  l_fulfilled_quantity           NUMBER := p_fulfilled_quantity;
Line: 60

     SELECT transactional_curr_code, conversion_type_code
       INTO l_blanket_currency, l_conversion_type
       FROM OE_BLANKET_HEADERS
      WHERE ORDER_NUMBER = p_line_rec.blanket_number
       AND SALES_DOCUMENT_TYPE_CODE = 'B';
Line: 87

     SELECT L.Order_Quantity_UOM
       INTO l_blanket_uom
       FROM OE_BLANKET_LINES L,OE_BLANKET_LINES_EXT BL
      WHERE BL.ORDER_NUMBER  = p_line_rec.blanket_number
        AND BL.LINE_NUMBER   = p_line_rec.blanket_line_number
        AND L.LINE_ID        = BL.LINE_ID
        AND L.SALES_DOCUMENT_TYPE_CODE = 'B';
Line: 122

        UPDATE oe_blanket_lines l
           SET l.lock_control = l.lock_control + 1
         WHERE L.Line_Id IN (SELECT Line_Id FROM oe_blanket_lines_ext bl
                      WHERE bl.order_number = p_line_rec.blanket_number
                        AND bl.line_number   = p_line_rec.blanket_line_number)
          AND l.sales_document_type_code = 'B';
Line: 133

           UPDATE oe_blanket_lines_ext ble
              SET ble.fulfilled_amount = nvl(ble.fulfilled_amount,0) +
                                          l_amount
            WHERE ble.order_number = p_line_rec.blanket_number
              AND ble.line_number  = p_line_rec.blanket_line_number;
Line: 140

           UPDATE oe_blanket_lines_ext ble
              SET ble.fulfilled_quantity = nvl(ble.fulfilled_quantity,0) +
                                               l_fulfilled_quantity
                  ,ble.fulfilled_amount = nvl(ble.fulfilled_amount,0) +
                                          l_amount
            WHERE ble.order_number = p_line_rec.blanket_number
              AND ble.line_number  = p_line_rec.blanket_line_number;
Line: 149

        UPDATE oe_blanket_headers_ext bhe
           SET bhe.fulfilled_amount = nvl(bhe.fulfilled_amount,0) +
                                          l_amount
         WHERE bhe.order_number = p_line_rec.blanket_number;
Line: 154

        UPDATE oe_blanket_headers bh
           SET bh.lock_control = bh.lock_control + 1
         WHERE bh.order_number = p_line_rec.blanket_number
           AND bh.sales_document_type_code = 'B';
Line: 165

           UPDATE oe_blanket_lines_ext ble
              SET ble.returned_amount = nvl(ble.returned_amount,0) +
                                          l_amount
            WHERE ble.order_number = p_line_rec.blanket_number
              AND ble.line_number  = p_line_rec.blanket_line_number;
Line: 172

           UPDATE oe_blanket_lines_ext ble
              SET ble.returned_quantity = nvl(ble.returned_quantity,0) +
                                          l_fulfilled_quantity
                  ,ble.returned_amount = nvl(ble.returned_amount,0) +
                                          l_amount
            WHERE ble.order_number = p_line_rec.blanket_number
              AND ble.line_number  = p_line_rec.blanket_line_number;
Line: 181

        UPDATE oe_blanket_lines bl
           SET bl.lock_control = bl.lock_control + 1
         WHERE bl.line_Id IN (SELECT Line_Id FROM oe_blanket_lines_ext bl
                      WHERE bl.order_number = p_line_rec.blanket_number
                        AND bl.line_number   = p_line_rec.blanket_line_number)
           AND bl.sales_document_type_code = 'B';
Line: 188

        UPDATE oe_blanket_headers_ext bhe
           SET bhe.returned_amount = nvl(bhe.returned_amount,0) +
                                          l_amount
         WHERE bhe.order_number = p_line_rec.blanket_number;
Line: 193

        UPDATE oe_blanket_headers bh
           SET bh.lock_control = bh.lock_control + 1
         WHERE bh.order_number = p_line_rec.blanket_number
           AND bh.sales_document_type_code = 'B';
Line: 203

        oe_debug_pub.add('Update_Blanket_Qty: Others Error', 1);
Line: 210

           ,   'Update_Blanket_Qty'
          );
Line: 215

END Update_Blanket_Qty;
Line: 238

  Select  set_id
  Into  l_set_id
  From  oe_line_sets
  Where line_id = p_line_id;
Line: 282

  SELECT LINE_ID,
       HEADER_ID,
       ORDERED_QUANTITY,
       SHIPPED_QUANTITY,
       FULFILLED_FLAG,
       BLANKET_NUMBER,
       BLANKET_LINE_NUMBER,
       ORDER_QUANTITY_UOM,
       ITEM_TYPE_CODE,
       LINE_CATEGORY_CODE,
       UNIT_SELLING_PRICE,
       INVENTORY_ITEM_ID,
       ORDER_FIRMED_DATE,
       ACTUAL_SHIPMENT_DATE
  FROM   OE_ORDER_LINES_ALL
  WHERE  SERVICE_REFERENCE_LINE_ID = p_line_id
        AND    SERVICE_REFERENCE_TYPE_CODE = 'ORDER' -- added in 115.46
        AND    HEADER_ID = l_header_id   --  1717444
        AND    TOP_MODEL_LINE_ID IS NULL;   --3449588
Line: 310

          SELECT header_id
          INTO   l_header_id
          FROM   oe_order_lines
          WHERE  line_id = p_line_id;
Line: 476

  SELECT  fulfilled_quantity
  INTO    l_parent_line_fulfilled_qty
  FROM    oe_order_lines
  WHERE   line_id = p_line_id;
Line: 508

    l_fulfill_tbl(l_fulfill_index).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 517

    /* Update the fulfilled flag and quantity for the service lines */

  IF  l_fulfill_index <> 0 THEN

    IF l_debug_level  > 0 THEN
        oe_debug_pub.add(  '..516..CALLING FULFILL LINE TABLE : ' , 3 ) ;
Line: 560

    OE_Order_WF_Util.Update_Flow_Status_Code
    (p_line_id            =>  l_service_tbl(l_service_index).line_id,
    p_flow_status_code    =>  'FULFILLED',
    x_return_status       =>  l_return_status
    );
Line: 572

         oe_debug_pub.add('after update of flow status code - error '||sqlerrm,1);
Line: 577

         oe_debug_pub.add('after update of flow status code - exc error '||sqlerrm,1);
Line: 644

PROCEDURE Update_Service_Dates  /* 2048753 */
(
  p_line_rec             IN OUT NOCOPY     OE_Order_Pub.Line_Rec_Type
)
IS
l_return_status VARCHAR2(1);
Line: 658

                       oe_debug_pub.add(  'ENTERING UPDATE_SERVICE_DATES: ' || TO_CHAR ( P_LINE_REC.LINE_ID ) || ' '|| TO_CHAR ( P_LINE_REC.SERVICE_START_DATE , 'YYYY/MM/DD' ) ||' , '|| TO_CHAR ( P_LINE_REC.SERVICE_END_DATE , 'YYYY/MM/DD' ) , 5 ) ;
Line: 706

                       oe_debug_pub.add(  'EXITING UPDATE_SERVICE_DATES:' || TO_CHAR ( P_LINE_REC.SERVICE_START_DATE , 'YYYY/MM/DD' ) ||' , '|| TO_CHAR ( P_LINE_REC.SERVICE_END_DATE , 'YYYY/MM/DD' ) , 5 ) ;
Line: 709

END Update_Service_Dates;
Line: 712

   This procedure is to update the fulfilled flag, fulfilled quantity and
   fulfillment date for a line or a table of line records by calling
   Process_Order API
*/

PROCEDURE Fulfill_Line
(
 p_line_rec             IN OE_Order_Pub.Line_Rec_Type DEFAULT OE_Order_Pub.G_MISS_LINE_REC
,p_line_tbl   IN OE_Order_Pub.Line_Tbl_Type DEFAULT OE_Order_Pub.G_MISS_LINE_TBL
,p_mode     IN VARCHAR2
,p_fulfillment_type IN VARCHAR2
,p_fulfillment_activity IN VARCHAR2 DEFAULT FND_API.G_MISS_CHAR
,x_return_status        OUT NOCOPY VARCHAR2
)
IS
l_line_tbl       OE_ORDER_PUB.Line_Tbl_Type;
Line: 744

   select service_start_date,
          service_end_date,
          service_period,
          service_duration,
          service_coterminate_flag,
          item_type_code  -- this one added for 2417601
   from   oe_order_lines
   where  line_id = l_line_rec.line_id;
Line: 793

    select ordered_date into l_ordered_date
    from oe_order_headers_all
    where header_id = p_line_rec.header_id;
Line: 802

    l_update_line_tbl(1) := OE_Order_PUB.G_MISS_LINE_REC;
Line: 803

    l_update_line_tbl(1).line_id := p_line_rec.line_id;
Line: 804

    l_update_line_tbl(1).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 811

    l_update_line_tbl(1).fulfilled_flag := 'Y';
Line: 812

    l_update_line_tbl(1).fulfillment_date := SYSDATE;
Line: 843

        SELECT type INTO l_accounting_rule_type
        FROM ra_rules
        WHERE rule_id = p_line_rec.accounting_rule_id;
Line: 868

        Update_Service_Dates(l_line_rec);
Line: 872

        oe_debug_pub.add('After calling update_service_lines() ',5) ;
Line: 912

       l_line_tbl(1).last_update_date := SYSDATE;
Line: 913

       l_line_tbl(1).last_updated_by := l_user; -- 3169637
Line: 914

       l_line_tbl(1).last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 930

          OE_ORDER_UTIL.Update_Global_Picture(p_Upd_New_Rec_If_Exists =>False,
                    p_header_id=>p_line_rec.header_id,
                    p_line_rec =>l_line_tbl(1),
                    p_line_id => p_line_rec.line_id,
                    x_index => l_notify_index,
                    x_return_status => l_return_status);
Line: 939

               oe_debug_pub.add('Update_global return status from oe_line_fullfill.fullfill_line is: '|| l_return_status ) ;
Line: 966

           OE_ORDER_UTIL.g_line_tbl(l_notify_index).last_update_date := SYSDATE;
Line: 967

           OE_ORDER_UTIL.g_line_tbl(l_notify_index).last_updated_by  := l_user; -- 3169637
Line: 968

           OE_ORDER_UTIL.g_line_tbl(l_notify_index).last_update_login :=FND_GLOBAL.LOGIN_ID;
Line: 983

   UPDATE OE_ORDER_LINES_ALL
   SET    FULFILLED_FLAG = 'Y',
          FULFILLED_QUANTITY = l_fulfilled_quantity,
          FULFILLED_QUANTITY2 = l_fulfilled_quantity2, -- 5126873
          FULFILLMENT_DATE = SYSDATE,
          LAST_UPDATE_DATE = SYSDATE,
          LAST_UPDATED_BY  = l_user,  -- 3169637
          LAST_UPDATE_LOGIN = FND_GLOBAL.LOGIN_ID,
          /* next two lines: 2048753 */
          SERVICE_START_DATE = l_line_rec.service_start_date,
          SERVICE_END_DATE = l_line_rec.service_end_date,
          ACTUAL_FULFILLMENT_DATE = l_actual_fulfillment_date,
          LOCK_CONTROL = LOCK_CONTROL+1
   WHERE  LINE_ID = p_line_rec.line_id;
Line: 1017

        select order_number
          into l_order_number
          from oe_order_headers_all
         where header_id = p_line_rec.header_id;
Line: 1056

         Update_Blanket_Qty(p_line_rec,l_fulfilled_quantity);
Line: 1091

      oe_debug_pub.add('Number of lines to update: '||p_line_tbl.count,3) ;
Line: 1096

         oe_debug_pub.add('Exiting fulfill_line() - no lines to update',3) ;
Line: 1105

    select ordered_date into l_ordered_date
    from oe_order_headers_all
    where header_id = p_line_tbl(l).header_id;
Line: 1152

    l_line_tbl(l_index).last_update_date := SYSDATE;
Line: 1153

    l_line_tbl(l_index).last_updated_by := l_user;  -- 3169637
Line: 1154

    l_line_tbl(l_index).last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 1177

              Update_Service_Dates(l_line_rec);
Line: 1181

                  oe_debug_pub.add(  'AFTER CALLING UPDATE_SERVICE_DATES - ASO INSTALLED' , 5 ) ;
Line: 1189

             OE_ORDER_UTIL.Update_Global_Picture(p_Upd_New_Rec_If_Exists =>False,
                    p_header_id=>l_line_tbl(l_index).header_id,
                    p_line_rec=>l_line_tbl(l_index),
                    p_line_id => p_line_tbl(l_index).line_id,
                    x_index => l_notify_index,
                    x_return_status => l_return_status);
Line: 1196

                oe_debug_pub.add('Update_global return status from fulfill_line with line table is: '||l_return_status);
Line: 1220

                OE_ORDER_UTIL.g_line_tbl(l_notify_index).last_update_date := SYSDATE;
Line: 1221

                OE_ORDER_UTIL.g_line_tbl(l_notify_index).last_updated_by := l_user;  --  3169637
Line: 1222

                OE_ORDER_UTIL.g_line_tbl(l_notify_index).last_update_login :=FND_GLOBAL.LOGIN_ID;
Line: 1251

            Update_Service_Dates(l_line_rec);
Line: 1253

                oe_debug_pub.add('After calling update_service_dates - aso not installed',5) ;
Line: 1265

          /* 2417601 uses a different update statements for service line */


          UPDATE  OE_ORDER_LINES_ALL
          SET     FULFILLED_FLAG     = p_line_tbl(l_index).fulfilled_flag,
                  FULFILLED_QUANTITY = p_line_tbl(l_index).fulfilled_quantity,
                  FULFILLED_QUANTITY2 = p_line_tbl(l_index).fulfilled_quantity2, -- 5126873
                  FULFILLMENT_DATE   = p_line_tbl(l_index).fulfillment_date,
                  LAST_UPDATE_DATE   = SYSDATE,
                  LAST_UPDATED_BY    = l_user, -- 3169637
                  LAST_UPDATE_LOGIN  = FND_GLOBAL.LOGIN_ID,
                  SERVICE_START_DATE = l_line_rec.service_start_date,
                  SERVICE_END_DATE   = l_line_rec.service_end_date,
                  ACTUAL_FULFILLMENT_DATE   = l_actual_fulfillment_date,
                  LOCK_CONTROL = LOCK_CONTROL+1
          WHERE   LINE_ID = p_line_tbl(l_index).line_id;
Line: 1298

          select order_number
            into l_order_number
            from oe_order_headers_all
           where header_id = p_line_tbl(l_index).header_id;
Line: 1331

          UPDATE  OE_ORDER_LINES_ALL
          SET     FULFILLED_FLAG     = p_line_tbl(l_index).fulfilled_flag,
                  FULFILLED_QUANTITY = p_line_tbl(l_index).fulfilled_quantity,
                  FULFILLED_QUANTITY2 = p_line_tbl(l_index).fulfilled_quantity2, -- 5126873
                  FULFILLMENT_DATE   = p_line_tbl(l_index).fulfillment_date,
                  LAST_UPDATE_DATE   = SYSDATE,
                  LAST_UPDATED_BY    = l_user, -- 3169637
                  LAST_UPDATE_LOGIN  = FND_GLOBAL.LOGIN_ID,
                  ACTUAL_FULFILLMENT_DATE   = l_actual_fulfillment_date,
                  LOCK_CONTROL = LOCK_CONTROL+1
          WHERE   LINE_ID = p_line_tbl(l_index).line_id;
Line: 1359

             Update_Blanket_Qty(p_line_tbl(l_index)
                      ,p_line_tbl(l_index).fulfilled_quantity);
Line: 1397

  oe_debug_pub.ADD('Calling OE_Order_PVT.Process_Order to update the fulfilled quantity and fulfilled flag',2);
Line: 1402

    p_line_tbl    => l_update_line_tbl,
    p_control_rec => l_control_rec,
    x_return_status => l_return_status
  );
Line: 1592

  SELECT  wias.ACTIVITY_STATUS, wias.ACTIVITY_RESULT_CODE, wias.PROCESS_ACTIVITY
  INTO       x_activity_status_code, x_activity_result, x_activity_id
  FROM       WF_ITEM_ACTIVITY_STATUSES wias, WF_PROCESS_ACTIVITIES wpa
  WHERE wias.ITEM_KEY = p_item_key
  AND   wias.ITEM_TYPE  = p_item_type
  AND   wpa.ACTIVITY_NAME = p_activity_name
  AND       wias.PROCESS_ACTIVITY = wpa.INSTANCE_ID;
Line: 1611

                SELECT nvl(upgraded_flag,'N')
                INTO   l_upgraded_flag
                FROM   oe_order_lines
                WHERE  line_id = to_number(p_item_key);
Line: 1657

  SELECT  OLS.LINE_ID, OLS.SET_ID
  FROM    OE_LINE_SETS OLS, OE_SETS OST
  WHERE OLS.LINE_ID = p_line_id
  AND   OLS.SET_ID  = OST.SET_ID
  AND   OST.SET_TYPE = 'FULFILLMENT_SET';
Line: 1666

  SELECT  LINE_ID, SET_ID
  FROM    OE_LINE_SETS
  WHERE SET_ID = l_set_id;
Line: 1903

     select line_category_code into l_line_category_code
  from oe_order_lines_all
  where line_id = to_number(p_item_key);
Line: 1991

      SELECT nvl(upgraded_flag,'N')       -- Bug 3589692
                           INTO   l_upgraded_flag
                           FROM   oe_order_lines
                           WHERE  line_id = to_number(p_item_key);
Line: 2067

  SELECT LINE_ID,
       FULFILLED_FLAG
    FROM   OE_ORDER_LINES
  WHERE  TOP_MODEL_LINE_ID = l_top_model_line_id
  AND    OPEN_FLAG = 'Y';
Line: 2199

       SELECT LINE_ID,
              HEADER_ID,
        FULFILLED_FLAG
       FROM   OE_ORDER_LINES
       WHERE  TOP_MODEL_LINE_ID = l_top_model_line_id
       AND    OPEN_FLAG = 'Y';
Line: 2237

            select ordered_date into l_ordered_date
            from oe_order_headers_all
            where header_id = l_line_tbl(1).header_id;
Line: 2245

        update oe_order_lines
        set    fulfilled_flag = l_line_tbl(1).fulfilled_flag,
         fulfilled_quantity = l_line_tbl(1).fulfilled_quantity,
         fulfillment_date = l_line_tbl(1).fulfillment_date,
               actual_fulfillment_date = l_line_tbl(1).actual_fulfillment_date,
               lock_control = lock_control+1
  where  line_id = l_line_tbl(1).line_id;
Line: 2287

           OE_ORDER_UTIL.Update_Global_Picture(p_Upd_New_Rec_If_Exists =>False,
                    p_header_id=>l_line_tbl(1).header_id,
                    p_old_line_rec => l_old_line_tbl(1),
                    p_line_rec =>l_line_tbl(1),
                    p_line_id =>l_line_tbl(1).line_id ,
                    x_index => l_index,
                    x_return_status => l_return_status);
Line: 2295

              oe_debug_pub.add('update_global return status for line ID '||L_LINE_TBL(1).LINE_ID||'IS:'||l_return_status,1) ;
Line: 2296

              oe_debug_pub.add('update_global index in fulfill_pto_kit for line_id '||l_line_tbl(1).LINE_ID ||' is: '||l_index,1);
Line: 2309

              OE_ORDER_UTIL.g_line_tbl(l_index).last_update_date:= l_line_tbl(1).last_update_date;
Line: 2369

    OE_Order_WF_Util.Update_Flow_Status_Code
    (p_line_id            =>  l_top_lines.line_id,
     p_flow_status_code     =>  'FULFILLED',
     x_return_status      =>  l_return_status
    );
Line: 2513

    SELECT line_id, item_type_code, shippable_flag, fulfilled_flag
    FROM OE_ORDER_LINES
    WHERE top_model_line_id = p_top_model_line_id
    AND open_flag = 'Y';
Line: 2539

      SELECT count(*)
      INTO   l_count
      FROM   oe_order_lines
      WHERE  top_model_line_id = p_line_id;
Line: 2547

         SELECT item_type_code,ato_line_id
         INTO   l_item_type_code,l_ato_line_id
         FROM   oe_order_lines
         WHERE  line_id = p_line_id;
Line: 2636

              SELECT item_type_code,ato_line_id
              INTO   l_item_type_code,l_ato_line_id
              FROM   oe_order_lines
              WHERE  line_id = p_line_id;
Line: 2752

        l_fulfill_tbl(l_fulfill_index).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 2808

        l_fulfill_tbl(l_fulfill_index).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 2869

	     oe_debug_pub.add('update the flow status code on the lines ',5);
Line: 2872

        OE_Order_WF_Util.Update_Flow_Status_Code
            (p_line_id            =>  l_line_tbl(l_line_index).line_id,
            p_flow_status_code    =>  'FULFILLED',
            x_return_status       =>  l_return_status
            );
Line: 2879

             oe_debug_pub.add('after update of flow status '||l_return_status,5);
Line: 2917

	     oe_debug_pub.add('update flow status for - '||l_line_id,5);
Line: 2920

        OE_Order_WF_Util.Update_Flow_Status_Code
            (p_line_id            =>  l_fulfill_service_tbl(l_fulfill_service_index).line_id,
            p_flow_status_code    =>  'FULFILLED',
            x_return_status       =>  l_return_status
            );
Line: 3047

            SELECT HEADER_ID,
                   BLANKET_NUMBER,
                   BLANKET_LINE_NUMBER,
                   ORDER_QUANTITY_UOM,
                   ITEM_TYPE_CODE,
                   LINE_CATEGORY_CODE,
                   UNIT_SELLING_PRICE,
                   INVENTORY_ITEM_ID,
                   -- changes for AFD
                   ACTUAL_SHIPMENT_DATE,
                   ORDER_FIRMED_DATE
            FROM OE_ORDER_LINES_ALL
            WHERE LINE_ID = l_cursor_line_id;
Line: 3155

      SELECT  TOP_MODEL_LINE_ID
      INTO  l_top_model_line_id
      FROM  OE_ORDER_LINES
      WHERE LINE_ID = p_line_id;
Line: 3278

    /* Prepare a table of lines which have not been fulfilled to update
       the fulfillment related attributes  and comlpete the fulfill line */

    FOR l_line_set_index IN 1 .. l_process_tbl.count
    LOOP
      IF l_debug_level  > 0 THEN
          oe_debug_pub.add(  'LINE ID/SET ID : '|| TO_CHAR ( L_PROCESS_TBL ( L_LINE_SET_INDEX ) .LINE_ID ) ||'/'||TO_CHAR ( L_PROCESS_TBL ( L_LINE_SET_INDEX ) .SET_ID ) , 3 ) ;
Line: 3336

          l_fulfill_tbl(l_fulfill_index).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 3406

          l_fulfill_tbl(l_fulfill_index).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 3461

        SELECT  HEADER_ID
        INTO  l_header_id
        FROM  OE_ORDER_LINES
        WHERE LINE_ID = l_line_tbl(l_line_tbl_index);
Line: 3466

        OE_Order_WF_Util.Update_Flow_Status_Code
            (p_line_id            =>  l_line_tbl(l_line_tbl_index),
            p_flow_status_code    =>  'FULFILLED',
            x_return_status       =>  l_return_status
            );
Line: 3505

        UPDATE  OE_SETS
        SET SET_STATUS  = 'C',
            UPDATE_DATE = SYSDATE
        WHERE SET_ID = l_set_tbl(l_set_tbl_index);
Line: 3563

  has a fulfillment activity it updates the fulfilled quantity, flag and
  fulfillment date for the line. If the line is part of a MODEL the
  fulfillment processing for PTO/KIT will take place, if the line is part
  of fulfillment set(s) fulfillment processing for a fulfillment set will
  take place. If the line is part of a remnant MODEL the FULILL_LINE work
  flow activity will be completed for the line. If the line is not part of
  either MODEL or fulfillment set, the FULFILL_LINE work flow activity will
  be set to COMPLETE. If the line does not have a fulfillment activity and
  is not part of MODEL or fulfillment set, the fulfilled quantity will be
  updated from the ordered quantity of the line and FULFILL_LINE activity
  will be completed.
*/

PROCEDURE Process_Fulfillment
(
  p_api_version_number  IN  NUMBER
, p_line_id       IN  NUMBER
, p_activity_id     IN  NUMBER
, x_result_out OUT NOCOPY VARCHAR2

, x_return_status OUT NOCOPY VARCHAR2

, x_msg_count OUT NOCOPY VARCHAR2

, x_msg_data OUT NOCOPY VARCHAR2

)
IS

  l_line_rec          OE_Order_Pub.Line_Rec_Type;
Line: 3654

  g_set_tbl.delete;
Line: 3692

        SELECT HEADER_ID
        INTO   l_header_id
        FROM   OE_ORDER_HEADERS
        WHERE  HEADER_ID = l_line_rec.header_id
        FOR UPDATE NOWAIT;
Line: 3716

          SELECT SET_ID
          INTO   l_set_id
          FROM   OE_SETS
          WHERE  SET_ID = lock_set_id
          FOR UPDATE NOWAIT;
Line: 3734

      SELECT line_id, top_model_line_id
      INTO   l_line_id, l_top_model_line_id
      FROM   oe_order_lines
      WHERE  line_id = l_line_rec.top_model_line_id
      FOR UPDATE NOWAIT;
Line: 3754

      SELECT top_model_line_id
      INTO   l_top_model_line_id
      FROM   oe_order_lines
      WHERE  line_id = l_line_rec.service_reference_line_id
      FOR UPDATE NOWAIT;
Line: 3765

        SELECT line_id
        INTO   l_line_id
        FROM   oe_order_lines
        WHERE  line_id = l_top_model_line_id
        FOR UPDATE NOWAIT;
Line: 3775

        SELECT line_id
        INTO   l_line_id
        FROM   oe_order_lines
        WHERE  line_id = l_line_rec.service_reference_line_id
        FOR UPDATE NOWAIT;
Line: 3786

      SELECT line_id
      INTO   l_line_id
      FROM   oe_order_lines
      WHERE  line_id = l_line_rec.line_id
      FOR UPDATE NOWAIT;
Line: 3801

      SELECT line_id
      INTO   l_line_id
      FROM   oe_order_lines
      WHERE  line_id = l_line_rec.line_id
      FOR UPDATE NOWAIT;
Line: 3973

                        SELECT fulfilled_flag
                        INTO   l_fulfilled_flag
                        FROM   oe_order_lines
                        WHERE  Line_id = l_line_rec.line_id;
Line: 4094

                            oe_debug_pub.add('update flow status code',5);
Line: 4097

                         OE_Order_WF_Util.Update_Flow_Status_Code
                           (p_line_id            =>  l_line_tbl(l_line_index).line_id,
                            p_flow_status_code    =>  'FULFILLED',
                            x_return_status       =>  l_return_status
                            );
Line: 4235

              OE_Order_WF_Util.Update_Flow_Status_Code
                (p_line_id            =>  l_line_tbl(l_config_index).line_id,
                 p_flow_status_code    =>  'FULFILLED',
                 x_return_status       =>  l_return_status
                 );
Line: 4332

              OE_Order_WF_Util.Update_Flow_Status_Code
                (p_line_id            =>  l_line_rec.ato_line_id,
                 p_flow_status_code    =>  'FULFILLED',
                 x_return_status       =>  l_return_status
                 );
Line: 4483

                   SELECT fulfilled_flag,
                          header_id       -- 1717444
                   INTO   l_fulfilled_flag,
                          l_ref_header_id -- 1717444
                   FROM   oe_order_lines
                   WHERE  line_id = l_line_rec.service_reference_line_id;
Line: 4636

      SELECT '1'
        INTO l_dummy
        FROM oe_order_lines_all
       WHERE line_id = l_line_rec.line_id
         FOR update nowait;
Line: 4645

             oe_debug_pub.add('Unable to lock to update status to'||l_flow_status_code,3);
Line: 4662

    OE_Order_WF_Util.Update_Flow_Status_Code
        (p_line_id            =>  l_line_rec.line_id,
         p_flow_status_code   =>  l_flow_status_code,
         x_return_status      =>  l_return_status
         );
Line: 4829

    SELECT TOP_MODEL_LINE_ID,
         MODEL_REMNANT_FLAG
    INTO   l_store_top,
         l_store_rem
    FROM   OE_ORDER_LINES
    WHERE  LINE_ID = p_line_id;
Line: 4853

          select count(*)
          into   l_howmany
          from   oe_line_sets l,
                 oe_sets s
          where l.line_id = p_line_id
          and   l.set_id = s.set_id
          and   s.set_id <> p_set_id
          and   s.set_type = 'FULFILLMENT_SET';
Line: 4880

          select count(*)  -- added for 2525203
          into l_howmany
          from oe_line_sets l1,
               oe_line_sets l2,
               oe_sets s1,
               oe_order_lines ol
          where l1.line_id <> p_line_id
          and   l1.set_id = s1.set_id
          and   s1.set_type = 'FULFILLMENT_SET'
          and   s1.set_id <> l_set_id
          and   l2.line_id = l1.line_id
          and   l1.line_id = ol.line_id
          and   (ol.top_model_line_id is null or
                ol.top_model_line_id = ol.line_id or
                nvl(ol.model_remnant_flag, 'N') = 'Y')
          and   l2.set_id = l_set_id;
Line: 4906

          select count(*)
          into l_common_sets
          from oe_line_sets l1,
               oe_line_sets l2,
               oe_line_sets l3,
               oe_sets s1,
               oe_order_lines ol
          where l1.line_id = p_line_id
          and   l1.set_id = s1.set_id
          and   s1.set_type = 'FULFILLMENT_SET'
          and   s1.set_id <> l_set_id
          and   l2.set_id = s1.set_id
          and   l2.line_id = ol.line_id
          and   (ol.top_model_line_id is null or
                ol.top_model_line_id = ol.line_id or
                nvl(ol.model_remnant_flag, 'N') = 'Y')
          and   l2.line_id <> l1.line_id
          and   l2.line_id = l3.line_id
          and   l3.set_id = l_set_id;
Line: 4938

  g_set_tbl.delete;
Line: 4975

    SELECT TOP_MODEL_LINE_ID,
         MODEL_REMNANT_FLAG
    INTO   l_top_model_line_id,
         l_model_remnant_flag
    FROM   OE_ORDER_LINES
    WHERE  LINE_ID = l_set_tbl(l_set_index).line_id;
Line: 5240

                l_fulfilled_lines.DELETE; -- 2525203
Line: 5280

                       SELECT fulfilled_flag
                       INTO   l_fulfilled_flag
                       FROM   OE_ORDER_LINES
                       WHERE  LINE_ID = l_ful_set_tbl(l_ful_set_index).line_id;
Line: 5342

        OE_Order_WF_Util.Update_Flow_Status_Code
            (p_line_id            =>  l_ful_set_tbl(l_ful_set_index).line_Id,
            p_flow_status_code    =>  'FULFILLED',
            x_return_status       =>  l_return_status
            );
Line: 5407

        UPDATE  OE_SETS
        SET SET_STATUS  = 'C',
            UPDATE_DATE = SYSDATE
        WHERE SET_ID = l_close_tbl(l_close_tbl_index);
Line: 5427

           oe_debug_pub.add(  'CURRENT LINE IS GETTING DELETED OR CANCELLED , DONOT PROCESS ' , 3 ) ;
Line: 5523

                       SELECT fulfilled_flag
                       INTO   l_fulfilled_flag
                       FROM   OE_ORDER_LINES
                       WHERE  LINE_ID = p_line_id;
Line: 5565

      SELECT  HEADER_ID
      INTO  l_header_id
      FROM  OE_ORDER_LINES
      WHERE LINE_ID = p_line_id;
Line: 5570

      OE_Order_WF_Util.Update_Flow_Status_Code
        (p_line_id            =>  p_line_Id,
        p_flow_status_code    =>  'FULFILLED',
        x_return_status       =>  l_return_status
        );