DBA Data[Home] [Help]

APPS.RCV_ROI_TRANSACTION dependencies on MTL_SUPPLY

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

10844: l_complex_flag varchar2(1);
10845:
10846: /* Bug 5354379 */
10847: l_po_deliver_rti_cursor_opened NUMBER := 0;
10848: l_fetch_mtl_supply VARCHAR2(2) := 'S'; --'S' fetched mtl_supply successfully or 'E' error
10849: l_interface_txn_id NUMBER := -1;
10850: l_transaction_id NUMBER := -1;
10851: l_loop_exit_status VARCHAR2(2) := 'S'; --'S' loop exited successfully by fetching RECEIVE txnid from RT or 'E' error
10852: l_exit VARCHAR2(2) := 'N';-- 'Y' exit loop, 'N' dont exit the loop

Line 10855: 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

10851: l_loop_exit_status VARCHAR2(2) := 'S'; --'S' loop exited successfully by fetching RECEIVE txnid from RT or 'E' error
10852: l_exit VARCHAR2(2) := 'N';-- 'Y' exit loop, 'N' dont exit the loop
10853: l_parent_interface_txn_id NUMBER := -1;
10854: l_parent_transaction_id NUMBER := -1;
10855: 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
10856: l_total_receiving_quantity NUMBER := 0; --Sum of received qty of preprocessed RECEIVE txn in RTI with same group_id
10857: l_total_deliver_quantity NUMBER := 0;--Sum of delivered qty of preprocessed DELIVER txn(excluding current DELIVER txn) in RTI with same group_id
10858: l_deliver_quantity NUMBER := 0; --Deliver qty for the current deliver txn
10859: l_receive_quantity NUMBER := 0;

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

11762:
11763: /* Bug 5354379:
11764: We should not compare the transaction quantity with the po_distributions_all.ordered_quantity,
11765: because we won't be able to do DELIVER txn for the RECEIVE txns with overreceipt made.
11766: If the RECEIVE txn for that DELIVER txns lies in RT, we have to make use of mtl_supply
11767: to get the AVAILABLE quantity for DELIVER txn.
11768: If the RECEIVE txn for that DELIVER txns lies in RTI, there is no mtl_supply or rcv_supply.
11769: So, get the available qty from RTI for that DELIVER txn
11770: */

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

