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.39 2008/05/05 11:03:15 kdevadas 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 1183: -- The column interlock_status in JMF_SUBCONTRACT_ORDERS will

1179: -- COMMENT : This procedure loads all the PO Shipment lines
1180: -- that are eligible for processing the SHIKYU business flow.
1181: -- It populates the JMF_SUBCONTRACT_
1182: -- ORDERS table with the Shipment lines of the OSA item .
1183: -- The column interlock_status in JMF_SUBCONTRACT_ORDERS will
1184: -- be updated as follows:
1185: -- 'N' - New , components are not yet loaded
1186: -- 'E' - Error when loading components, hence components are not loaded
1187: -- 'U' - Unprocessed (WIP job failure)

Line 1244: FROM JMF_SUBCONTRACT_ORDERS_TEMP;

1240: , osa_item_id
1241: , osa_item_price
1242: , project_id
1243: , task_id
1244: FROM JMF_SUBCONTRACT_ORDERS_TEMP;
1245:
1246: -- Bugs 5198838 and 5212219: Should get the project id for the distributions
1247: -- of the Subcontracting Order Shipment as long as it is NOT NULL.
1248: -- Should not restrict the task id to be NOT NULL as well.

Line 1272: INSERT INTO JMF_SUBCONTRACT_ORDERS_TEMP

1268:
1269: --Get all the Subcontract orders that were not processed by the
1270: --Interlock processor.
1271:
1272: INSERT INTO JMF_SUBCONTRACT_ORDERS_TEMP
1273: ( subcontract_po_shipment_id
1274: , subcontract_po_header_id
1275: , subcontract_po_line_id
1276: , oem_organization_id

Line 1334: FROM JMF_SUBCONTRACT_ORDERS jso

1330: (NVL(p_to_organization,poll.ship_to_organization_id)
1331: )
1332: AND NOT EXISTS
1333: ( SELECT subcontract_po_shipment_id
1334: FROM JMF_SUBCONTRACT_ORDERS jso
1335: WHERE poll.line_location_id = jso.subcontract_po_shipment_id
1336: );
1337:
1338: OPEN c_load_cur;

Line 1440: UPDATE jmf_subcontract_orders_temp

1436: THEN
1437: l_valid_flag := 'Y';
1438: l_curr_index := l_project_tbl.FIRST;
1439:
1440: UPDATE jmf_subcontract_orders_temp
1441: SET project_id = l_project_tbl(l_curr_index).project_id
1442: , task_id = l_project_tbl(l_curr_index).task_id
1443: WHERE subcontract_po_shipment_id = l_shipment_id;
1444: ELSE

Line 1459: DELETE FROM JMF_SUBCONTRACT_ORDERS_TEMP

1455: -- ORDERS table for processing.
1456:
1457: IF l_valid_flag = 'N'
1458: THEN
1459: DELETE FROM JMF_SUBCONTRACT_ORDERS_TEMP
1460: WHERE subcontract_po_shipment_id = l_subcontract_rec(i).subcontract_po_shipment_id;
1461:
1462: IF g_log_enabled THEN
1463: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN

Line 1469: || ' from JMF_SUBCONTRACT_ORDERS_TEMP'

1465: , G_PKG_NAME
1466: , '>> ' || l_program
1467: || ': l_valid_flag is ''N'': Deleting record with subcontract_po_shipment_id = '
1468: || l_subcontract_rec(i).subcontract_po_shipment_id
1469: || ' from JMF_SUBCONTRACT_ORDERS_TEMP'
1470: );
1471: END IF;
1472: END IF;
1473: ELSE

Line 1474: UPDATE JMF_SUBCONTRACT_ORDERS_TEMP

1470: );
1471: END IF;
1472: END IF;
1473: ELSE
1474: UPDATE JMF_SUBCONTRACT_ORDERS_TEMP
1475: SET tp_organization_id = l_subcontract_rec(i).tp_organization_id
1476: WHERE subcontract_po_shipment_id = l_subcontract_rec(i).subcontract_po_shipment_id;
1477:
1478: END IF;

Line 1487: MERGE INTO JMF_SUBCONTRACT_ORDERS jso

