DBA Data[Home] [Help]

APPS.RCV_ROI_TRANSACTION dependencies on PO_DISTRIBUTIONS

Line 3325: FROM po_distributions pod,

3321: pll.ship_to_location_id,
3322: NVL(pll.enforce_ship_to_location_code, 'NONE') enforce_ship_to_location_code,
3323: TO_NUMBER(NULL) shipment_line_id, -- shipment_line_id
3324: pl.item_id
3325: FROM po_distributions pod,
3326: po_line_locations pll,
3327: po_lines pl,
3328: po_headers ph
3329: WHERE ph.po_header_id = header_id

Line 3352: ***** was driving through PO_HEADERS_ALL followed by PO_DISTRIBUTIONS_ALL

3348: ORDER BY NVL(pll.promised_date, Nvl(pll.need_by_date,pll.creation_date)), Nvl(pll.need_by_date,pll.creation_date), pll.creation_date; --bug10022180
3349:
3350: /***** Bug # 1553154
3351: ***** There was a performance issue since the cursor DISTRIBUTIONS
3352: ***** was driving through PO_HEADERS_ALL followed by PO_DISTRIBUTIONS_ALL
3353: ***** Modified the Select statement so that it will drive through
3354: ***** PO_HEADERS_ALL followed by PO_LINES_ALL which is followed by
3355: ***** PO_LINE_LOCATIONS_ALL which in turn is followed by
3356: ***** PO_DISTRIBUTIONS_ALL so that there is an improvement in

Line 3356: ***** PO_DISTRIBUTIONS_ALL so that there is an improvement in

3352: ***** was driving through PO_HEADERS_ALL followed by PO_DISTRIBUTIONS_ALL
3353: ***** Modified the Select statement so that it will drive through
3354: ***** PO_HEADERS_ALL followed by PO_LINES_ALL which is followed by
3355: ***** PO_LINE_LOCATIONS_ALL which in turn is followed by
3356: ***** PO_DISTRIBUTIONS_ALL so that there is an improvement in
3357: ***** Performance
3358: *****/
3359: CURSOR count_distributions(
3360: header_id NUMBER,

Line 3371: FROM po_distributions pod,

3367: v_ship_to_location_id NUMBER,
3368: v_vendor_product_num VARCHAR2
3369: ) IS
3370: SELECT COUNT(*)
3371: FROM po_distributions pod,
3372: po_line_locations pll,
3373: po_lines pl,
3374: po_headers ph
3375: WHERE ph.po_header_id = header_id

Line 3593: FROM po_distributions

3589: AND temp_cascaded_table(current_n).po_distribution_id IS NOT NULL THEN --{
3590: BEGIN
3591: SELECT distribution_num
3592: INTO temp_cascaded_table(current_n).document_distribution_num
3593: FROM po_distributions
3594: WHERE po_distribution_id = temp_cascaded_table(current_n).po_distribution_id;
3595: EXCEPTION
3596: WHEN OTHERS THEN
3597: IF (g_asn_debug = 'Y') THEN

Line 3902: asn_debug.put_line('Count of PO distributions');

3898:
3899: FETCH count_asn_distributions INTO x_record_count;
3900: ELSE --}{
3901: IF (g_asn_debug = 'Y') THEN
3902: asn_debug.put_line('Count of PO distributions');
3903: END IF;
3904:
3905: FETCH count_distributions INTO x_record_count;
3906: END IF; --}

Line 4236: -- Bug 2551443 Removed po_distributions from the FROM clause

