30: PO_DEBUG.debug_begin(p_log_head => g_log_head||'wrapup');
31: END IF;
32:
33: DELETE po_distributions_interface
34: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
35:
36: --
37: DELETE po_price_diff_interface
38: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
34: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
35:
36: --
37: DELETE po_price_diff_interface
38: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
39: --
40:
41: --
42: DELETE po_line_locations_interface
39: --
40:
41: --
42: DELETE po_line_locations_interface
43: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
44: --
45:
46: DELETE po_lines_interface
47: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
43: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
44: --
45:
46: DELETE po_lines_interface
47: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
48:
49:
50: DELETE po_headers_interface
51: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
47: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
48:
49:
50: DELETE po_headers_interface
51: WHERE interface_header_id = PO_AUTOCREATE_PARAMS.x_interface_header_id;
52:
53: IF g_debug_stmt THEN --< Bug 3210331: use proper debugging >
54: PO_DEBUG.debug_end(p_log_head => g_log_head||'wrapup');
55: END IF;
122: SAVEPOINT create_po;
123:
124: l_progress := '010';
125:
126: PO_AUTOCREATE_PARAMS.x_interface_header_id := x_interface_header_id;
127: PO_AUTOCREATE_PARAMS.x_req_operating_unit_id := p_req_operating_unit_id;
128: PO_AUTOCREATE_PARAMS.x_purch_operating_unit_id := p_purch_operating_unit_id;
129: PO_AUTOCREATE_PARAMS.x_orig_org_id := p_orig_org_id;
130: PO_AUTOCREATE_PARAMS.x_sourcing_k_doc_type := p_sourcing_k_doc_type;
123:
124: l_progress := '010';
125:
126: PO_AUTOCREATE_PARAMS.x_interface_header_id := x_interface_header_id;
127: PO_AUTOCREATE_PARAMS.x_req_operating_unit_id := p_req_operating_unit_id;
128: PO_AUTOCREATE_PARAMS.x_purch_operating_unit_id := p_purch_operating_unit_id;
129: PO_AUTOCREATE_PARAMS.x_orig_org_id := p_orig_org_id;
130: PO_AUTOCREATE_PARAMS.x_sourcing_k_doc_type := p_sourcing_k_doc_type;
131: PO_AUTOCREATE_PARAMS.x_conterms_exist_flag := p_conterms_exist_flag;
124: l_progress := '010';
125:
126: PO_AUTOCREATE_PARAMS.x_interface_header_id := x_interface_header_id;
127: PO_AUTOCREATE_PARAMS.x_req_operating_unit_id := p_req_operating_unit_id;
128: PO_AUTOCREATE_PARAMS.x_purch_operating_unit_id := p_purch_operating_unit_id;
129: PO_AUTOCREATE_PARAMS.x_orig_org_id := p_orig_org_id;
130: PO_AUTOCREATE_PARAMS.x_sourcing_k_doc_type := p_sourcing_k_doc_type;
131: PO_AUTOCREATE_PARAMS.x_conterms_exist_flag := p_conterms_exist_flag;
132:
125:
126: PO_AUTOCREATE_PARAMS.x_interface_header_id := x_interface_header_id;
127: PO_AUTOCREATE_PARAMS.x_req_operating_unit_id := p_req_operating_unit_id;
128: PO_AUTOCREATE_PARAMS.x_purch_operating_unit_id := p_purch_operating_unit_id;
129: PO_AUTOCREATE_PARAMS.x_orig_org_id := p_orig_org_id;
130: PO_AUTOCREATE_PARAMS.x_sourcing_k_doc_type := p_sourcing_k_doc_type;
131: PO_AUTOCREATE_PARAMS.x_conterms_exist_flag := p_conterms_exist_flag;
132:
133: l_progress := '015';
126: PO_AUTOCREATE_PARAMS.x_interface_header_id := x_interface_header_id;
127: PO_AUTOCREATE_PARAMS.x_req_operating_unit_id := p_req_operating_unit_id;
128: PO_AUTOCREATE_PARAMS.x_purch_operating_unit_id := p_purch_operating_unit_id;
129: PO_AUTOCREATE_PARAMS.x_orig_org_id := p_orig_org_id;
130: PO_AUTOCREATE_PARAMS.x_sourcing_k_doc_type := p_sourcing_k_doc_type;
131: PO_AUTOCREATE_PARAMS.x_conterms_exist_flag := p_conterms_exist_flag;
132:
133: l_progress := '015';
134:
127: PO_AUTOCREATE_PARAMS.x_req_operating_unit_id := p_req_operating_unit_id;
128: PO_AUTOCREATE_PARAMS.x_purch_operating_unit_id := p_purch_operating_unit_id;
129: PO_AUTOCREATE_PARAMS.x_orig_org_id := p_orig_org_id;
130: PO_AUTOCREATE_PARAMS.x_sourcing_k_doc_type := p_sourcing_k_doc_type;
131: PO_AUTOCREATE_PARAMS.x_conterms_exist_flag := p_conterms_exist_flag;
132:
133: l_progress := '015';
134:
135: IF g_debug_stmt THEN
148: l_progress := '040';
149: PO_AUTOCREATE_POSTPROC_PVT.process;
150:
151: l_progress := '050';
152: x_document_id := PO_AUTOCREATE_PARAMS.g_po_header_id;
153:
154: if x_document_id is not null then
155: l_return_status := FND_API.G_RET_STS_SUCCESS ;
156: --Bug 14006061 : After autocreate is successfully complete need to clear the interface records.
195: --raise;
196: --
197: --for sourcing transaction is controlled by the sourcing code.
198:
199: if PO_AUTOCREATE_PARAMS.g_interface_source_code not in ('SOURCING', 'CONSUMPTION_ADVICE') then
200: ROLLBACK to savepoint create_po;
201: wrapup;
202: end if;
203:
327: if x_token2_value is not null then
328: fnd_message.set_token(x_token2_name,x_token2_value);
329: end if;
330:
331: PO_AUTOCREATE_PARAMS.g_error_code_tbl.extend(1);
332: PO_AUTOCREATE_PARAMS.g_error_code_tbl(PO_AUTOCREATE_PARAMS.g_error_code_tbl.count) := fnd_message.get;
333:
334: IF g_debug_stmt THEN
335: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
328: fnd_message.set_token(x_token2_name,x_token2_value);
329: end if;
330:
331: PO_AUTOCREATE_PARAMS.g_error_code_tbl.extend(1);
332: PO_AUTOCREATE_PARAMS.g_error_code_tbl(PO_AUTOCREATE_PARAMS.g_error_code_tbl.count) := fnd_message.get;
333:
334: IF g_debug_stmt THEN
335: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
336: p_token => l_progress,
333:
334: IF g_debug_stmt THEN
335: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
336: p_token => l_progress,
337: p_message => PO_AUTOCREATE_PARAMS.g_error_code_tbl(PO_AUTOCREATE_PARAMS.g_error_code_tbl.count));
338: END IF;
339:
340: IF g_debug_stmt THEN
341: PO_DEBUG.debug_end(p_log_head => g_log_head||l_api_name);
398: IF g_debug_stmt THEN
399: PO_DEBUG.debug_begin(p_log_head => g_log_head||l_api_name);
400: END IF;
401:
402: RETURN PO_AUTOCREATE_PARAMS.g_error_code_tbl;
403:
404: EXCEPTION
405:
406: when no_data_found then
419: l_progress VARCHAR2(10) := '000';
420:
421: BEGIN
422:
423: PO_AUTOCREATE_PARAMS.g_error_code_tbl := PO_TBL_VARCHAR2000();
424:
425: EXCEPTION
426:
427: when no_data_found THEN