1483: -- pick up the shipment line that is not processed by the other process.
1484: -- The new shipment lines are marked as 'N' which indicates they need to be
1485: -- processed. 'N' is the first step in processing of the shipment lines.
1486:
1487: MERGE INTO JMF_SUBCONTRACT_ORDERS jso
1488: USING (SELECT subcontract_po_shipment_id
1489: , subcontract_po_header_id
1490: , subcontract_po_line_id
1491: , oem_organization_id

Line 1501: FROM JMF_SUBCONTRACT_ORDERS_TEMP ) jsot

1497: , currency
1498: , quantity
1499: , project_id
1500: , task_id
1501: FROM JMF_SUBCONTRACT_ORDERS_TEMP ) jsot
1502: ON ( jso.subcontract_po_shipment_id = jsot.subcontract_po_shipment_id)
1503: WHEN NOT MATCHED THEN
1504: INSERT
1505: ( jso.subcontract_po_shipment_id

Line 1555: UPDATE jmf_subcontract_orders

1551: -- To reprocess the existing records which are marked as error,
1552: -- update the interlock_status flag to 'N' so that they can be
1553: -- processed in this run.
1554:
1555: UPDATE jmf_subcontract_orders
1556: SET interlock_status ='N'
1557: , batch_id = -1
1558: , last_update_date = sysdate
1559: , last_updated_by = FND_GLOBAL.user_id

Line 1564: FROM jmf_subcontract_orders

1560: , last_update_login = FND_GLOBAL.login_id
1561: WHERE interlock_status = 'E'
1562: AND EXISTS
1563: ( SELECT 'X'
1564: FROM jmf_subcontract_orders
1565: WHERE interlock_status = 'E');
1566:
1567: IF g_log_enabled THEN
1568: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN

Line 1683: , jmf_subcontract_orders jso

1679: , sum(nvl(jsa.allocated_quantity,0))
1680: , max(nvl(wro.required_quantity,0))
1681: FROM jmf_shikyu_allocations jsa
1682: , jmf_shikyu_components jsc
1683: , jmf_subcontract_orders jso
1684: , wip_requirement_operations wro
1685: WHERE jso.subcontract_po_shipment_id = jsc.subcontract_po_shipment_id
1686: AND jsc.subcontract_po_shipment_id=jsa.subcontract_po_shipment_id(+)
1687: AND jsc.shikyu_component_id=jsa.shikyu_component_id(+)

Line 1710: , jmf_subcontract_orders jso

1706: , max(nvl(wro.required_quantity,0))
1707: , max(jsc.replen_so_creation_failed)
1708: FROM jmf_shikyu_allocations jsa
1709: , jmf_shikyu_components jsc
1710: , jmf_subcontract_orders jso
1711: , wip_requirement_operations wro
1712: , po_line_locations_all plla
1713: , po_lines_all pla
1714: , po_headers_all pha

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

2188: -- PROCEDURE : Load_Shikyu_Components PRIVATE
2189: -- PARAMETERS: p_operating_unit The OU to execute the loading of
2190: -- Subcontracting Order Components in
2191: -- COMMENT : This procedure loads all the components of the subcontracting order
2192: -- based on the OSA shipments that are loaded in JMF_SUBCONTRACT_ORDERS
2193: --========================================================================
2194: PROCEDURE Load_Shikyu_Components
2195: ( p_operating_unit IN NUMBER
2196: )

Line 2276: jmf_subcontract_orders jso

2272: , jso.project_id
2273: , jso.task_id
2274: , 'V'
2275: FROM
2276: jmf_subcontract_orders jso
2277: , po_line_locations_all poll
2278: , po_lines_all pla
2279: WHERE poll.line_location_id = jso.subcontract_po_shipment_id
2280: AND pla.po_line_id = poll.po_line_id

Line 2501: UPDATE JMF_SUBCONTRACT_ORDERS

2497: -- Skip and move on to the next shipment line. In the next run,
2498: -- the shipment line that is marked as error, will be processed
2499: -- starting from loading the components.
2500:
2501: UPDATE JMF_SUBCONTRACT_ORDERS
2502: SET interlock_status = 'E'
2503: , last_update_date = sysdate
2504: , last_updated_by = FND_GLOBAL.user_id
2505: , last_update_login = FND_GLOBAL.login_id

Line 2804: UPDATE JMF_SUBCONTRACT_ORDERS

2800:
2801: -- Update the interlock_status of the current Subcontracting Order to 'E',
2802: -- signifying that some errors occurred when loading the components
2803: -- (specifically, shikyu_component_price could not be obtained)
2804: UPDATE JMF_SUBCONTRACT_ORDERS
2805: SET interlock_status = 'E'
2806: , last_update_date = sysdate
2807: , last_updated_by = FND_GLOBAL.user_id
2808: , last_update_login = FND_GLOBAL.login_id

Line 2820: UPDATE JMF_SUBCONTRACT_ORDERS

2816:
2817: -- Error in validating attributes. Mark the shipment line status as Invalid.
2818: -- Skip and move on to the next shipment line.
2819:
2820: UPDATE JMF_SUBCONTRACT_ORDERS
2821: SET interlock_status = 'E'
2822: , last_update_date = sysdate
2823: , last_updated_by = FND_GLOBAL.user_id
2824: , last_update_login = FND_GLOBAL.login_id

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

2875:
2876: FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
2877: , G_PKG_NAME
2878: , '>> ' || l_program
2879: || ': Marking the JMF_SUBCONTRACT_ORDERS record with interlock_status ''E''');
2880: END IF;
2881:
2882: -- Routings defined for the OSA Item in the TP Organization. Mark the interlock_status
2883: -- of the Subcontract Shipment Line status as 'E' (Error).