4232: no shipments exists for receiving for the given PO.
4233: */
4234: IF ( x_cascaded_table(n).transaction_type <> 'DELIVER'
4235: AND NVL(x_cascaded_table(n).auto_transact_code, 'RECEIVE') <> 'DELIVER') THEN --{
4236: -- Bug 2551443 Removed po_distributions from the FROM clause
4237: IF (g_asn_debug = 'Y') THEN
4238: asn_debug.put_line('This is receive');
4239: END IF;
4240:

Line 4318: FROM po_distributions pod,

4314:
4315: IF (x_is_asn = FALSE) THEN --{
4316: SELECT COUNT(*)
4317: INTO x_temp_count
4318: FROM po_distributions pod,
4319: po_line_locations pll,
4320: po_lines pl,
4321: po_headers ph
4322: WHERE ph.po_header_id = temp_cascaded_table(current_n).po_header_id

Line 4363: FROM po_distributions pod,

4359: x_shipment_type,
4360: x_ship_to_organization_id,
4361: x_ship_to_location_id,
4362: x_vendor_product_num
4363: FROM po_distributions pod,
4364: po_line_locations pll,
4365: po_lines pl,
4366: po_headers ph
4367: WHERE ph.po_header_id = temp_cascaded_table(current_n).po_header_id

Line 5536: FROM po_distributions

5532: BEGIN
5533:
5534: SELECT count(po_distribution_id),max(rate),max(rate_date)
5535: INTO l_dist_count,x_rate,l_rate_date
5536: FROM po_distributions
5537: WHERE line_location_id = x_ShipmentDistributionRec.line_location_id
5538: HAVING count(po_distribution_id) = 1;
5539:
5540: EXCEPTION

Line 5547: ':: Rate and Rate_date in po distributions' || x_rate ||

5543: END;
5544:
5545: IF (g_asn_debug = 'Y') THEN
5546: asn_debug.put_line('No of Distributions:' || l_dist_count ||
5547: ':: Rate and Rate_date in po distributions' || x_rate ||
5548: '::' || l_rate_date);
5549: END IF;
5550:
5551: IF (x_ShipmentDistributionRec.match_option = 'P') THEN --{

Line 5562: The Rate Date needs to be defaulted from Transaction Date for such cases, and NOT from PO_DISTRIBUTIONS.

5558: temp_cascaded_table(current_n).currency_conversion_rate := x_ShipmentDistributionRec.rate;
5559: END IF; --}
5560:
5561: /* Bug 13013727 Modified the following code to handle the cases where Match Option is 'Receipt'.
5562: The Rate Date needs to be defaulted from Transaction Date for such cases, and NOT from PO_DISTRIBUTIONS.
5563: Also, the corresponding Rate needs to be calculated in case of Rate Type <> 'User'. */
5564: ELSIF (x_ShipmentDistributionRec.match_option = 'R') THEN
5565:
5566: IF (x_ShipmentDistributionRec.rate_type = 'User') THEN --{

Line 5670: /* Bug 2392074 - If the deliver_to_person mentioned in the po_distributions is

5666: IF (NVL(temp_cascaded_table(current_n).deliver_to_location_id, 0) = 0) THEN
5667: temp_cascaded_table(current_n).deliver_to_location_id := x_shipmentdistributionrec.deliver_to_location_id;
5668: END IF;
5669:
5670: /* Bug 2392074 - If the deliver_to_person mentioned in the po_distributions is
5671: invalid or inactive at the time of Receipt we need to clear the deliver to person,
5672: as this is an optional field. */
5673: IF (NVL(temp_cascaded_table(current_n).deliver_to_person_id, 0) = 0) THEN --{
5674: temp_cascaded_table(current_n).deliver_to_person_id := x_shipmentdistributionrec.deliver_to_person_id;

Line 6001: FROM po_distributions pod,

5997: pod.ussgl_transaction_code,
5998: pll.ship_to_location_id,
5999: NVL(pll.enforce_ship_to_location_code, 'NONE') enforce_ship_to_location_code,
6000: pl.item_id
6001: FROM po_distributions pod,
6002: po_line_locations pll,
6003: po_lines pl,
6004: po_headers ph
6005: WHERE pl.po_line_id = v_po_line_id

Line 6028: FROM po_distributions pod,

6024: v_po_distribution_id NUMBER,
6025: v_po_release_id NUMBER
6026: ) IS
6027: SELECT COUNT(*)
6028: FROM po_distributions pod,
6029: po_line_locations pll,
6030: po_lines pl,
6031: po_headers ph
6032: WHERE pl.po_line_id = v_po_line_id

Line 6265: FROM po_distributions

6261: AND temp_cascaded_table(current_n).po_distribution_id IS NOT NULL THEN --{
6262: BEGIN
6263: SELECT distribution_num
6264: INTO temp_cascaded_table(current_n).document_distribution_num
6265: FROM po_distributions
6266: WHERE po_distribution_id = temp_cascaded_table(current_n).po_distribution_id;
6267: EXCEPTION
6268: WHEN OTHERS THEN
6269: IF (g_asn_debug = 'Y') THEN

Line 6617: -- Bug 2551443 Removed po_distributions from the FROM clause

6613: no shipments exists for receiving for the given PO.
6614: */
6615: IF ( x_cascaded_table(n).transaction_type <> 'DELIVER'
6616: AND NVL(x_cascaded_table(n).auto_transact_code, 'RECEIVE') <> 'DELIVER') THEN --{
6617: -- Bug 2551443 Removed po_distributions from the FROM clause
6618: SELECT COUNT(*)
6619: INTO x_temp_count
6620: FROM DUAL
6621: WHERE EXISTS(SELECT 1

Line 6660: FROM po_distributions pod,

6656: ELSIF( x_cascaded_table(n).transaction_type = 'DELIVER'
6657: OR NVL(x_cascaded_table(n).auto_transact_code, 'RECEIVE') = 'DELIVER') THEN --{
6658: SELECT COUNT(*)
6659: INTO x_temp_count
6660: FROM po_distributions pod,
6661: po_line_locations pll,
6662: po_lines pl,
6663: po_headers ph
6664: WHERE ph.po_header_id = temp_cascaded_table(current_n).po_header_id

Line 6689: FROM po_distributions pod,

6685: x_approved_flag,
6686: x_cancel_flag,
6687: x_closed_code,
6688: x_shipment_type
6689: FROM po_distributions pod,
6690: po_line_locations pll,
6691: po_lines pl,
6692: po_headers ph
6693: WHERE ph.po_header_id = temp_cascaded_table(current_n).po_header_id

Line 7160: The Rate Date needs to be defaulted from Transaction Date for such cases, and NOT from PO_DISTRIBUTIONS.

7156: temp_cascaded_table(current_n).currency_conversion_date := x_ShipmentDistributionRec.rate_date;
7157: temp_cascaded_table(current_n).currency_conversion_rate := x_ShipmentDistributionRec.rate;
7158:
7159: /* Bug 13013727 Modified the following code to handle the cases where Match Option is 'Receipt'.
7160: The Rate Date needs to be defaulted from Transaction Date for such cases, and NOT from PO_DISTRIBUTIONS.
7161: Also, the corresponding Rate needs to be calculated in case of Rate Type <> 'User'. */
7162: ELSIF (x_ShipmentDistributionRec.match_option = 'R') THEN
7163:
7164: IF (x_ShipmentDistributionRec.rate_type = 'User') THEN --{

Line 7253: /* Bug 2392074 - If the deliver_to_person mentioned in the po_distributions is

7249: IF (NVL(temp_cascaded_table(current_n).deliver_to_location_id, 0) = 0) THEN
7250: temp_cascaded_table(current_n).deliver_to_location_id := x_shipmentdistributionrec.deliver_to_location_id;
7251: END IF;
7252:
7253: /* Bug 2392074 - If the deliver_to_person mentioned in the po_distributions is
7254: invalid or inactive at the time of Receipt we need to clear the deliver to person,
7255: as this is an optional field. */
7256: IF (NVL(temp_cascaded_table(current_n).deliver_to_person_id, 0) = 0) THEN --{
7257: temp_cascaded_table(current_n).deliver_to_person_id := x_shipmentdistributionrec.deliver_to_person_id;

Line 10505: the join to po_distributions table. For transfers of

10501:
10502: /* Bug 3292329.
10503: We used to use the same cursor for single deliver and
10504: Transfers, inspections etc. Because of this we had the
10505: the join to po_distributions table. For transfers of
10506: a received shipment line against a PO shipment with multiple
10507: distribution, this results in multiple rows which is incorrect.
10508: So declared a new cursor for single deliver which is the same
10509: as that of tranfer cursor but with distribution info.

Line 10555: po_distributions pod

10551: rcv_transactions rt,
10552: rcv_shipment_lines rsl,
10553: po_headers poh,
10554: po_lines pol,
10555: po_distributions pod
10556: WHERE rt.transaction_id = v_parent_trx_id
10557: AND rsup.to_organization_id = NVL(v_to_organization_id, rsup.to_organization_id)
10558: AND rsup.supply_type_code = 'RECEIVING'
10559: AND poh.po_header_id = rsup.po_header_id

Line 10618: po_distributions pod

10614: pod.ussgl_transaction_code,
10615: rti.quantity qty,
10616: rti.interface_available_qty
10617: FROM rcv_transactions_interface rti,
10618: po_distributions pod
10619: WHERE interface_transaction_id = v_parent_inter_trx_id
10620: AND pod.line_location_id = rti.po_line_location_id --Bug:5354379
10621: AND pod.po_header_id = rti.po_header_id
10622: AND ( pod.po_line_id IS NOT NULL

Line 10670: po_distributions pod

10666: rcv_transactions rt,
10667: rcv_shipment_lines rsl,
10668: po_headers poh,
10669: po_lines pol,
10670: po_distributions pod
10671: WHERE rt.transaction_id = v_parent_trx_id
10672: AND rsup.to_organization_id = NVL(v_to_organization_id, rsup.to_organization_id)
10673: AND rsup.supply_type_code = 'RECEIVING'
10674: AND poh.po_header_id = rsup.po_header_id

Line 10726: po_distributions pod

10722: pod.ussgl_transaction_code,
10723: rti.quantity qty,
10724: rti.interface_available_qty
10725: FROM rcv_transactions_interface rti,
10726: po_distributions pod
10727: WHERE interface_transaction_id = v_parent_inter_trx_id
10728: AND pod.distribution_num = x_dist_num
10729: AND pod.po_header_id = rti.po_header_id
10730: AND pod.line_location_id = rti.po_line_location_id --Bug:5354379

Line 10778: po_distributions pod

10774: rcv_transactions rt,
10775: rcv_shipment_lines rsl,
10776: po_headers poh,
10777: po_lines pol,
10778: po_distributions pod
10779: WHERE rt.transaction_id = v_parent_trx_id
10780: AND rsup.to_organization_id = NVL(v_to_organization_id, rsup.to_organization_id)
10781: AND rsup.supply_type_code = 'RECEIVING'
10782: AND poh.po_header_id = rsup.po_header_id

Line 10927: FROM po_distributions pod,

10923: WHERE transaction_id = x_cascaded_table(n).parent_transaction_id;
10924:
10925: SELECT COUNT(*)
10926: INTO l_num_of_distributions
10927: FROM po_distributions pod,
10928: rcv_supply rs
10929: WHERE pod.line_location_id = rs.po_line_location_id
10930: AND rs.rcv_transaction_id = x_cascaded_table(n).parent_transaction_id;
10931:

Line 10968: FROM po_distributions

10964: END IF;
10965:
10966: SELECT distribution_num
10967: INTO x_cascaded_table(n).document_distribution_num
10968: FROM po_distributions
10969: WHERE po_distribution_id = x_cascaded_table(n).po_distribution_id;
10970:
10971: IF (g_asn_debug = 'Y') THEN
10972: asn_debug.put_line('Derived Distribution Number:' || x_cascaded_table(n).document_distribution_num);

Line 11046: FROM po_distributions

11042: * correct value.
11043: */
11044: SELECT COUNT(*)
11045: INTO l_num_of_distributions
11046: FROM po_distributions
11047: WHERE line_location_id = (SELECT po_line_location_id
11048: FROM rcv_transactions_interface
11049: WHERE interface_transaction_id = x_cascaded_table(n).parent_interface_txn_id);
11050:

Line 11067: distribution number from po_distributions_all table */

11063: AND (l_num_of_distributions > 1)) THEN --}{
11064:
11065: /* Bug 5354379: {
11066: If the po_distribution_id is populated in RTI, then derive the
11067: distribution number from po_distributions_all table */
11068:
11069: IF ( x_cascaded_table(n).po_distribution_id IS NOT NULL
11070: AND (x_cascaded_table(n).document_distribution_num IS NULL)) THEN
11071:

Line 11079: FROM po_distributions

11075: END IF;
11076:
11077: SELECT distribution_num
11078: INTO x_cascaded_table(n).document_distribution_num
11079: FROM po_distributions
11080: WHERE po_distribution_id = x_cascaded_table(n).po_distribution_id;
11081:
11082: IF (g_asn_debug = 'Y') THEN
11083: asn_debug.put_line('Derived Distribution Number:' || x_cascaded_table(n).document_distribution_num);

Line 11421: from po_distributions_all

11417: where line_location_id = x_po_transferrec.po_line_location_id;
11418:
11419: select distribution_num
11420: into l_po_dist_num
11421: from po_distributions_all
11422: where po_distribution_id = x_po_transferrec.po_distribution_id;
11423:
11424: if x_cascaded_table(n).po_release_id is not null then --5439085
11425: select release_num

Line 11746: * equal to the qty in po_distributions.

11742: * line and if its parent is in rti, then x_converted_parent_trx_qty
11743: * will not be 0 and l_num_of_distributions will be > 1. In this
11744: * case we need to make sure that the transaction qty is less than
11745: * or equal to the available qty in rti and also less than or
11746: * equal to the qty in po_distributions.
11747: */
11748: IF ( (temp_cascaded_table(1).transaction_type = 'DELIVER')
11749: AND (l_num_of_distributions > 1)) THEN --{
11750: IF (g_asn_debug = 'Y') THEN

Line 11764: We should not compare the transaction quantity with the po_distributions_all.ordered_quantity,

11760: --
11761:
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.

Line 12344: /* Convert ordered_qty in po_distributions to

12340: END IF;
12341: -- End Bug 7675516
12342: -- } bugfix 5354379
12343:
12344: /* Convert ordered_qty in po_distributions to
12345: * the parent's uom */
12346: l_converted_distribution_qty := convert_into_correct_qty(l_distribution_qty,
12347: l_ship_unit,
12348: temp_cascaded_table(current_n).item_id,

Line 12573: /* Bug 2392074 - If the deliver_to_person mentioned in the po_distributions is

12569: IF (g_asn_debug = 'Y') THEN
12570: asn_debug.put_line(' deliver_to_person_id ' || temp_cascaded_table(current_n).deliver_to_person_id);
12571: END IF;
12572:
12573: /* Bug 2392074 - If the deliver_to_person mentioned in the po_distributions is
12574: invalid or inactive at the time of Receipt we need to clear the deliver to person,
12575: as this is an optional field. */
12576: IF (NVL(temp_cascaded_table(current_n).deliver_to_person_id, 0) = 0) THEN --{
12577: temp_cascaded_table(current_n).deliver_to_person_id := x_po_transferrec.deliver_to_person_id;

Line 17047: from po_distributions_all

17043:
17044: BEGIN
17045: select deliver_to_person_id
17046: into l_deliver_to_person_id
17047: from po_distributions_all
17048: where po_distribution_id = x_cascaded_table(n).po_distribution_id;
17049:
17050: x_cascaded_table(n).deliver_to_person_id := l_deliver_to_person_id;
17051: IF (g_asn_debug = 'Y') THEN

Line 17068: from po_distributions_all

17064:
17065: BEGIN
17066: select count(po_distribution_id)
17067: into l_distribution_count
17068: from po_distributions_all
17069: where line_location_id = x_cascaded_table(n).po_line_location_id;
17070:
17071: IF (g_asn_debug = 'Y') THEN
17072: asn_debug.put_line('Inside poll not null..l_distribution_count:'||l_distribution_count);

Line 17078: from po_distributions_all

17074:
17075: IF l_distribution_count = 1 THEN
17076: select deliver_to_person_id
17077: into l_deliver_to_person_id
17078: from po_distributions_all
17079: where line_location_id = x_cascaded_table(n).po_line_location_id;
17080:
17081: x_cascaded_table(n).deliver_to_person_id := l_deliver_to_person_id;
17082: IF (g_asn_debug = 'Y') THEN