DBA Data[Home] [Help]

APPS.OE_INTERNAL_REQUISITION_PVT SQL Statements

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

Line: 29

  select l.line_id
       , l.line_number
       , l.shipment_number
       , l.header_id
       , l.ordered_quantity
       , l.ordered_quantity2
       , l.request_date
  into   l_line_ids_rec.line_id
       , l_line_ids_rec.line_number
       , l_line_ids_rec.shipment_number
       , l_line_ids_rec.header_id
       , l_line_ids_rec.ordered_quantity
       , l_line_ids_rec.ordered_quantity2
       , l_line_ids_rec.request_date
  from   oe_order_headers_all h
       , oe_order_lines_all l
  -- OE_Order_Header_All table is used in this query to use
  -- the OE_Order_Headers_N7 index for performance reasons
  where  h.header_id = l.header_id
  and    h.source_document_id = p_internal_req_header_id
  and    l.source_document_line_id = p_internal_req_line_id
  and    h.source_document_type_id = OE_Globals.G_ORDER_SOURCE_INTERNAL
  and    h.open_flag = 'Y'
  and    l.open_flag = 'Y'
  and    nvl(l.cancelled_flag,'N') = 'N'
  and    nvl(l.fulfilled_flag,'N') = 'N'
  and    nvl(l.shipped_quantity,0) = 0
  and    nvl(l.fulfilled_quantity,0) = 0
  and    l.actual_shipment_date is null
  and    not exists (select 1 from wsh_delivery_details w
                     where  w.source_line_id = l.line_id
                     and    w.source_header_id = h.header_id
                     and    w.source_code = 'OE'
                     and    w.released_status = 'C')
  order by l.shipment_number;
Line: 106

Function Update_Allowed -- Body definition
( P_line_id          IN NUMBER
, P_Attribute        IN VARCHAR2
) RETURN BOOLEAN
IS
--
l_line_rec         OE_Order_Pub.Line_Rec_Type;
Line: 115

l_attr_update_allowed   BOOLEAN := FALSE;
Line: 116

l_entity_update_allowed BOOLEAN := FALSE;
Line: 124

    oe_debug_pub.add(  'ENTERING OE_Internal_Requisition_Pvt.Update_Allowed', 1) ;
Line: 142

      oe_debug_pub.add( ' Checking if update of Request Date is allowed', 5);
Line: 145

                ( p_operation           => OE_PC_GLOBALS.UPDATE_OP
                -- , p_column_name         => 'REQUEST_DATE'
                , p_record              => l_line_rowtype_rec
                , x_on_operation_action => l_action );
Line: 152

        oe_debug_pub.add( ' Update of Request Date is allowed. Action'||l_action,1);
Line: 154

      l_attr_update_allowed := TRUE;
Line: 157

        oe_debug_pub.add( ' Update of Request Date is not allowed.',1);
Line: 160

      l_attr_Update_Allowed := FALSE;
Line: 165

  IF (NOT l_attr_update_allowed AND P_Attribute IS NULL)
    OR P_Attribute in ('ORDERED_QUANTITY', 'ALL') THEN
    IF l_debug_level  > 0 THEN
      oe_debug_pub.add( ' Checking if update of Ordered Quantity is allowed',5);
Line: 172

                ( p_operation           => OE_PC_GLOBALS.UPDATE_OP
                -- , p_column_name         => 'ORDERED_QUANTITY'
                , p_record              => l_line_rowtype_rec
                , x_on_operation_action => l_action );
Line: 179

        oe_debug_pub.add( 'Update of Ordered Quantity is allowed. Action'||l_action,1);
Line: 181

      l_attr_Update_Allowed := TRUE;
Line: 184

        oe_debug_pub.add( ' Update of Ordered Quantity is not allowed.',1);
Line: 187

      l_attr_Update_Allowed := FALSE;
Line: 192

    oe_debug_pub.add( ' Checking if Update operation is allowed for a record',5);
Line: 194

  IF ( NOT l_entity_update_allowed ) AND ( l_attr_update_allowed ) THEN

    l_line_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 205

        oe_debug_pub.add( 'Update is allowed for Entity. Action'||l_action,1);
Line: 207

      l_entity_Update_Allowed := TRUE;
Line: 210

        oe_debug_pub.add( ' Entity Update is not allowed.',1);
Line: 213

      l_entity_Update_Allowed := FALSE;
Line: 215

  END IF; -- l_entity_update_allowed
Line: 217

  IF l_entity_update_allowed AND l_attr_update_allowed THEN
    IF l_debug_level  > 0 THEN
      oe_debug_pub.add( ' Order Line is allowed to UPDATE.',1);
Line: 224

      oe_debug_pub.add( ' Order Line is NOT allowed to UPDATE.',1);
Line: 227

    l_entity_update_allowed := FALSE;
Line: 228

    l_attr_update_allowed   := FALSE;
