13: -- None
14: --Function:
15: -- Checks whether there is any draft changes in the draft table
16: -- given the draft_id or draft_id + po_header_id
17: -- If only draft_id is provided, this program returns FND_API.G_TRUE for
18: -- any draft changes in this table for the draft
19: -- If the whole primary key is provided (draft_id + header id), then
20: -- it return true if there is draft for this particular record in
21: -- the draft table
29: --OUT:
30: --Returns:
31: -- Array of flags indicating whether draft changes exist for the corresponding
32: -- entry in the input parameter. For each entry in the returning array:
33: -- FND_API.G_TRUE if there are draft changes
34: -- FND_API.G_FALSE if there aren't draft changes
35: --Notes:
36: --Testing:
37: --End of Comments
30: --Returns:
31: -- Array of flags indicating whether draft changes exist for the corresponding
32: -- entry in the input parameter. For each entry in the returning array:
33: -- FND_API.G_TRUE if there are draft changes
34: -- FND_API.G_FALSE if there aren't draft changes
35: --Notes:
36: --Testing:
37: --End of Comments
38: ------------------------------------------------------------------------
60: l_dft_exists_tbl.extend(p_draft_id_tbl.COUNT);
61:
62: FOR i IN 1..l_index_tbl.COUNT LOOP
63: l_index_tbl(i) := i;
64: l_dft_exists_tbl(i) := FND_API.G_FALSE;
65: END LOOP;
66:
67: d_position := 10;
68:
97:
98: d_position := 40;
99:
100: FOR i IN 1..l_dft_exists_index_tbl.COUNT LOOP
101: l_dft_exists_tbl(l_dft_exists_index_tbl(i)) := FND_API.G_TRUE;
102: END LOOP;
103:
104: IF (PO_LOG.d_stmt) THEN
105: PO_LOG.stmt(d_module, d_position, '# of records that have dft changes',
113: PO_MESSAGE_S.add_exc_msg
114: ( p_pkg_name => d_pkg_name,
115: p_procedure_name => d_api_name || '.' || d_position
116: );
117: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
118: END draft_changes_exist;
119:
120:
121:
136: -- po header unique identifier
137: --IN OUT:
138: --OUT:
139: --Returns:
140: -- FND_API.G_TRUE if there are draft changes
141: -- FND_API.G_FALSE if there aren't draft changes
142: --Notes:
143: --Testing:
144: --End of Comments
137: --IN OUT:
138: --OUT:
139: --Returns:
140: -- FND_API.G_TRUE if there are draft changes
141: -- FND_API.G_FALSE if there aren't draft changes
142: --Notes:
143: --Testing:
144: --End of Comments
145: ------------------------------------------------------------------------
176: PO_MESSAGE_S.add_exc_msg
177: ( p_pkg_name => d_pkg_name,
178: p_procedure_name => d_api_name || '.' || d_position
179: );
180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
181: END draft_changes_exist;
182:
183:
184: -----------------------------------------------------------------------
229: IF (PO_LOG.d_proc) THEN
230: PO_LOG.proc_begin(d_module);
231: END IF;
232:
233: IF (p_draft_info.headers_changed = FND_API.G_FALSE) THEN
234: IF (PO_LOG.d_stmt) THEN
235: PO_LOG.stmt(d_module, d_position, 'no change-no need to apply');
236: END IF;
237:
317:
318: -- call contract api to delete contract terms
319: OKC_TERMS_UTIL_GRP.delete_doc
320: ( p_api_version => 1.0
321: , p_init_msg_list => FND_API.G_TRUE
322: , p_commit => FND_API.G_FALSE
323: , p_doc_id => p_draft_info.po_header_id
324: , p_doc_type => l_contract_document_type
325: , p_validate_commit => FND_API.G_FALSE
318: -- call contract api to delete contract terms
319: OKC_TERMS_UTIL_GRP.delete_doc
320: ( p_api_version => 1.0
321: , p_init_msg_list => FND_API.G_TRUE
322: , p_commit => FND_API.G_FALSE
323: , p_doc_id => p_draft_info.po_header_id
324: , p_doc_type => l_contract_document_type
325: , p_validate_commit => FND_API.G_FALSE
326: , x_return_status => l_return_status
321: , p_init_msg_list => FND_API.G_TRUE
322: , p_commit => FND_API.G_FALSE
323: , p_doc_id => p_draft_info.po_header_id
324: , p_doc_type => l_contract_document_type
325: , p_validate_commit => FND_API.G_FALSE
326: , x_return_status => l_return_status
327: , x_msg_data => l_msg_data
328: , x_msg_count => l_msg_count
329: );
330:
331: d_position := 60;
332: IF (l_return_status <> 'S') THEN
333: -- display error
334: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
335: END IF;
336: ELSIF (l_dml_operation = 'UPDATE') THEN
337:
338: d_position := 70;
357:
358: d_position := 80;
359: IF (l_return_status <> 'S') THEN
360: -- display error
361: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
362: END IF;
363:
364: END IF;
365:
373: PO_MESSAGE_S.add_exc_msg
374: ( p_pkg_name => d_pkg_name,
375: p_procedure_name => d_api_name || '.' || d_position
376: );
377: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
378: END apply_changes;
379:
380: END PO_HEADERS_DRAFT_PVT;