DBA Data[Home] [Help]

APPS.JMF_SUBCONTRACT_ORDERS_PVT dependencies on JMF_SUBCONTRACT_ORDERS

Line 1: PACKAGE BODY JMF_SUBCONTRACT_ORDERS_PVT AS

1: PACKAGE BODY JMF_SUBCONTRACT_ORDERS_PVT AS
2: -- $Header: JMFVSHKB.pls 120.45.12020000.2 2012/07/04 07:23:52 ntungare ship $ --
3: --+=======================================================================+
4: --| Copyright (c) 2005 Oracle Corporation |
5: --| Redwood Shores, CA, USA |

Line 141: --| JMF_SUBCONTRACT_ORDERS_TEMP statement |

137: --| belong to that range would not be |
138: --| picked up and redundant Replenishment |
139: --| POs won't be created. |
140: --| 05/09/2006 vchu Modified the INSERT INTO |
141: --| JMF_SUBCONTRACT_ORDERS_TEMP statement |
142: --| to populate the need_by_date as the |
143: --| promised_date from po_line_locations_all|
144: --| table, if need_by_date was null. |
145: --| 05/12/2006 vchu Bug fix for 5212199: Added where clause |

Line 167: --| JMF_SUBCONTRACT_ORDERS_TEMP temp table |

163: --| 06/13/2006 vchu Fixed bug 5153959: |
164: --| Modified the join statement with |
165: --| mtl_units_of_measure of the select |
166: --| statement for inserting into the |
167: --| JMF_SUBCONTRACT_ORDERS_TEMP temp table |
168: --| (in Load_Subcontract_Orders) to take |
169: --| the unit_meas_lookup_code from the PO |
170: --| Line if that of the PO Line Location |
171: --| was NULL. |

Line 174: --| into the JMF_SUBCONTRACT_ORDERS_TEMP |

170: --| Line if that of the PO Line Location |
171: --| was NULL. |
172: --| 06/14/2006 vchu Added a join to po_releases_all table |
173: --| in the select statement for inserting |
174: --| into the JMF_SUBCONTRACT_ORDERS_TEMP |
175: --| temp table, in order to make sure the |
176: --| Blanket Releases are approved, if the |
177: --| shipments are against Blanket Releases. |
178: --| 06/16/2006 rajkrish Fixed the worker batch issue |

Line 265: G_PKG_NAME CONSTANT VARCHAR2(30) := 'JMF_SUBCONTRACT_ORDERS_PVT';

261: --=============================================
262: -- GLOBALS
263: --=============================================
264:
265: G_PKG_NAME CONSTANT VARCHAR2(30) := 'JMF_SUBCONTRACT_ORDERS_PVT';
266: g_log_enabled BOOLEAN;
267:
268: TYPE g_SubcontractTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS_TEMP%ROWTYPE;
269: TYPE g_OsaTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS%ROWTYPE;

Line 268: TYPE g_SubcontractTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS_TEMP%ROWTYPE;

