DBA Data[Home] [Help]

APPS.OE_INTERNAL_REQUISITION_PVT SQL Statements

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

Line: 32

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

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

l_attr_update_allowed   BOOLEAN := FALSE;
Line: 119

l_entity_update_allowed BOOLEAN := FALSE;
Line: 127

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

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

                ( 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: 155

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

      l_attr_update_allowed := TRUE;
Line: 160

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

      l_attr_Update_Allowed := FALSE;
Line: 168

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

                ( 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: 182

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

      l_attr_Update_Allowed := TRUE;
Line: 187

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

      l_attr_Update_Allowed := FALSE;
Line: 195

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

  IF ( NOT l_entity_update_allowed ) AND ( l_attr_update_allowed ) THEN

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

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

      l_entity_Update_Allowed := TRUE;
Line: 213

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

      l_entity_Update_Allowed := FALSE;
Line: 218

  END IF; -- l_entity_update_allowed
Line: 220

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

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

    l_entity_update_allowed := FALSE;
Line: 231

    l_attr_update_allowed   := FALSE;
Line: 236

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

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

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

End Update_Allowed;
Line: 278

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

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

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

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

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

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

l_update_allowed        BOOLEAN := FALSE;
Line: 1058

  X_Update_Allowed := FALSE;
Line: 1072

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

    X_UPDATE_Allowed := FALSE;
Line: 1080

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

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

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

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

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

      X_Update_Allowed := TRUE;
Line: 1221

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

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

    X_Update_Allowed := FALSE;
Line: 1291

    X_Update_Allowed := FALSE;
Line: 1305

    X_Update_Allowed := FALSE;
Line: 1337

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

l_lin_update    NUMBER := 0;
Line: 1484

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

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

  l_lin_update := 0;
Line: 1522

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

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

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

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

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

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

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

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

          l_lin_update := l_lin_update + 1;
Line: 1764

          l_line_tbl(l_lin_update) := l_line_orig_rec;
Line: 1768

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

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

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

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

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

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

          l_line_tbl(l_lin_update) := l_line_orig_rec;
Line: 1799

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

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

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

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

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

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

          l_lin_update := l_lin_update + 1;
Line: 1827

          l_line_tbl(l_lin_update) := l_line_orig_rec;
Line: 1831

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

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

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

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

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

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

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

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

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

    G_Update_ISO_From_Req := FALSE; -- Confirming IR initiated change