Line 2886: UPDATE JMF_SUBCONTRACT_ORDERS

2882: -- Routings defined for the OSA Item in the TP Organization. Mark the interlock_status
2883: -- of the Subcontract Shipment Line status as 'E' (Error).
2884: -- Skip and move on to the next Subcontract Shipment Line.
2885:
2886: UPDATE JMF_SUBCONTRACT_ORDERS
2887: SET interlock_status = 'E'
2888: , last_update_date = sysdate
2889: , last_updated_by = FND_GLOBAL.user_id
2890: , last_update_login = FND_GLOBAL.login_id

Line 2940: JMF_SUBCONTRACT_ORDERS.oem_organization_id%TYPE;

2936: -- LOCAL VARIABLES
2937: --=================
2938:
2939: l_oem_organization_id
2940: JMF_SUBCONTRACT_ORDERS.oem_organization_id%TYPE;
2941: l_tp_organization_id
2942: JMF_SUBCONTRACT_ORDERS.tp_organization_id%TYPE;
2943: l_subcontract_po_shipment_id
2944: JMF_SHIKYU_COMPONENTS.subcontract_po_shipment_id%TYPE;

Line 2942: JMF_SUBCONTRACT_ORDERS.tp_organization_id%TYPE;

2938:
2939: l_oem_organization_id
2940: JMF_SUBCONTRACT_ORDERS.oem_organization_id%TYPE;
2941: l_tp_organization_id
2942: JMF_SUBCONTRACT_ORDERS.tp_organization_id%TYPE;
2943: l_subcontract_po_shipment_id
2944: JMF_SHIKYU_COMPONENTS.subcontract_po_shipment_id%TYPE;
2945: l_shikyu_component_id
2946: JMF_SHIKYU_COMPONENTS.shikyu_component_id%TYPE;

Line 2967: jmf_subcontract_orders jso,

2963: , jsc.quantity
2964: , jso.oem_organization_id
2965: , jso.tp_organization_id
2966: FROM
2967: jmf_subcontract_orders jso,
2968: jmf_shikyu_components jsc,
2969: po_line_locations_all plla
2970: WHERE jso.subcontract_po_shipment_id = jsc.subcontract_po_shipment_id
2971: AND shikyu_component_price IS NULL

Line 3082: -- the records in JMF_SUBCONTRACT_ORDERS

3078: -- FUNCTION : Generate_Batch_Id PRIVATE
3079: -- PARAMETERS: None
3080: -- RETURNS : NUMBER
3081: -- COMMENT : This function returns the next batch id to be assigned to
3082: -- the records in JMF_SUBCONTRACT_ORDERS
3083: --=========================================================================
3084: FUNCTION generate_batch_id
3085: RETURN NUMBER
3086: IS

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