264:
265: G_PKG_NAME CONSTANT VARCHAR2(30) := 'JMF_SUBCONTRACT_ORDERS_PVT';
266: g_log_enabled BOOLEAN;
267:
268: TYPE g_SubcontractTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS_TEMP%ROWTYPE;
269: TYPE g_OsaTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS%ROWTYPE;
270: TYPE g_Comp_TabTyp IS TABLE OF JMF_SHIKYU_COMPONENTS%ROWTYPE;
271: TYPE g_oem_tp_rec IS RECORD
272: ( oem_organization_id NUMBER

Line 269: TYPE g_OsaTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS%ROWTYPE;

265: G_PKG_NAME CONSTANT VARCHAR2(30) := 'JMF_SUBCONTRACT_ORDERS_PVT';
266: g_log_enabled BOOLEAN;
267:
268: TYPE g_SubcontractTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS_TEMP%ROWTYPE;
269: TYPE g_OsaTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS%ROWTYPE;
270: TYPE g_Comp_TabTyp IS TABLE OF JMF_SHIKYU_COMPONENTS%ROWTYPE;
271: TYPE g_oem_tp_rec IS RECORD
272: ( oem_organization_id NUMBER
273: , tp_organization_id NUMBER

Line 1232: -- The column interlock_status in JMF_SUBCONTRACT_ORDERS will

1228: -- COMMENT : This procedure loads all the PO Shipment lines
1229: -- that are eligible for processing the SHIKYU business flow.
1230: -- It populates the JMF_SUBCONTRACT_
1231: -- ORDERS table with the Shipment lines of the OSA item .
1232: -- The column interlock_status in JMF_SUBCONTRACT_ORDERS will
1233: -- be updated as follows:
1234: -- 'N' - New , components are not yet loaded
1235: -- 'E' - Error when loading components, hence components are not loaded
1236: -- 'U' - Unprocessed (WIP job failure)

Line 1297: FROM JMF_SUBCONTRACT_ORDERS_TEMP;

1293: , osa_item_id
1294: , osa_item_price
1295: , project_id
1296: , task_id
1297: FROM JMF_SUBCONTRACT_ORDERS_TEMP;
1298:
1299: -- Bugs 5198838 and 5212219: Should get the project id for the distributions
1300: -- of the Subcontracting Order Shipment as long as it is NOT NULL.
1301: -- Should not restrict the task id to be NOT NULL as well.

Line 1325: INSERT INTO JMF_SUBCONTRACT_ORDERS_TEMP

1321:
1322: --Get all the Subcontract orders that were not processed by the
1323: --Interlock processor.
1324:
1325: INSERT INTO JMF_SUBCONTRACT_ORDERS_TEMP
1326: ( subcontract_po_shipment_id
1327: , subcontract_po_header_id
1328: , subcontract_po_line_id
1329: , oem_organization_id

Line 1387: FROM JMF_SUBCONTRACT_ORDERS jso

1383: (NVL(p_to_organization,poll.ship_to_organization_id)
1384: )
1385: AND NOT EXISTS
1386: ( SELECT subcontract_po_shipment_id
1387: FROM JMF_SUBCONTRACT_ORDERS jso
1388: WHERE poll.line_location_id = jso.subcontract_po_shipment_id
1389: )
1390: --Begin ER#9775673
1391: AND poh.segment1

Line 1584: UPDATE jmf_subcontract_orders_temp

1580: THEN
1581: l_valid_flag := 'Y';
1582: l_curr_index := l_project_tbl.FIRST;
1583:
1584: UPDATE jmf_subcontract_orders_temp
1585: SET project_id = l_project_tbl(l_curr_index).project_id
1586: , task_id = l_project_tbl(l_curr_index).task_id
1587: WHERE subcontract_po_shipment_id = l_shipment_id;
1588: ELSE

Line 1603: DELETE FROM JMF_SUBCONTRACT_ORDERS_TEMP

1599: -- ORDERS table for processing.
1600:
1601: IF l_valid_flag = 'N'
1602: THEN
1603: DELETE FROM JMF_SUBCONTRACT_ORDERS_TEMP
1604: WHERE subcontract_po_shipment_id = l_subcontract_rec(i).subcontract_po_shipment_id;
1605:
1606: IF g_log_enabled THEN
1607: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN

Line 1613: || ' from JMF_SUBCONTRACT_ORDERS_TEMP'

1609: , G_PKG_NAME
1610: , '>> ' || l_program
1611: || ': l_valid_flag is ''N'': Deleting record with subcontract_po_shipment_id = '
1612: || l_subcontract_rec(i).subcontract_po_shipment_id
1613: || ' from JMF_SUBCONTRACT_ORDERS_TEMP'
1614: );
1615: END IF;
1616: END IF;
1617: ELSE

Line 1618: UPDATE JMF_SUBCONTRACT_ORDERS_TEMP

1614: );
1615: END IF;
1616: END IF;
1617: ELSE
1618: UPDATE JMF_SUBCONTRACT_ORDERS_TEMP
1619: SET tp_organization_id = l_subcontract_rec(i).tp_organization_id
1620: WHERE subcontract_po_shipment_id = l_subcontract_rec(i).subcontract_po_shipment_id;
1621:
1622: --Debug changes for bug 9315131

Line 1656: MERGE INTO JMF_SUBCONTRACT_ORDERS jso

1652: );
1653: END IF;
1654: END IF;
1655:
1656: MERGE INTO JMF_SUBCONTRACT_ORDERS jso
1657: USING (SELECT subcontract_po_shipment_id
1658: , subcontract_po_header_id
1659: , subcontract_po_line_id
1660: , oem_organization_id

Line 1670: FROM JMF_SUBCONTRACT_ORDERS_TEMP ) jsot

