DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_CUSTOM_MULTIMOD_VAL_PVT

Source


1 PACKAGE BODY PO_CUSTOM_MULTIMOD_VAL_PVT AS
2 /* $Header: PO_CUSTOM_MULTIMOD_VAL_PVT.plb 120.2 2011/09/20 20:29:21 rarajar noship $ */
3 
4 ---------------------------------------------------------------------------
5 -- Modules for debugging.
6 ---------------------------------------------------------------------------
7 
8 -- The module base for this package.
9 D_PACKAGE_BASE CONSTANT VARCHAR2(50) :=
10   PO_LOG.get_package_base('PO_CUSTOM_MULTIMOD_VAL_PVT');
11 
12 -- The module base for the subprogram.
13 D_generate_custom_exceptions CONSTANT VARCHAR2(100) :=
14   PO_LOG.get_subprogram_base(D_PACKAGE_BASE,'generate_custom_exceptions');
15 
16 -------------------------------------------------------------------------------
17 --Start of Comments
18 --Name: generate_custom_exceptions
19 --Pre-reqs: None.
20 --Function:
21 --  Based on the validation type and the request type the validation set is created and passed on to validate_set
22 --  procedure to perform the validations and store the results in the object type po_multi_mod_val_results.
23 --Parameters:
24 --IN:
25 --p_multi_mod_requests
26 --	po_multi_mod_requests table data for validation
27 --p_multi_mod_docs
28 --	po_multi_mod_docs table data for validation
29 --p_multi_mod_changes
30 --	po_multi_mod_changes table data for validation
31 --p_validation_type
32 --	Parameter to identify if the validations are 'pre-submit' or 'concurrent'
33 --OUT:
34 --x_result_type
35 --	Identifies if the validation was a success or failure
36 --x_results
37 --	Out variable that holds the validation results
38 --End of Comments
39 -------------------------------------------------------------------------------
40 PROCEDURE generate_custom_exceptions(	p_name_value_pair IN PO_NAME_VALUE_PAIR_TAB
41 										,x_result_type    OUT NOCOPY VARCHAR2
42 										,x_results        IN OUT NOCOPY PO_MULTI_MOD_VAL_RESULTS_TYPE
43 									)
44 IS
45 l_results_count NUMBER;
46 d_mod CONSTANT VARCHAR2(100) := D_generate_custom_exceptions;
47 d_position NUMBER := 0;
48 d_stmt CONSTANT BOOLEAN := PO_LOG.d_stmt;
49 
50 BEGIN
51 
52 	IF PO_LOG.d_proc THEN
53 	--	PO_LOG.proc_begin(d_mod,'p_name_value_pair',p_name_value_pair);
54 		PO_LOG.proc_begin(d_mod,'x_result_type',x_result_type);
55 	END IF;
56 
57 	IF (x_results IS NULL) THEN
58 		x_results := PO_MULTI_MOD_VAL_RESULTS_TYPE.new_instance();
59     END IF;
60 
61 	l_results_count := x_results.result_type.COUNT;
62 	IF d_stmt THEN
63 		PO_LOG.stmt(d_mod,d_position,'l_results_count',l_results_count);
64 	END IF;
65 
66 	d_position := 10;
67 
68 	/* Add custom validations here.
69 	For every validation failure, the error/warning message has to be added to x_results. Sample below.
70 	x_results.add_result(
71 						  p_multi_mod_val_result_id
72 						, p_multi_mod_request_id
73 						, p_multi_mod_doc_id
74 						, p_validation_type
75 						, p_exception_type
76 						, p_result_type
77 						, p_document_id
78 						, p_document_number
79 						, p_related_document_id
80 						, p_related_document_number
81 						, p_related_document_date
82 						, p_related_document_amount
83 						, p_message_application
84 						, p_message_name
85 						, p_token1_name
86 						, p_token1_value
87 						, p_token2_name
88 						, p_token2_value
89 						, p_token3_name
90 						, p_token3_value
91 						, p_token4_name
92 						, p_token4_value
93 						, p_token5_name
94 						, p_token5_value
95 						, p_token6_name
96 						, p_token6_value
97 						);*/
98 
99 	d_position := 20;
100 	IF l_results_count < x_results.result_type.COUNT THEN
101 		x_result_type := c_result_type_FAILURE;
102 	ELSE
103 		x_result_type := c_result_type_SUCCESS;
104     END IF;
105 
106 	IF PO_LOG.d_proc THEN
107       PO_LOG.proc_end(d_mod,'x_result_type',x_result_type);
108     END IF;
109 
110 EXCEPTION
111 WHEN OTHERS THEN
112   IF PO_LOG.d_exc THEN
113 	PO_LOG.exc(d_mod,d_position,NULL);
114   END IF;
115   RAISE;
116 
117 END generate_custom_exceptions;
118 
119 END PO_CUSTOM_MULTIMOD_VAL_PVT;