Line: 233

    oe_debug_pub.add(  'EXITING OE_Internal_Requisition_Pvt.Update_Allowed', 1 ) ;
Line: 237

    oe_debug_pub.add(  ' When Others of OE_Internal_Requisition_Pvt.Update_Allowed '||sqlerrm,1);
Line: 239

      OE_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Update_Allowed');
Line: 243

End Update_Allowed;
Line: 275

  l_line_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 297

                ( p_operation           => OE_PC_GLOBALS.UPDATE_OP
                -- , p_column_name         => 'ORDERED_QUANTITY'
                , p_record              => l_rowtype_rec
                , x_on_operation_action => l_action );
Line: 589

      select requisition_header_id
      into   l_req_hdr_id
      from   po_requisition_lines_all
      where  requisition_line_id = P_internal_req_line_id;
Line: 750

      select requisition_header_id
      into   l_req_hdr_id
      from   po_requisition_lines_all
      where  requisition_line_id = P_internal_req_line_id;
Line: 776

    select l.line_id, l.header_id
    into   l_line_id, l_header_id
    from   oe_order_headers_all h
         , oe_order_lines_all l
         , oe_order_holds_all oh
         , oe_hold_sources_all hs
    -- OE_Order_Header_All table is used in this query to use
    -- the OE_Order_Headers_N7 index for performance reasons
    where  h.header_id = l.header_id
    and    h.header_id = oh.header_id
    and    l.line_id = oh.line_id
    and    oh.hold_source_id = hs.hold_source_id
    and    hs.hold_id = 17
    and    oh.hold_release_id is null
    and    h.order_source_id = OE_Globals.G_ORDER_SOURCE_INTERNAL
    and    h.source_document_id = l_req_hdr_id
    and    l.source_document_line_id = P_internal_req_line_id;
Line: 889

,  X_Update_Allowed         OUT NOCOPY BOOLEAN
,  X_Cancel_Allowed         OUT NOCOPY BOOLEAN
,  X_msg_count              OUT NOCOPY NUMBER
,  X_msg_data               OUT NOCOPY VARCHAR2
,  X_return_status	    OUT NOCOPY VARCHAR2
) IS

--
CURSOR All_Order_Lines (v_order_header_id NUMBER) IS
select l.line_id
from   oe_order_lines_all l
where  l.header_id = v_order_header_id
and    nvl(l.cancelled_flag,'N') = 'N';
Line: 912

l_update_allowed        BOOLEAN := FALSE;
Line: 947

  X_Update_Allowed := FALSE;
Line: 961

      oe_debug_pub.add('Requisition Line is NULL. We cannot check if Requisition Line is allowed to Update',1);
Line: 963

    X_UPDATE_Allowed := FALSE;
Line: 969

      select h.header_id
      into   l_header_id
      from   oe_order_headers_all h
      where  h.source_document_id = p_internal_req_header_id
      and    h.order_source_id = OE_Globals.G_ORDER_SOURCE_INTERNAL
      and    h.open_flag = 'Y';
Line: 1058

      select requisition_header_id
      into   l_req_hdr_id
      from   po_requisition_lines_all
      where  requisition_line_id = P_internal_req_line_id;
Line: 1098

  IF NOT X_Update_Allowed THEN
    IF l_debug_level  > 0 THEN
       oe_debug_pub.add( ' Checking if Update is allowed',5);
Line: 1102

    l_Update_Allowed := Update_Allowed(P_Line_id => l_line_ids_rec.line_id);
Line: 1103

    IF l_Update_Allowed THEN
      IF l_debug_level  > 0 THEN
        oe_debug_pub.add( ' Update is Allowed',5);
Line: 1107

      X_Update_Allowed := TRUE;
Line: 1110

        oe_debug_pub.add(' Update is Not Allowed for this requisition line',1);
Line: 1141

    IF X_Update_Allowed THEN
      oe_debug_pub.add(  ' Record is allowed to Update',5);
Line: 1162

    X_Update_Allowed := FALSE;
Line: 1170

    X_Update_Allowed := FALSE;
Line: 1179

    X_Update_Allowed := FALSE;
Line: 1205

select l.line_id, l.header_id, l.ordered_quantity2
from   oe_order_lines_all l
--     , oe_order_headers_all h
where  nvl(l.shipped_quantity,0) = 0
-- and    h.orig_sys_document_ref = p_internal_req_header_id
-- and    h.order_source_id = OE_Globals.G_ORDER_SOURCE_INTERNAL
-- and    h.header_id = v_order_header_id
-- and    h.header_id = l.header_id
and    l.source_document_id = p_internal_req_header_id
and    l.order_source_id = OE_Globals.G_ORDER_SOURCE_INTERNAL
and    l.header_id = v_order_header_id
-- and    h.open_flag = 'Y'
and    nvl(cancelled_flag,'N') = 'N'
and    l.open_flag = 'Y'
and    not exists (select 1 from wsh_delivery_details w
                   where  w.source_line_id = l.line_id
                   and    w.source_code = 'OE'
                   and    released_status = 'C')