1666: , currency
1667: , quantity
1668: , project_id
1669: , task_id
1670: FROM JMF_SUBCONTRACT_ORDERS_TEMP ) jsot
1671: ON ( jso.subcontract_po_shipment_id = jsot.subcontract_po_shipment_id)
1672: WHEN NOT MATCHED THEN
1673: INSERT
1674: ( jso.subcontract_po_shipment_id

Line 1724: UPDATE jmf_subcontract_orders

1720: -- To reprocess the existing records which are marked as error,
1721: -- update the interlock_status flag to 'N' so that they can be
1722: -- processed in this run.
1723:
1724: UPDATE jmf_subcontract_orders
1725: SET interlock_status ='N'
1726: , batch_id = -1
1727: , last_update_date = sysdate
1728: , last_updated_by = FND_GLOBAL.user_id

Line 1733: FROM jmf_subcontract_orders

1729: , last_update_login = FND_GLOBAL.login_id
1730: WHERE interlock_status = 'E'
1731: AND EXISTS
1732: ( SELECT 'X'
1733: FROM jmf_subcontract_orders
1734: WHERE interlock_status = 'E');
1735:
1736: IF g_log_enabled THEN
1737: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN

Line 1854: , jmf_subcontract_orders jso

1850: , sum(nvl(jsa.allocated_quantity,0))
1851: , max(nvl(wro.required_quantity,0))
1852: FROM jmf_shikyu_allocations jsa
1853: , jmf_shikyu_components jsc
1854: , jmf_subcontract_orders jso
1855: , wip_requirement_operations wro
1856: WHERE jso.subcontract_po_shipment_id = jsc.subcontract_po_shipment_id
1857: AND jsc.subcontract_po_shipment_id=jsa.subcontract_po_shipment_id(+)
1858: AND jsc.shikyu_component_id=jsa.shikyu_component_id(+)

Line 1883: , jmf_subcontract_orders jso

1879: , max(nvl(wro.required_quantity,0))
1880: , max(jsc.replen_so_creation_failed)
1881: FROM jmf_shikyu_allocations jsa
1882: , jmf_shikyu_components jsc
1883: , jmf_subcontract_orders jso
1884: , wip_requirement_operations wro
1885: , po_line_locations_all plla
1886: , po_lines_all pla
1887: , po_headers_all pha

Line 2431: -- based on the OSA shipments that are loaded in JMF_SUBCONTRACT_ORDERS

2427: -- PROCEDURE : Load_Shikyu_Components PRIVATE
2428: -- PARAMETERS: p_operating_unit The OU to execute the loading of
2429: -- Subcontracting Order Components in
2430: -- COMMENT : This procedure loads all the components of the subcontracting order
2431: -- based on the OSA shipments that are loaded in JMF_SUBCONTRACT_ORDERS
2432: --========================================================================
2433: PROCEDURE Load_Shikyu_Components
2434: ( p_operating_unit IN NUMBER
2435: )

Line 2515: jmf_subcontract_orders jso

2511: , jso.project_id
2512: , jso.task_id
2513: , 'V'
2514: FROM
2515: jmf_subcontract_orders jso
2516: , po_line_locations_all poll
2517: , po_lines_all pla
2518: WHERE poll.line_location_id = jso.subcontract_po_shipment_id
2519: AND pla.po_line_id = poll.po_line_id

Line 2766: UPDATE JMF_SUBCONTRACT_ORDERS

2762: );
2763: END IF;
2764: END IF;
2765:
2766: UPDATE JMF_SUBCONTRACT_ORDERS
2767: SET interlock_status = 'E'
2768: , last_update_date = sysdate
2769: , last_updated_by = FND_GLOBAL.user_id
2770: , last_update_login = FND_GLOBAL.login_id

Line 3076: UPDATE JMF_SUBCONTRACT_ORDERS

3072:
3073: -- Update the interlock_status of the current Subcontracting Order to 'E',
3074: -- signifying that some errors occurred when loading the components
3075: -- (specifically, shikyu_component_price could not be obtained)
3076: UPDATE JMF_SUBCONTRACT_ORDERS
3077: SET interlock_status = 'E'
3078: , last_update_date = sysdate
3079: , last_updated_by = FND_GLOBAL.user_id
3080: , last_update_login = FND_GLOBAL.login_id

