29: --p_org_assign_rec
30: -- Record of the entire row of PO_GA_ORG_ASSIGNMENTS table.
31: --OUT:
32: --x_return_status
33: -- FND_API.g_ret_sts_success - on success
34: -- FND_API.g_ret_sts_error - if duplicate row is inserted
35: -- FND_API.g_ret_sts_unexp_error - unexpected error
36: --x_row_id
37: -- The rowid of the record inserted into the table.
30: -- Record of the entire row of PO_GA_ORG_ASSIGNMENTS table.
31: --OUT:
32: --x_return_status
33: -- FND_API.g_ret_sts_success - on success
34: -- FND_API.g_ret_sts_error - if duplicate row is inserted
35: -- FND_API.g_ret_sts_unexp_error - unexpected error
36: --x_row_id
37: -- The rowid of the record inserted into the table.
38: --Testing:
31: --OUT:
32: --x_return_status
33: -- FND_API.g_ret_sts_success - on success
34: -- FND_API.g_ret_sts_error - if duplicate row is inserted
35: -- FND_API.g_ret_sts_unexp_error - unexpected error
36: --x_row_id
37: -- The rowid of the record inserted into the table.
38: --Testing:
39: --End of Comments
48: l_org_assignment_id PO_GA_ORG_ASSIGNMENTS.ORG_ASSIGNMENT_ID%TYPE; --
49: BEGIN
50: --< Shared Proc FPJ Start >
51: -- Start standard API initialization
52: IF FND_API.to_boolean(p_init_msg_list) THEN
53: FND_MSG_PUB.initialize;
54: END IF;
55: x_return_status := FND_API.g_ret_sts_success;
56: -- End standard API initialization
51: -- Start standard API initialization
52: IF FND_API.to_boolean(p_init_msg_list) THEN
53: FND_MSG_PUB.initialize;
54: END IF;
55: x_return_status := FND_API.g_ret_sts_success;
56: -- End standard API initialization
57: --< Shared Proc FPJ End >
58:
59: --
95:
96: EXCEPTION
97: --< Shared Proc FPJ Start >
98: WHEN DUP_VAL_ON_INDEX THEN
99: x_return_status := FND_API.g_ret_sts_error;
100: FND_MESSAGE.set_name(application => 'PO',
101: name => 'PO_GA_ORG_ASSIGN_DUPLICATE');
102: FND_MSG_PUB.add;
103: WHEN OTHERS THEN
100: FND_MESSAGE.set_name(application => 'PO',
101: name => 'PO_GA_ORG_ASSIGN_DUPLICATE');
102: FND_MSG_PUB.add;
103: WHEN OTHERS THEN
104: x_return_status := FND_API.g_ret_sts_unexp_error;
105: FND_MSG_PUB.add_exc_msg(p_pkg_name => g_pkg_name,
106: p_procedure_name => 'insert_row');
107: --< Shared Proc FPJ End >
108: END insert_row;
137: -- Record of the entire row of PO_GA_ORG_ASSIGNMENTS table.
138: --p_row_id
139: --OUT:
140: --x_return_status
141: -- FND_API.g_ret_sts_success - on success
142: -- FND_API.g_ret_sts_error - if update causes duplicate rows
143: -- FND_API.g_ret_sts_unexp_error - unexpected error
144: --Testing:
145: --End of Comments
138: --p_row_id
139: --OUT:
140: --x_return_status
141: -- FND_API.g_ret_sts_success - on success
142: -- FND_API.g_ret_sts_error - if update causes duplicate rows
143: -- FND_API.g_ret_sts_unexp_error - unexpected error
144: --Testing:
145: --End of Comments
146: --------------------------------------------------------------------------------
139: --OUT:
140: --x_return_status
141: -- FND_API.g_ret_sts_success - on success
142: -- FND_API.g_ret_sts_error - if update causes duplicate rows
143: -- FND_API.g_ret_sts_unexp_error - unexpected error
144: --Testing:
145: --End of Comments
146: --------------------------------------------------------------------------------
147: PROCEDURE update_row
153: IS
154:
155: BEGIN
156: -- Start standard API initialization
157: IF FND_API.to_boolean(p_init_msg_list) THEN
158: FND_MSG_PUB.initialize;
159: END IF;
160: x_return_status := FND_API.g_ret_sts_success;
161: -- End standard API initialization
156: -- Start standard API initialization
157: IF FND_API.to_boolean(p_init_msg_list) THEN
158: FND_MSG_PUB.initialize;
159: END IF;
160: x_return_status := FND_API.g_ret_sts_success;
161: -- End standard API initialization
162:
163: UPDATE po_ga_org_assignments
164: SET organization_id = p_org_assign_rec.organization_id,
171: WHERE rowid = p_row_id;
172:
173: EXCEPTION
174: WHEN DUP_VAL_ON_INDEX THEN
175: x_return_status := FND_API.g_ret_sts_error;
176: FND_MESSAGE.set_name(application => 'PO',
177: name => 'PO_GA_ORG_ASSIGN_DUPLICATE');
178: FND_MSG_PUB.add;
179: WHEN OTHERS THEN
176: FND_MESSAGE.set_name(application => 'PO',
177: name => 'PO_GA_ORG_ASSIGN_DUPLICATE');
178: FND_MSG_PUB.add;
179: WHEN OTHERS THEN
180: x_return_status := FND_API.g_ret_sts_unexp_error;
181: FND_MSG_PUB.add_exc_msg(p_pkg_name => g_pkg_name,
182: p_procedure_name => 'update_row');
183: END update_row;
184: --< Shared Proc FPJ End >
297: (l_pgoa_rec.purchasing_org_id <> p_org_assign_rec.purchasing_org_id) OR
298: (l_pgoa_rec.vendor_site_id <> p_org_assign_rec.vendor_site_id) OR
299: (l_pgoa_rec.enabled_flag <> p_org_assign_rec.enabled_flag)
300: THEN
301: RAISE FND_API.g_exc_error;
302: END IF;
303:
304: EXCEPTION
305: WHEN APP_EXCEPTION.record_lock_exception THEN
309: -- Could not find the record
310: FND_MESSAGE.set_name(application => 'FND',
311: name => 'FORM_RECORD_DELETED');
312: APP_EXCEPTION.raise_exception;
313: WHEN FND_API.g_exc_error THEN
314: -- The individual value comparisons failed
315: FND_MESSAGE.set_name(application => 'FND',
316: name => 'FORM_RECORD_CHANGED');
317: APP_EXCEPTION.raise_exception;
339: -- with the input parameters.
340: --Parameters:
341: --IN:
342: --p_init_msg_list
343: -- Standard param initializes API message list if FND_API.g_true;
344: --p_from_po_header_id
345: -- The header ID of the original GA whose org assignments will be copied.
346: --p_to_po_header_id
347: -- The header ID of the new GA for the new org assignments.
351: --p_created_by
352: --p_last_update_login
353: --OUT:
354: --x_return_status
355: -- FND_API.g_ret_sts_success - success.
356: -- FND_API.g_ret_sts_error - duplicate rows inserted. Appends message
357: -- PO_GA_ORG_ASSIGN_DUPLICATE.
358: -- FND_API.g_ret_sts_unexp_error - Unexpected error occurred, or no rows were
359: -- inserted. Appends unexpected error message.
352: --p_last_update_login
353: --OUT:
354: --x_return_status
355: -- FND_API.g_ret_sts_success - success.
356: -- FND_API.g_ret_sts_error - duplicate rows inserted. Appends message
357: -- PO_GA_ORG_ASSIGN_DUPLICATE.
358: -- FND_API.g_ret_sts_unexp_error - Unexpected error occurred, or no rows were
359: -- inserted. Appends unexpected error message.
360: --End of Comments
354: --x_return_status
355: -- FND_API.g_ret_sts_success - success.
356: -- FND_API.g_ret_sts_error - duplicate rows inserted. Appends message
357: -- PO_GA_ORG_ASSIGN_DUPLICATE.
358: -- FND_API.g_ret_sts_unexp_error - Unexpected error occurred, or no rows were
359: -- inserted. Appends unexpected error message.
360: --End of Comments
361: --------------------------------------------------------------------------------
362: PROCEDURE copy_rows
373: )
374: IS
375: BEGIN
376: -- Start standard API initialization
377: IF FND_API.to_boolean(p_init_msg_list) THEN
378: FND_MSG_PUB.initialize;
379: END IF;
380: x_return_status := FND_API.g_ret_sts_success;
381: -- End standard API initialization
376: -- Start standard API initialization
377: IF FND_API.to_boolean(p_init_msg_list) THEN
378: FND_MSG_PUB.initialize;
379: END IF;
380: x_return_status := FND_API.g_ret_sts_success;
381: -- End standard API initialization
382:
383: --
384: -- Used PO_GA_ORG_ASSIGNMENTS_S.nextval directly inside insert statement
418: END IF;
419:
420: EXCEPTION
421: WHEN DUP_VAL_ON_INDEX THEN
422: x_return_status := FND_API.g_ret_sts_error;
423: FND_MESSAGE.set_name(application => 'PO',
424: name => 'PO_GA_ORG_ASSIGN_DUPLICATE');
425: FND_MSG_PUB.add;
426: WHEN OTHERS THEN
423: FND_MESSAGE.set_name(application => 'PO',
424: name => 'PO_GA_ORG_ASSIGN_DUPLICATE');
425: FND_MSG_PUB.add;
426: WHEN OTHERS THEN
427: x_return_status := FND_API.g_ret_sts_unexp_error;
428: FND_MSG_PUB.add_exc_msg(p_pkg_name => g_pkg_name,
429: p_procedure_name => 'copy_rows',
430: p_error_text => NULL);
431: END copy_rows;