order by l.line_id;
Line: 1240

l_lin_update    NUMBER := 0;
Line: 1333

      select requisition_header_id
      into   l_req_hdr_id
      from   po_requisition_lines_all
      where  requisition_line_id = P_internal_req_line_id;
Line: 1361

  G_Update_ISO_From_Req := TRUE; -- Confirming IR initiated change
Line: 1363

  l_lin_update := 0;
Line: 1371

      select header_id
      into   l_order_header_id
      from   oe_order_headers_all h
      where  h.source_document_id = l_req_hdr_id
      and    h.order_source_id = OE_Globals.G_ORDER_SOURCE_INTERNAL
      and    h.open_flag = 'Y';
Line: 1415

          l_line_tbl(l_cancel_eligble_lin).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 1425

      select count(line_id)
      into   l_count_of_lines
      from   oe_order_lines_all
      where  header_id = l_order_header_id
      and    nvl(cancelled_flag,'N') = 'N';
Line: 1464

          l_header_rec.operation      := OE_GLOBALS.G_OPR_UPDATE;
Line: 1570

        l_line_tbl(l_lin_cancel).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 1587

      AND p_Delta_Ordered_Qty <> 0) THEN -- This is an update request

      IF l_debug_level > 0 THEN
        oe_debug_pub.add(' This is an Update request',5);
Line: 1598

          oe_debug_pub.add(' Check if update is allowed for line_id '||l_line_ids_rec.line_id,5);
Line: 1601

          Update_Allowed( p_Line_id   => l_line_ids_rec.line_id
                        , P_Attribute => 'REQUEST_DATE') THEN

          IF l_debug_level > 0 THEN
            oe_debug_pub.add(' Request Date is different w.r.t. sales order line ',5);
Line: 1609

          l_lin_update := l_lin_update + 1;
Line: 1613

          l_line_tbl(l_lin_update) := l_line_orig_rec;
Line: 1617

          l_line_tbl(l_lin_update).operation   := OE_GLOBALS.G_OPR_UPDATE;
Line: 1618

          l_line_tbl(l_lin_update).request_date  := P_New_Request_Date;
Line: 1619

          l_line_tbl(l_lin_update).change_reason := 'IR_ISO_CMS_CHG'; --'Internal requisition initiated change';
Line: 1625

            oe_debug_pub.add(' Update is not allowed for this line. Setting the status to Error',5);
Line: 1635

          oe_debug_pub.add(' Check for update of Line_id '||l_line_ids_rec.line_id,5);
Line: 1637

        IF Update_Allowed( p_Line_id   => l_line_ids_rec.line_id
                         , P_Attribute => 'ORDERED_QUANTITY') THEN

          l_lin_update := l_lin_update + 1;
Line: 1644

          l_line_tbl(l_lin_update) := l_line_orig_rec;
Line: 1648

          l_line_tbl(l_lin_update).ordered_quantity := l_line_ids_rec.ordered_quantity + P_Delta_Ordered_Qty;
Line: 1649

          l_line_tbl(l_lin_update).operation     := OE_GLOBALS.G_OPR_UPDATE;
Line: 1650

          l_line_tbl(l_lin_update).change_reason := 'IR_ISO_CMS_CHG'; --'Internal requisition initiated change';
Line: 1656

            oe_debug_pub.add(' Update is not allowed for this line. Setting the status to Error',5);
Line: 1666

          oe_debug_pub.add(' Check for update of Line_id '||l_line_ids_rec.line_id,5);
Line: 1669

           Update_Allowed( p_Line_id   => l_line_ids_rec.line_id
                         , P_Attribute => 'ALL') THEN

          l_lin_update := l_lin_update + 1;
Line: 1676

          l_line_tbl(l_lin_update) := l_line_orig_rec;
Line: 1680

          l_line_tbl(l_lin_update).ordered_quantity := l_line_ids_rec.ordered_quantity + P_Delta_Ordered_Qty;
Line: 1681

          l_line_tbl(l_lin_update).operation   := OE_GLOBALS.G_OPR_UPDATE;
Line: 1682

          l_line_tbl(l_lin_update).request_date  := P_New_Request_Date;
Line: 1683

          l_line_tbl(l_lin_update).change_reason := 'IR_ISO_CMS_CHG'; --'Internal requisition initiated change';
Line: 1688

            oe_debug_pub.add(' Update is not allowed for this line. Setting the status to Error',5);
Line: 1694

  END IF; -- Update/Cancel Request
Line: 1734

  G_Update_ISO_From_Req := FALSE; -- Confirming IR initiated change
Line: 1749

    G_Update_ISO_From_Req := FALSE; -- Confirming IR initiated change
Line: 1757

    G_Update_ISO_From_Req := FALSE; -- Confirming IR initiated change
Line: 1770

    G_Update_ISO_From_Req := FALSE; -- Confirming IR initiated change