Line 3092: UPDATE JMF_SUBCONTRACT_ORDERS

3088:
3089: -- Error in validating attributes. Mark the shipment line status as Invalid.
3090: -- Skip and move on to the next shipment line.
3091:
3092: UPDATE JMF_SUBCONTRACT_ORDERS
3093: SET interlock_status = 'E'
3094: , last_update_date = sysdate
3095: , last_updated_by = FND_GLOBAL.user_id
3096: , last_update_login = FND_GLOBAL.login_id

Line 3151: || ': Marking the JMF_SUBCONTRACT_ORDERS record with interlock_status ''E''');

3147:
3148: FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
3149: , G_PKG_NAME
3150: , '>> ' || l_program
3151: || ': Marking the JMF_SUBCONTRACT_ORDERS record with interlock_status ''E''');
3152: END IF;
3153:
3154: -- Routings defined for the OSA Item in the TP Organization. Mark the interlock_status
3155: -- of the Subcontract Shipment Line status as 'E' (Error).

Line 3158: UPDATE JMF_SUBCONTRACT_ORDERS

3154: -- Routings defined for the OSA Item in the TP Organization. Mark the interlock_status
3155: -- of the Subcontract Shipment Line status as 'E' (Error).
3156: -- Skip and move on to the next Subcontract Shipment Line.
3157:
3158: UPDATE JMF_SUBCONTRACT_ORDERS
3159: SET interlock_status = 'E'
3160: , last_update_date = sysdate
3161: , last_updated_by = FND_GLOBAL.user_id
3162: , last_update_login = FND_GLOBAL.login_id

Line 3212: JMF_SUBCONTRACT_ORDERS.oem_organization_id%TYPE;

3208: -- LOCAL VARIABLES
3209: --=================
3210:
3211: l_oem_organization_id
3212: JMF_SUBCONTRACT_ORDERS.oem_organization_id%TYPE;
3213: l_tp_organization_id
3214: JMF_SUBCONTRACT_ORDERS.tp_organization_id%TYPE;
3215: l_subcontract_po_shipment_id
3216: JMF_SHIKYU_COMPONENTS.subcontract_po_shipment_id%TYPE;

Line 3214: JMF_SUBCONTRACT_ORDERS.tp_organization_id%TYPE;

3210:
3211: l_oem_organization_id
3212: JMF_SUBCONTRACT_ORDERS.oem_organization_id%TYPE;
3213: l_tp_organization_id
3214: JMF_SUBCONTRACT_ORDERS.tp_organization_id%TYPE;
3215: l_subcontract_po_shipment_id
3216: JMF_SHIKYU_COMPONENTS.subcontract_po_shipment_id%TYPE;
3217: l_shikyu_component_id
3218: JMF_SHIKYU_COMPONENTS.shikyu_component_id%TYPE;

Line 3239: jmf_subcontract_orders jso,

3235: , jsc.quantity
3236: , jso.oem_organization_id
3237: , jso.tp_organization_id
3238: FROM
3239: jmf_subcontract_orders jso,
3240: jmf_shikyu_components jsc,
3241: po_line_locations_all plla
3242: WHERE jso.subcontract_po_shipment_id = jsc.subcontract_po_shipment_id
3243: AND shikyu_component_price IS NULL

Line 3359: -- the records in JMF_SUBCONTRACT_ORDERS

3355: -- FUNCTION : Generate_Batch_Id PRIVATE
3356: -- PARAMETERS: None
3357: -- RETURNS : NUMBER
3358: -- COMMENT : This function returns the next batch id to be assigned to
3359: -- the records in JMF_SUBCONTRACT_ORDERS
3360: --=========================================================================
3361: FUNCTION generate_batch_id
3362: RETURN NUMBER
3363: IS

Line 3399: -- records in the batch that is loaded in JMF_SUBCONTRACT_ORDERS