11764: We should not compare the transaction quantity with the po_distributions_all.ordered_quantity,
11765: because we won't be able to do DELIVER txn for the RECEIVE txns with overreceipt made.
11766: If the RECEIVE txn for that DELIVER txns lies in RT, we have to make use of mtl_supply
11767: to get the AVAILABLE quantity for DELIVER txn.
11768: If the RECEIVE txn for that DELIVER txns lies in RTI, there is no mtl_supply or rcv_supply.
11769: So, get the available qty from RTI for that DELIVER txn
11770: */
11771:
11772: IF l_po_deliver_rti_cursor_opened = 1 THEN --{ l_po_deliver_rti_cursor_opened = 1

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

11895: END IF;
11896: x_cascaded_table(n).error_status := 'E';
11897: ELSIF l_loop_exit_status = 'S' THEN --{ l_loop_exit_status = 'S'
11898: --Check where to get the AVAILABLE qty for this DELIVER txn
11899: -- if l_parent_receive_txn_in_rt is 'Y', Fetch the AVAILABLE qty from mtl_supply
11900: -- if l_parent_receive_txn_in_rt is 'N', Fetch the AVAILABLE qty from rcv_transactions_interface
11901: IF l_parent_receive_txn_in_rt = 'Y' THEN--{ l_parent_receive_txn_in_rt = 'Y'
11902: --Fetch AVAILABLE qty from mtl_supply using l_parent_transaction_id
11903:

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

11898: --Check where to get the AVAILABLE qty for this DELIVER txn
11899: -- if l_parent_receive_txn_in_rt is 'Y', Fetch the AVAILABLE qty from mtl_supply
11900: -- if l_parent_receive_txn_in_rt is 'N', Fetch the AVAILABLE qty from rcv_transactions_interface
11901: IF l_parent_receive_txn_in_rt = 'Y' THEN--{ l_parent_receive_txn_in_rt = 'Y'
11902: --Fetch AVAILABLE qty from mtl_supply using l_parent_transaction_id
11903:
11904: BEGIN --{
11905: IF (g_asn_debug = 'Y') THEN
11906: asn_debug.put_line('Fetching mtl_supply, from the fetched RECEIVE txn_id....'||l_parent_transaction_id);

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

11902: --Fetch AVAILABLE qty from mtl_supply using l_parent_transaction_id
11903:
11904: BEGIN --{
11905: IF (g_asn_debug = 'Y') THEN
11906: asn_debug.put_line('Fetching mtl_supply, from the fetched RECEIVE txn_id....'||l_parent_transaction_id);
11907: asn_debug.put_line('PO distribution id....'||x_po_transferrec.po_distribution_id);
11908: END IF;
11909: /*Fetch the available qty for DELIVER txn based on the shipment line from mtl_supply.
11910: Reason: When RECEIPT txn is performed through forms, we won't get distribution details.

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

11905: IF (g_asn_debug = 'Y') THEN
11906: asn_debug.put_line('Fetching mtl_supply, from the fetched RECEIVE txn_id....'||l_parent_transaction_id);
11907: asn_debug.put_line('PO distribution id....'||x_po_transferrec.po_distribution_id);
11908: END IF;
11909: /*Fetch the available qty for DELIVER txn based on the shipment line from mtl_supply.
11910: Reason: When RECEIPT txn is performed through forms, we won't get distribution details.
11911: For eg: Assume PO with 1 line(qty15) 1shipment(15) and
11912: 2distributions(1st distribution qty:10 and 2nd distribution qty:5)
11913: Through forms perform ACCEPT txn for qty 15 and perform delivery on

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

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

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

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

Line 11925: FROM mtl_supply

11921: So, modifying the following sql to get Available qty based on shipment_line*/
11922: -- x_cascaded_table(n) is holding current DELIVER txn record
11923: SELECT nvl(sum(quantity),0)
11924: INTO l_distribution_qty
11925: FROM mtl_supply
11926: WHERE supply_source_id = l_parent_transaction_id
11927: AND po_line_location_id = x_cascaded_table(n).po_line_location_id
11928: AND supply_type_code = 'RECEIVING';
11929:

Line 11938: l_fetch_mtl_supply := 'E';

11934:
11935: EXCEPTION
11936: WHEN NO_DATA_FOUND THEN
11937: --Error out DELIVER txn and set RTI status to 'E'
11938: l_fetch_mtl_supply := 'E';
11939: IF (g_asn_debug = 'Y') THEN
11940: asn_debug.put_line('No data found exception in fetching mtl_supply');
11941: END IF;
11942: END; --} Begin ends

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

11936: WHEN NO_DATA_FOUND THEN
11937: --Error out DELIVER txn and set RTI status to 'E'
11938: l_fetch_mtl_supply := 'E';
11939: IF (g_asn_debug = 'Y') THEN
11940: asn_debug.put_line('No data found exception in fetching mtl_supply');
11941: END IF;
11942: END; --} Begin ends
11943:
11944: IF l_fetch_mtl_supply = 'E' THEN

Line 11944: IF l_fetch_mtl_supply = 'E' THEN

11940: asn_debug.put_line('No data found exception in fetching mtl_supply');
11941: END IF;
11942: END; --} Begin ends
11943:
11944: IF l_fetch_mtl_supply = 'E' THEN
11945: --Error out this DELIVER txn and set RTI record status to 'E'
11946: IF (g_asn_debug = 'Y') THEN
11947: asn_debug.put_line('mtl_supply doesnot exist. error out the DELIVER txn...');
11948: END IF;

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

11943:
11944: IF l_fetch_mtl_supply = 'E' THEN
11945: --Error out this DELIVER txn and set RTI record status to 'E'
11946: IF (g_asn_debug = 'Y') THEN
11947: asn_debug.put_line('mtl_supply doesnot exist. error out the DELIVER txn...');
11948: END IF;
11949: x_cascaded_table(n).error_status := 'E';
11950:
11951: --

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

11997: --and po_shipment_line, to get total_deliver_qty for that po_shipment_line
11998: --( by this filter interface_transaction_id < x_po_transferrec.interface_transaction_id,
11999: -- only fetching preprocessed deliver txn)
12000: --Removing the condition on po_distribution_id, as we are honouring the DELIVER txn
12001: --based on the shipment_level quantity available in mtl_supply
12002: BEGIN--{
12003: SELECT nvl(sum(quantity),0)
12004: INTO l_total_deliver_quantity
12005: FROM rcv_transactions_interface

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

12021: asn_debug.put_line('Sum of delivered qty for preprocessed DELIVERED txns..'||l_total_deliver_quantity);
12022: END IF;
12023:
12024: --x_cascaded_table(n).quantity -> transaction qty of current Deliver txn
12025: -- l_distribution_qty -> qty available in mtl_supply
12026: -- l_total_deliver_quantity -> Quantity already consumed by the DELIVER txns(only precprocessed RTI record) submitted with the same group_id
12027: 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)
12028: --Error out this DELIVERY txn, as it results in Over delivery on that distribution
12029: IF (g_asn_debug = 'Y') THEN

Line 12278: from mtl_supply ms

12274: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
12275:
12276: select ms.quantity, ms.unit_of_measure
12277: into l_distribution_qty, l_ship_unit
12278: from mtl_supply ms
12279: where ms.supply_source_id = x_po_transferrec.rcv_transaction_id
12280: and ms.po_distribution_id = x_po_transferrec.po_distribution_id
12281: and ms.supply_type_code = 'RECEIVING';
12282:

Line 12287: --Bug 9072630 The query on mtl_supply should be based on line_location_id as for a

12283: ELSE
12284: --
12285:
12286: -- Bug 7675516: Picking l_ship_unit from MS instead of PLL.
12287: --Bug 9072630 The query on mtl_supply should be based on line_location_id as for a
12288: --Multi distributed PO user can deliver qty. for any of the distribution attached to it.
12289: SELECT nvl(sum(ms.quantity),0),
12290: ms.unit_of_measure
12291: INTO l_distribution_qty,

Line 12293: FROM mtl_supply ms

12289: SELECT nvl(sum(ms.quantity),0),
12290: ms.unit_of_measure
12291: INTO l_distribution_qty,
12292: l_ship_unit
12293: FROM mtl_supply ms
12294: WHERE ms.supply_source_id = x_po_transferrec.rcv_transaction_id
12295: AND ms.po_line_location_id = x_po_transferrec.po_line_location_id
12296: AND ms.supply_type_code = 'RECEIVING'
12297: GROUP BY ms.unit_of_measure;

Line 12299: --Bug 9072630 The qty. returned by mtl_supply should be used of considering the already

12295: AND ms.po_line_location_id = x_po_transferrec.po_line_location_id
12296: AND ms.supply_type_code = 'RECEIVING'
12297: GROUP BY ms.unit_of_measure;
12298: -- End Bug 7675516
12299: --Bug 9072630 The qty. returned by mtl_supply should be used of considering the already
12300: --processed qty. in rti.
12301: l_total_deliver_quantity:=0;
12302: FOR rtirec in rti_processed(x_cascaded_table(n).group_id,
12303: x_po_transferrec.po_line_location_id,