DBA Data[Home] [Help]

APPS.PO_MOD_SYNC_PROCESS_PVT dependencies on PO_DRAFTS

Line 1004: FROM po_drafts

1000:
1001: --chk if uda enabled
1002: SELECT document_id
1003: INTO l_po_header_id
1004: FROM po_drafts
1005: WHERE draft_id = p_draft_id;
1006:
1007: SELECT TYPE_LOOKUP_CODE, STYLE_ID
1008: INTO l_document_type_code, l_document_style_id

Line 1077: -- Update the revision_num on po_drafts table.

1073: IF (PO_LOG.d_stmt) THEN
1074: PO_LOG.stmt(d_module,d_position ,'sync_distributions successful');
1075: END IF;
1076:
1077: -- Update the revision_num on po_drafts table.
1078: -- This can be updated to -1 from update without Mod flow.
1079: UPDATE po_drafts
1080: SET revision_num = NULL
1081: WHERE draft_id = p_draft_id

Line 1079: UPDATE po_drafts

1075: END IF;
1076:
1077: -- Update the revision_num on po_drafts table.
1078: -- This can be updated to -1 from update without Mod flow.
1079: UPDATE po_drafts
1080: SET revision_num = NULL
1081: WHERE draft_id = p_draft_id
1082: AND revision_num = -1;
1083:

Line 1168: FROM po_drafts

1164:
1165:
1166: SELECT document_id
1167: INTO l_po_header_id
1168: FROM po_drafts
1169: WHERE draft_id = p_draft_id;
1170:
1171: d_position := 10;
1172: IF (PO_LOG.d_stmt) THEN

Line 1207: FROM po_drafts

1203:
1204: /* fetch the rev_num */
1205: SELECT revision_num
1206: INTO l_draft_rev_num
1207: FROM po_drafts
1208: WHERE draft_id = p_draft_id;
1209:
1210: /*fetch the lock_type */
1211: BEGIN

Line 1216: AND entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY

1212: SELECT lock_type
1213: INTO l_lock_type
1214: FROM po_entity_locks
1215: WHERE lock_by_draft_id = p_draft_id
1216: AND entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY
1217: AND entity_pk1 = l_po_header_id;
1218: EXCEPTION
1219: WHEN NO_DATA_FOUND THEN
1220: l_lock_type := NULL;

Line 1643: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY

1639: AND NVL(pla.revision_num, 0) > NVL(plda.revision_num, 0)
1640: AND NOT EXISTS (SELECT 'F locks'
1641: FROM po_entity_locks pel
1642: WHERE pel.entity_pk1 = plda.po_line_id
1643: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY
1644: AND pel.lock_by_draft_id = plda.draft_id
1645: AND pel.lock_type = 'F');
1646:
1647: d_position := 20;

Line 1674: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY

1670: AND NVL(pla.revision_num, 0) > NVL(plda.revision_num, 0)
1671: AND NOT EXISTS (SELECT 'F/P locks'
1672: FROM po_entity_locks pel
1673: WHERE pel.entity_pk1 = plda.po_line_id
1674: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY
1675: AND pel.lock_by_draft_id = plda.draft_id
1676: AND pel.lock_type IN ('F', 'P'));
1677: d_position := 40;
1678: IF (PO_LOG.d_stmt) THEN

Line 1696: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY

1692: AND NVL(pla.revision_num, 0) > NVL(plda.revision_num, 0)
1693: AND NOT EXISTS (SELECT 'F locks'
1694: FROM po_entity_locks pel
1695: WHERE pel.entity_pk1 = plda.po_line_id
1696: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY
1697: AND pel.lock_by_draft_id = plda.draft_id
1698: AND pel.lock_type ='F');
1699:
1700: -- 3. Delete lines identified in #2 above.

Line 2056: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ENTITY