3118: --========================================================================
3119: -- PROCEDURE : Process_Subcontract_Orders PRIVATE
3120: -- PARAMETERS: p_batch_id Batch ID
3121: -- COMMENT : This procedure is called by the worker to process all the
3122: -- records in the batch that is loaded in JMF_SUBCONTRACT_ORDERS
3123: -- table.
3124: --========================================================================
3125: PROCEDURE Process_Subcontract_Orders
3126: ( p_batch_id IN NUMBER

Line 3149: FROM jmf_subcontract_orders

3145: l_status_flag BOOLEAN;
3146:
3147: CURSOR c_osa_rec IS
3148: SELECT *
3149: FROM jmf_subcontract_orders
3150: WHERE batch_id = p_batch_id
3151: AND interlock_status in ('N','U');
3152:
3153: CURSOR c_comp_rec IS

Line 3249: FROM JMF_SUBCONTRACT_ORDERS

3245: -- If WIP job is created, update with the WIP job id
3246:
3247: SELECT wip_entity_id
3248: INTO l_wip_entity_id
3249: FROM JMF_SUBCONTRACT_ORDERS
3250: WHERE subcontract_po_shipment_id = l_osa_tbl(i).subcontract_po_shipment_id;
3251: -- Based on the above action, update JSO with interlock_status
3252: UPDATE jmf_subcontract_orders
3253: SET interlock_status ='P'

Line 3252: UPDATE jmf_subcontract_orders

3248: INTO l_wip_entity_id
3249: FROM JMF_SUBCONTRACT_ORDERS
3250: WHERE subcontract_po_shipment_id = l_osa_tbl(i).subcontract_po_shipment_id;
3251: -- Based on the above action, update JSO with interlock_status
3252: UPDATE jmf_subcontract_orders
3253: SET interlock_status ='P'
3254: , last_update_date = sysdate
3255: , last_updated_by = FND_GLOBAL.user_id
3256: , last_update_login = FND_GLOBAL.login_id

Line 3295: UPDATE jmf_subcontract_orders

3291: );
3292: END LOOP;
3293:
3294: ELSE
3295: UPDATE jmf_subcontract_orders
3296: SET interlock_status ='U'
3297: , batch_id = -1
3298: , last_update_date = sysdate
3299: , last_updated_by = FND_GLOBAL.user_id

Line 3403: FROM jmf_subcontract_orders jso

3399:
3400: /*
3401: CURSOR c_proc_batch IS
3402: SELECT jso.subcontract_po_shipment_id
3403: FROM jmf_subcontract_orders jso
3404: WHERE jso.interlock_status IN ('N', 'U');
3405: */
3406:
3407: CURSOR c_proc_batch IS

Line 3409: FROM jmf_subcontract_orders jso

3405: */
3406:
3407: CURSOR c_proc_batch IS
3408: SELECT jso.subcontract_po_shipment_id
3409: FROM jmf_subcontract_orders jso
3410: , po_line_locations_all plla
3411: , po_lines_all pla
3412: , po_headers_all pha
3413: WHERE jso.interlock_status IN ('N', 'U')

Line 3499: UPDATE jmf_subcontract_orders

3495: END IF;
3496: END IF;
3497:
3498: FORALL i IN l_curr_index .. l_batch_size
3499: UPDATE jmf_subcontract_orders
3500: SET batch_id = l_batch_id
3501: , last_update_date = sysdate
3502: , last_updated_by = FND_GLOBAL.user_id
3503: , last_update_login = FND_GLOBAL.login_id

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

3507: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
3508: FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
3509: , G_PKG_NAME
3510: , '>> ' || l_program
3511: || ': After updating JMF_SUBCONTRACT_ORDERS with batch ID '
3512: || l_batch_id
3513: );
3514: END IF;
3515: END IF;

Line 3767: JMF_SUBCONTRACT_ORDERS_PVT.Process_Subcontract_Orders(p_batch_id);

3763: , '>> ' || l_program || ': Start'
3764: );
3765: END IF;
3766:
3767: JMF_SUBCONTRACT_ORDERS_PVT.Process_Subcontract_Orders(p_batch_id);
3768:
3769: IF g_log_enabled THEN
3770: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
3771: FND_LOG.string(FND_LOG.LEVEL_PROCEDURE

Line 3795: END JMF_SUBCONTRACT_ORDERS_PVT;

3791: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3792:
3793: END Subcontract_Orders_Worker;
3794:
3795: END JMF_SUBCONTRACT_ORDERS_PVT;