DBA Data[Home] [Help]

APPS.RCV_ROI_TRANSACTION dependencies on MTL_SUPPLY

Line 9806: l_fetch_mtl_supply VARCHAR2(2) := 'S'; --'S' fetched mtl_supply successfully or 'E' error

9802: l_complex_flag varchar2(1);
9803:
9804: /* Bug 5354379 */
9805: l_po_deliver_rti_cursor_opened NUMBER := 0;
9806: l_fetch_mtl_supply VARCHAR2(2) := 'S'; --'S' fetched mtl_supply successfully or 'E' error
9807: l_interface_txn_id NUMBER := -1;
9808: l_transaction_id NUMBER := -1;
9809: l_loop_exit_status VARCHAR2(2) := 'S'; --'S' loop exited successfully by fetching RECEIVE txnid from RT or 'E' error
9810: l_exit VARCHAR2(2) := 'N';-- 'Y' exit loop, 'N' dont exit the loop

Line 9813: l_parent_receive_txn_in_rt VARCHAR2(2) := 'Y';-- 'Y'->Receive txn is in RT, so mtl_supply exists or 'N' RECEIVE txn still in RTI

9809: l_loop_exit_status VARCHAR2(2) := 'S'; --'S' loop exited successfully by fetching RECEIVE txnid from RT or 'E' error
9810: l_exit VARCHAR2(2) := 'N';-- 'Y' exit loop, 'N' dont exit the loop
9811: l_parent_interface_txn_id NUMBER := -1;
9812: l_parent_transaction_id NUMBER := -1;
9813: l_parent_receive_txn_in_rt VARCHAR2(2) := 'Y';-- 'Y'->Receive txn is in RT, so mtl_supply exists or 'N' RECEIVE txn still in RTI
9814: l_total_receiving_quantity NUMBER := 0; --Sum of received qty of preprocessed RECEIVE txn in RTI with same group_id
9815: l_total_deliver_quantity NUMBER := 0;--Sum of delivered qty of preprocessed DELIVER txn(excluding current DELIVER txn) in RTI with same group_id
9816: l_deliver_quantity NUMBER := 0; --Deliver qty for the current deliver txn
9817: l_receive_quantity NUMBER := 0;

Line 10654: If the RECEIVE txn for that DELIVER txns lies in RT, we have to make use of mtl_supply

10650:
10651: /* Bug 5354379:
10652: We should not compare the transaction quantity with the po_distributions_all.ordered_quantity,
10653: because we won't be able to do DELIVER txn for the RECEIVE txns with overreceipt made.
10654: If the RECEIVE txn for that DELIVER txns lies in RT, we have to make use of mtl_supply
10655: to get the AVAILABLE quantity for DELIVER txn.
10656: If the RECEIVE txn for that DELIVER txns lies in RTI, there is no mtl_supply or rcv_supply.
10657: So, get the available qty from RTI for that DELIVER txn
10658: */

Line 10656: If the RECEIVE txn for that DELIVER txns lies in RTI, there is no mtl_supply or rcv_supply.