2052: AND NVL(pla.revision_num, 0) > NVL(plda.revision_num, 0)
2053: AND NOT EXISTS (SELECT 'F locks'
2054: FROM po_entity_locks pel
2055: WHERE pel.entity_pk1 = plda.line_location_id
2056: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ENTITY
2057: AND pel.lock_by_draft_id = plda.draft_id
2058: AND pel.lock_type = 'F')
2059: AND pla.shipment_type <> 'PRICE BREAK';
2060:

Line 2089: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ENTITY

2085: AND NVL(pla.revision_num, 0) > NVL(plda.revision_num, 0)
2086: AND NOT EXISTS (SELECT 'P/F locks'
2087: FROM po_entity_locks pel
2088: WHERE pel.entity_pk1 = plda.line_location_id
2089: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ENTITY
2090: AND pel.lock_by_draft_id = plda.draft_id
2091: AND pel.lock_type IN ('F','P'))
2092: AND pla.shipment_type <> 'PRICE BREAK';
2093:

Line 2276: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_DIST_ENTITY

2272: AND NVL(pla.revision_num, 0) > NVL(plda.revision_num, 0)
2273: AND NOT EXISTS (SELECT 'F locks'
2274: FROM po_entity_locks pel
2275: WHERE pel.entity_pk1 = plda.po_distribution_id
2276: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_DIST_ENTITY
2277: AND pel.lock_by_draft_id = plda.draft_id
2278: AND pel.lock_type = 'F')
2279: AND pla.distribution_type <> 'AGREEMENT';
2280:

Line 2309: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_DIST_ENTITY

2305: AND NVL(pla.revision_num, 0) > NVL(plda.revision_num, 0)
2306: AND NOT EXISTS (SELECT 'P/F locks'
2307: FROM po_entity_locks pel
2308: WHERE pel.entity_pk1 = plda.po_distribution_id
2309: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_DIST_ENTITY
2310: AND pel.lock_by_draft_id = plda.draft_id
2311: AND pel.lock_type IN ('F','P'))
2312: AND pla.distribution_type <> 'AGREEMENT';
2313:

Line 2421: FROM po_drafts

2417:
2418: l_entension_id_tbl:=po_tbl_number();
2419: SELECT document_id
2420: INTO l_po_header_id
2421: FROM po_drafts
2422: WHERE draft_id = p_draft_id;
2423:
2424: d_position := 20;
2425: IF (PO_LOG.d_stmt) THEN

Line 2553: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY

2549: AND NOT EXISTS (SELECT 'only S or Null Locks'
2550: FROM po_entity_locks pel
2551: WHERE pel.lock_type IN ('P','F')
2552: AND pel.entity_pk1= phb1.po_header_id
2553: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY
2554: AND pel.lock_by_draft_id = p_draft_id )
2555: -- exclude multi-row attribute groups
2556: AND EXISTS (SELECT 'Single row attr grp'
2557: FROM ego_fnd_dsc_flx_ctx_ext ag

Line 2895: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY

2891: AND NOT EXISTS (SELECT 'only S or Null Locks'
2892: FROM po_entity_locks pel
2893: WHERE pel.lock_type IN ('P','F')
2894: AND pel.entity_pk1= pheb.po_header_id
2895: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY
2896: AND pel.lock_by_draft_id = p_draft_id )
2897: AND EXISTS (SELECT 'if multi row attr grp'
2898: FROM ego_fnd_dsc_flx_ctx_ext ag
2899: WHERE pheb.attr_group_id = ag.attr_group_id

Line 3131: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY

3127: AND NOT EXISTS (SELECT 'only S or Null Locks'
3128: FROM po_entity_locks pel
3129: WHERE pel.lock_type IN ('P','F')
3130: AND pel.entity_pk1= phb.po_header_id
3131: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY
3132: AND pel.lock_by_draft_id = p_draft_id )
3133: AND EXISTS (SELECT 'Multi row attr grp'
3134: FROM ego_fnd_dsc_flx_ctx_ext ag
3135: WHERE phb.attr_group_id = ag.attr_group_id

Line 3172: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY

3168: AND NOT EXISTS (SELECT 'only S or Null Locks'
3169: FROM po_entity_locks pel
3170: WHERE pel.lock_type IN ('P','F')
3171: AND pel.entity_pk1= phaet.po_header_id
3172: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY
3173: AND pel.lock_by_draft_id = p_draft_id )
3174: AND NOT EXISTS (SELECT 'Exclude Uda attributes'
3175: FROM po_headers_all_ext_b phb
3176: WHERE PHB.EXTENSION_ID = phaet.EXTENSION_ID

Line 4469: FROM po_drafts

4465: END IF;
4466:
4467: SELECT document_id
4468: INTO l_po_header_id
4469: FROM po_drafts
4470: WHERE draft_id = p_draft_id;
4471:
4472: d_position := 20;
4473: IF (PO_LOG.d_stmt) THEN

Line 4682: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_ADDRESS_ENTITY

4678: FROM po_entity_locks pel
4679: WHERE pel.lock_type IN ('P','F')
4680: AND pel.entity_pk1= phbd.po_header_id
4681: AND pel.entity_pk2= phbd.c_ext_attr39
4682: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_ADDRESS_ENTITY
4683: AND pel.lock_by_draft_id = p_draft_id )
4684: AND EXISTS (SELECT 'base.rev_num>draft.rev_num'
4685: FROM po_headers_all_ext_b phb,
4686: po_drafts dft

Line 4686: po_drafts dft

4682: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_ADDRESS_ENTITY
4683: AND pel.lock_by_draft_id = p_draft_id )
4684: AND EXISTS (SELECT 'base.rev_num>draft.rev_num'
4685: FROM po_headers_all_ext_b phb,
4686: po_drafts dft
4687: WHERE ( (p_ignore_rev_number ='Y') OR (NVL(phb.revision_num,0) > NVL(phbd.revision_num,0) OR NVL(dft.revision_num,0) = -1))
4688: AND phb.draft_id = -1
4689: AND phb.po_header_id=l_po_header_id
4690: and phbd.draft_id = dft.draft_id);

Line 4837: --commit the code upto this point,because po_drafts table is getting updated

4833: IF l_return_status = FND_API.G_RET_STS_SUCCESS
4834: AND l_return_status_mod = FND_API.G_RET_STS_SUCCESS THEN
4835: resultout:='COMPLETE:'||'SUCCESS';
4836:
4837: --commit the code upto this point,because po_drafts table is getting updated
4838: --for the row corresponding to draft_id=p_draft_id
4839: --and this table will again get updated for the same row in
4840: -- PO_DRAFTS_PVT.update_draft_status which is called from
4841: -- PO_DRAFT_MERGE_PKG.MergeReserve_Autonomous,an autonoumous transaction,

Line 4840: -- PO_DRAFTS_PVT.update_draft_status which is called from

4836:
4837: --commit the code upto this point,because po_drafts table is getting updated
4838: --for the row corresponding to draft_id=p_draft_id
4839: --and this table will again get updated for the same row in
4840: -- PO_DRAFTS_PVT.update_draft_status which is called from
4841: -- PO_DRAFT_MERGE_PKG.MergeReserve_Autonomous,an autonoumous transaction,
4842: -- via a call to TRANSFER_DRAFT_TO_TXN.
4843: -- this results in deadlock ERROR
4844: --similarly other tables also create deadlock error if the code isnt commited till this point.

Line 4976: FROM po_drafts

4972: l_draft_id := wf_engine.GetItemAttrNumber (itemtype, itemkey, 'DRAFT_ID');
4973:
4974: SELECT document_id
4975: INTO l_po_header_id
4976: FROM po_drafts
4977: WHERE draft_id = l_draft_id;
4978:
4979: x_progress := 'PO_MOD_SYNC_PROCESS_PVT.ACQUIRE_SYNC_SGD_LOCK: l_draft_id: '||l_draft_id||', l_po_header_id: '||l_po_header_id||', l_doc_sub_type: '||l_doc_sub_type||', l_doc_type: '||l_doc_type;
4980:

Line 5047: FROM po_drafts

5043:
5044: BEGIN
5045: SELECT document_id
5046: INTO l_po_header_id
5047: FROM po_drafts
5048: WHERE draft_id = l_draft_id;
5049:
5050: SELECT 'N'
5051: INTO l_is_lock_available

Line 5107: FROM po_drafts

5103:
5104: --Fetch the header id
5105: SELECT document_id
5106: INTO l_po_header_id
5107: FROM po_drafts
5108: WHERE draft_id = l_draft_id;
5109:
5110: SELECT revision_num INTO l_draft_rev_num FROM po_headers_draft_all WHERE po_header_id = l_po_header_id AND draft_id = l_draft_id;
5111: SELECT revision_num INTO l_header_base_rev_num FROM po_headers_all WHERE po_header_id = l_po_header_id;

Line 5112: SELECT revision_num INTO draft_revision_num FROM po_drafts WHERE draft_id = l_draft_id;

5108: WHERE draft_id = l_draft_id;
5109:
5110: SELECT revision_num INTO l_draft_rev_num FROM po_headers_draft_all WHERE po_header_id = l_po_header_id AND draft_id = l_draft_id;
5111: SELECT revision_num INTO l_header_base_rev_num FROM po_headers_all WHERE po_header_id = l_po_header_id;
5112: SELECT revision_num INTO draft_revision_num FROM po_drafts WHERE draft_id = l_draft_id;
5113:
5114: x_progress := 'PO_MOD_SYNC_PROCESS_PVT.IS_SGD_GENERATION_REQUIRED: Draft_id: '
5115: || l_draft_id || 'l_draft_rev_num : '|| l_draft_rev_num || 'l_header_base_rev_num '|| l_header_base_rev_num || 'draft_revision_num '|| draft_revision_num;
5116:

Line 5176: FROM po_drafts

5172: l_draft_id := wf_engine.GetItemAttrNumber (itemtype, itemkey, 'DRAFT_ID');
5173:
5174: SELECT document_id
5175: INTO l_po_header_id
5176: FROM po_drafts
5177: WHERE draft_id = l_draft_id;
5178:
5179: l_doc_sub_type := wf_engine.GetItemAttrText ( itemtype => itemtype,
5180: itemkey => itemkey,

Line 5202: from po_print_form_formats pf, po_drafts h, po_headers_all h1, fnd_languages f

5198:
5199:
5200: select pf.DOC_FORMAT_TMPL_CODE, f.iso_territory, f.language_code
5201: into l_template_code,l_cd_territory,l_lang_code
5202: from po_print_form_formats pf, po_drafts h, po_headers_all h1, fnd_languages f
5203: where pf.FORM_SOURCE = 'PO' and pf.DOCUMENT_TYPE = 'PO_MOD_STD_FORM' and pf.STANDARD_FORM = h.CLM_STANDARD_FORM
5204: and pf.DOCUMENT_FORMAT = h.CLM_DOCUMENT_FORMAT and h1.po_header_id = h.document_id
5205: and pf.STYLE_ID = h1.STYLE_ID and h.draft_id = l_draft_id and f.language_code = USERENV('LANG');
5206:

Line 5277: FROM po_drafts

5273: CURSOR waiting_process_wf_keys(l_draft_id IN Number) IS
5274: SELECT item_key FROM wf_item_activity_statuses_v
5275: WHERE user_key = (SELECT segment1 FROM po_headers_all
5276: WHERE po_header_id = (SELECT document_id
5277: FROM po_drafts
5278: WHERE draft_id = l_draft_id))
5279: AND activity_name = 'WAIT_FOR_LOCK_TO_BE_RELEASED' AND activity_status_code = 'NOTIFIED' ;
5280:
5281: PRAGMA AUTONOMOUS_TRANSACTION ;

Line 5297: FROM po_drafts

5293:
5294: BEGIN
5295: SELECT document_id
5296: INTO l_po_header_id
5297: FROM po_drafts
5298: WHERE draft_id = l_draft_id;
5299:
5300: delete
5301: FROM po_entity_locks