3395: --========================================================================
3396: -- PROCEDURE : Process_Subcontract_Orders PRIVATE
3397: -- PARAMETERS: p_batch_id Batch ID
3398: -- COMMENT : This procedure is called by the worker to process all the
3399: -- records in the batch that is loaded in JMF_SUBCONTRACT_ORDERS
3400: -- table.
3401: --========================================================================
3402: PROCEDURE Process_Subcontract_Orders
3403: ( p_batch_id IN NUMBER

Line 3426: FROM jmf_subcontract_orders

3422: l_status_flag BOOLEAN;
3423:
3424: CURSOR c_osa_rec IS
3425: SELECT *
3426: FROM jmf_subcontract_orders
3427: WHERE batch_id = p_batch_id
3428: AND interlock_status in ('N','U');
3429:
3430: CURSOR c_comp_rec IS

Line 3526: FROM JMF_SUBCONTRACT_ORDERS

3522: -- If WIP job is created, update with the WIP job id
3523:
3524: SELECT wip_entity_id
3525: INTO l_wip_entity_id
3526: FROM JMF_SUBCONTRACT_ORDERS
3527: WHERE subcontract_po_shipment_id = l_osa_tbl(i).subcontract_po_shipment_id;
3528: -- Based on the above action, update JSO with interlock_status
3529: UPDATE jmf_subcontract_orders
3530: SET interlock_status ='P'

Line 3529: UPDATE jmf_subcontract_orders

3525: INTO l_wip_entity_id
3526: FROM JMF_SUBCONTRACT_ORDERS
3527: WHERE subcontract_po_shipment_id = l_osa_tbl(i).subcontract_po_shipment_id;
3528: -- Based on the above action, update JSO with interlock_status
3529: UPDATE jmf_subcontract_orders
3530: SET interlock_status ='P'
3531: , last_update_date = sysdate
3532: , last_updated_by = FND_GLOBAL.user_id
3533: , last_update_login = FND_GLOBAL.login_id

Line 3592: UPDATE jmf_subcontract_orders

3588: );
3589: END LOOP;
3590:
3591: ELSE
3592: UPDATE jmf_subcontract_orders
3593: SET interlock_status ='U'
3594: , batch_id = -1
3595: , last_update_date = sysdate
3596: , last_updated_by = FND_GLOBAL.user_id

Line 3702: FROM jmf_subcontract_orders jso

3698:
3699: /*
3700: CURSOR c_proc_batch IS
3701: SELECT jso.subcontract_po_shipment_id
3702: FROM jmf_subcontract_orders jso
3703: WHERE jso.interlock_status IN ('N', 'U');
3704: */
3705:
3706: CURSOR c_proc_batch IS

Line 3708: FROM jmf_subcontract_orders jso

3704: */
3705:
3706: CURSOR c_proc_batch IS
3707: SELECT jso.subcontract_po_shipment_id
3708: FROM jmf_subcontract_orders jso
3709: , po_line_locations_all plla
3710: , po_lines_all pla
3711: , po_headers_all pha
3712: WHERE jso.interlock_status IN ('N', 'U')

Line 3802: UPDATE jmf_subcontract_orders

3798: END IF;
3799: END IF;
3800:
3801: FORALL i IN l_curr_index .. l_batch_size
3802: UPDATE jmf_subcontract_orders
3803: SET batch_id = l_batch_id
3804: , last_update_date = sysdate
3805: , last_updated_by = FND_GLOBAL.user_id
3806: , last_update_login = FND_GLOBAL.login_id

Line 3814: || ': After updating JMF_SUBCONTRACT_ORDERS with batch ID '

3810: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
3811: FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
3812: , G_PKG_NAME
3813: , '>> ' || l_program
3814: || ': After updating JMF_SUBCONTRACT_ORDERS with batch ID '
3815: || l_batch_id
3816: );
3817: END IF;
3818: END IF;

Line 4114: JMF_SUBCONTRACT_ORDERS_PVT.Process_Subcontract_Orders(p_batch_id);

4110: , '>> ' || l_program || ': Start'
4111: );
4112: END IF;
4113:
4114: JMF_SUBCONTRACT_ORDERS_PVT.Process_Subcontract_Orders(p_batch_id);
4115:
4116: IF g_log_enabled THEN
4117: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
4118: FND_LOG.string(FND_LOG.LEVEL_PROCEDURE

Line 4142: END JMF_SUBCONTRACT_ORDERS_PVT;

4138: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4139:
4140: END Subcontract_Orders_Worker;
4141:
4142: END JMF_SUBCONTRACT_ORDERS_PVT;