10652: We should not compare the transaction quantity with the po_distributions_all.ordered_quantity,
10653: because we won't be able to do DELIVER txn for the RECEIVE txns with overreceipt made.
10654: If the RECEIVE txn for that DELIVER txns lies in RT, we have to make use of mtl_supply
10655: to get the AVAILABLE quantity for DELIVER txn.
10656: If the RECEIVE txn for that DELIVER txns lies in RTI, there is no mtl_supply or rcv_supply.
10657: So, get the available qty from RTI for that DELIVER txn
10658: */
10659:
10660: IF l_po_deliver_rti_cursor_opened = 1 THEN --{ l_po_deliver_rti_cursor_opened = 1

Line 10787: -- if l_parent_receive_txn_in_rt is 'Y', Fetch the AVAILABLE qty from mtl_supply

10783: END IF;
10784: x_cascaded_table(n).error_status := 'E';
10785: ELSIF l_loop_exit_status = 'S' THEN --{ l_loop_exit_status = 'S'
10786: --Check where to get the AVAILABLE qty for this DELIVER txn
10787: -- if l_parent_receive_txn_in_rt is 'Y', Fetch the AVAILABLE qty from mtl_supply
10788: -- if l_parent_receive_txn_in_rt is 'N', Fetch the AVAILABLE qty from rcv_transactions_interface
10789: IF l_parent_receive_txn_in_rt = 'Y' THEN--{ l_parent_receive_txn_in_rt = 'Y'
10790: --Fetch AVAILABLE qty from mtl_supply using l_parent_transaction_id
10791: BEGIN --{

Line 10790: --Fetch AVAILABLE qty from mtl_supply using l_parent_transaction_id

10786: --Check where to get the AVAILABLE qty for this DELIVER txn
10787: -- if l_parent_receive_txn_in_rt is 'Y', Fetch the AVAILABLE qty from mtl_supply
10788: -- if l_parent_receive_txn_in_rt is 'N', Fetch the AVAILABLE qty from rcv_transactions_interface
10789: IF l_parent_receive_txn_in_rt = 'Y' THEN--{ l_parent_receive_txn_in_rt = 'Y'
10790: --Fetch AVAILABLE qty from mtl_supply using l_parent_transaction_id
10791: BEGIN --{
10792: IF (g_asn_debug = 'Y') THEN
10793: asn_debug.put_line('Fetching mtl_supply, from the fetched RECEIVE txn_id....'||l_parent_transaction_id);
10794: asn_debug.put_line('PO distribution id....'||x_po_transferrec.po_distribution_id);

Line 10793: asn_debug.put_line('Fetching mtl_supply, from the fetched RECEIVE txn_id....'||l_parent_transaction_id);

10789: IF l_parent_receive_txn_in_rt = 'Y' THEN--{ l_parent_receive_txn_in_rt = 'Y'
10790: --Fetch AVAILABLE qty from mtl_supply using l_parent_transaction_id
10791: BEGIN --{
10792: IF (g_asn_debug = 'Y') THEN
10793: asn_debug.put_line('Fetching mtl_supply, from the fetched RECEIVE txn_id....'||l_parent_transaction_id);
10794: asn_debug.put_line('PO distribution id....'||x_po_transferrec.po_distribution_id);
10795: END IF;
10796: /*Fetch the available qty for DELIVER txn based on the shipment line from mtl_supply.
10797: Reason: When RECEIPT txn is performed through forms, we won't get distribution details.

Line 10796: /*Fetch the available qty for DELIVER txn based on the shipment line from mtl_supply.

10792: IF (g_asn_debug = 'Y') THEN
10793: asn_debug.put_line('Fetching mtl_supply, from the fetched RECEIVE txn_id....'||l_parent_transaction_id);
10794: asn_debug.put_line('PO distribution id....'||x_po_transferrec.po_distribution_id);
10795: END IF;
10796: /*Fetch the available qty for DELIVER txn based on the shipment line from mtl_supply.
10797: Reason: When RECEIPT txn is performed through forms, we won't get distribution details.
10798: For eg: Assume PO with 1 line(qty15) 1shipment(15) and
10799: 2distributions(1st distribution qty:10 and 2nd distribution qty:5)
10800: Through forms perform ACCEPT txn for qty 15 and perform delivery on

Line 10804: forms for qty 30. As per Cascading logic, in mtl_supply we are having qty:10 for distribution1

10800: Through forms perform ACCEPT txn for qty 15 and perform delivery on
10801: ditribution1 for qty:15. Transaction is allowed.
10802: We should have same behavoiur, when it is done through ROI also.
10803: Another case, When user peforms Overreceipt for the similar PO(mentioned above)through
10804: forms for qty 30. As per Cascading logic, in mtl_supply we are having qty:10 for distribution1
10805: and qty:20 in case of distribution2. But user is not aware of this cascading done in mtl_supply.
10806: So, we have to allow over delivery on the specified distribution, if it is with in the
10807: received qty for that shipment line.
10808: So, modifying the following sql to get Available qty based on shipment_line*/

Line 10805: and qty:20 in case of distribution2. But user is not aware of this cascading done in mtl_supply.

10801: ditribution1 for qty:15. Transaction is allowed.
10802: We should have same behavoiur, when it is done through ROI also.
10803: Another case, When user peforms Overreceipt for the similar PO(mentioned above)through
10804: forms for qty 30. As per Cascading logic, in mtl_supply we are having qty:10 for distribution1
10805: and qty:20 in case of distribution2. But user is not aware of this cascading done in mtl_supply.
10806: So, we have to allow over delivery on the specified distribution, if it is with in the
10807: received qty for that shipment line.
10808: So, modifying the following sql to get Available qty based on shipment_line*/
10809: -- x_cascaded_table(n) is holding current DELIVER txn record

Line 10812: FROM mtl_supply

10808: So, modifying the following sql to get Available qty based on shipment_line*/
10809: -- x_cascaded_table(n) is holding current DELIVER txn record
10810: SELECT nvl(sum(quantity),0)
10811: INTO l_distribution_qty
10812: FROM mtl_supply
10813: WHERE supply_source_id = l_parent_transaction_id
10814: AND po_line_location_id = x_cascaded_table(n).po_line_location_id
10815: AND supply_type_code = 'RECEIVING';
10816:

Line 10825: l_fetch_mtl_supply := 'E';

10821:
10822: EXCEPTION
10823: WHEN NO_DATA_FOUND THEN
10824: --Error out DELIVER txn and set RTI status to 'E'
10825: l_fetch_mtl_supply := 'E';
10826: IF (g_asn_debug = 'Y') THEN
10827: asn_debug.put_line('No data found exception in fetching mtl_supply');
10828: END IF;
10829: END; --} Begin ends

Line 10827: asn_debug.put_line('No data found exception in fetching mtl_supply');

10823: WHEN NO_DATA_FOUND THEN
10824: --Error out DELIVER txn and set RTI status to 'E'
10825: l_fetch_mtl_supply := 'E';
10826: IF (g_asn_debug = 'Y') THEN
10827: asn_debug.put_line('No data found exception in fetching mtl_supply');
10828: END IF;
10829: END; --} Begin ends
10830:
10831: IF l_fetch_mtl_supply = 'E' THEN

Line 10831: IF l_fetch_mtl_supply = 'E' THEN

10827: asn_debug.put_line('No data found exception in fetching mtl_supply');
10828: END IF;
10829: END; --} Begin ends
10830:
10831: IF l_fetch_mtl_supply = 'E' THEN
10832: --Error out this DELIVER txn and set RTI record status to 'E'
10833: IF (g_asn_debug = 'Y') THEN
10834: asn_debug.put_line('mtl_supply doesnot exist. error out the DELIVER txn...');
10835: END IF;

Line 10834: asn_debug.put_line('mtl_supply doesnot exist. error out the DELIVER txn...');

10830:
10831: IF l_fetch_mtl_supply = 'E' THEN
10832: --Error out this DELIVER txn and set RTI record status to 'E'
10833: IF (g_asn_debug = 'Y') THEN
10834: asn_debug.put_line('mtl_supply doesnot exist. error out the DELIVER txn...');
10835: END IF;
10836: x_cascaded_table(n).error_status := 'E';
10837: IF l_po_rel_num = -1 THEN--Bug 5439085
10838: rcv_error_pkg.set_error_message('RCV_TRX_QTY_EXCEEDS_AVL_QTY_PO', x_cascaded_table(n).error_message);

Line 10862: --based on the shipment_level quantity available in mtl_supply

10858: --and po_shipment_line, to get total_deliver_qty for that po_shipment_line
10859: --( by this filter interface_transaction_id < x_po_transferrec.interface_transaction_id,
10860: -- only fetching preprocessed deliver txn)
10861: --Removing the condition on po_distribution_id, as we are honouring the DELIVER txn
10862: --based on the shipment_level quantity available in mtl_supply
10863: BEGIN--{
10864: SELECT nvl(sum(quantity),0)
10865: INTO l_total_deliver_quantity
10866: FROM rcv_transactions_interface

Line 10886: -- l_distribution_qty -> qty available in mtl_supply

10882: asn_debug.put_line('Sum of delivered qty for preprocessed DELIVERED txns..'||l_total_deliver_quantity);
10883: END IF;
10884:
10885: --x_cascaded_table(n).quantity -> transaction qty of current Deliver txn
10886: -- l_distribution_qty -> qty available in mtl_supply
10887: -- l_total_deliver_quantity -> Quantity already consumed by the DELIVER txns(only precprocessed RTI record) submitted with the same group_id
10888: IF x_cascaded_table(n).quantity > (l_distribution_qty - l_total_deliver_quantity) THEN --{ x_cascaded_table(n).quantity > (l_distribution_qty - l_total_deliver_quantity)
10889: --Error out this DELIVERY txn, as it results in Over delivery on that distribution
10890: IF (g_asn_debug = 'Y') THEN

Line 11059: FROM mtl_supply ms,

11055: SELECT ms.quantity,
11056: poll.unit_meas_lookup_code
11057: INTO l_distribution_qty,
11058: l_ship_unit
11059: FROM mtl_supply ms,
11060: po_line_locations poll
11061: WHERE ms.supply_source_id = x_po_transferrec.rcv_transaction_id
11062: AND ms.po_distribution_id = x_po_transferrec.po_distribution_id
11063: AND poll.line_location_id = ms.po_line_location_id