1 PACKAGE AHL_Utility_PVT AUTHID CURRENT_USER as
2 /* $Header: AHLVUTLS.pls 120.1 2006/01/31 03:44:24 tamdas noship $ */
3 --
4 g_number CONSTANT NUMBER := 1; -- data type is number
5 g_varchar2 CONSTANT NUMBER := 2; -- data type is varchar2
6 g_ahl_lookups CONSTANT VARCHAR2(20) := 'FND_LOOKUP_VALUES';
7
8 ---------------------------------------------------------------------
9 -- FUNCTION
10 -- check_fk_exists
11 --
12 -- PURPOSE
13 -- This function checks if a foreign key is valid.
14 --
15 -- NOTES
16 -- 1. It will return FND_API.g_true/g_false.
17 -- 2. Exception encountered will be raised to the caller.
18 -- 3. p_pk_data_type can be AMS_Global_PVT.g_number/g_varchar2.
19 -- 4. Please don't put 'AND' at the beginning of your additional
20 -- where clause.
21 ---------------------------------------------------------------------
22 FUNCTION check_fk_exists(
23 p_table_name IN VARCHAR2,
24 p_pk_name IN VARCHAR2,
25 p_pk_value IN VARCHAR2,
26 p_pk_data_type IN NUMBER := g_number,
27 p_additional_where_clause IN VARCHAR2 := NULL
28 )
29 RETURN VARCHAR2; -- FND_API.g_true/g_false
30
31
32 ---------------------------------------------------------------------
33 -- FUNCTION
34 -- check_lookup_exists
35 --
36 -- PURPOSE
37 -- This function checks if a lookup_code is valid.
38 ---------------------------------------------------------------------
39 FUNCTION check_lookup_exists(
40 p_lookup_table_name IN VARCHAR2 := g_ahl_lookups,
41 p_lookup_type IN VARCHAR2,
42 p_lookup_code IN VARCHAR2
43 )
44 Return VARCHAR2; -- FND_API.g_true/g_false
45
46 ---------------------------------------------------------------------
47 -- FUNCTION
48 -- check_uniqueness
49 --
50 -- PURPOSE
51 -- This function is to check the uniqueness of the keys.
52 -- In order to make this function more flexible, you need to
53 -- pass in where clause of your unique key's check.
54 ---------------------------------------------------------------------
55 FUNCTION check_uniqueness(
56 p_table_name IN VARCHAR2,
57 p_where_clause IN VARCHAR2
58 )
59 RETURN VARCHAR2; -- FND_API.g_true/g_false
60
61 ---------------------------------------------------------------------
62 -- PROCEDURE
63 -- debug_message
64 --
65 -- PURPOSE
66 -- This procedure will check the message level and try to add a
67 -- debug message into the message table of FND_MSG_API package.
68 -- Note that this debug message won't be translated.
69 ---------------------------------------------------------------------
70 PROCEDURE debug_message(
71 p_message_text IN VARCHAR2,
72 p_message_level IN NUMBER := FND_MSG_PUB.g_msg_lvl_debug_high
73 );
74 ---------------------------------------------------------------------
75 -- PROCEDURE
76 -- error_message
77 --
78 -- PURPOSE
79 -- Add an error message to the message_list for an expected error.
80 ---------------------------------------------------------------------
81 PROCEDURE error_message(
82 p_message_name VARCHAR2,
83 p_token_name VARCHAR2 := NULL,
84 P_token_value VARCHAR2 := NULL
85 );
86
87 ---------------------------------------------------------------------
88 -- FUNCTION
89 -- is_Y_or_N
90 --
91 -- PURPOSE
92 -- Return FND_API.g_true if p_value='Y' or p_value='N';
93 -- return FND_API.g_flase otherwise.
94 ---------------------------------------------------------------------
95 FUNCTION is_Y_or_N(
96 p_value IN VARCHAR2
97 )
98 RETURN VARCHAR2; -- FND_API.g_true/g_false
99
100 --======================================================================
101 -- FUNCTION
102 -- Check_Status_Change
103 --
104 -- PURPOSE
105 -- Created to check if the status change is valid and allowed or not.
106 -- Returns success, if it is valid allowed status change
107 --
108 --======================================================================
109
110 PROCEDURE Check_status_change (
111 p_object_type IN VARCHAR2,
112 p_user_status_id IN NUMBER,
113 p_status_type IN VARCHAR2,
114 p_current_status IN VARCHAR2,
115 p_next_status IN VARCHAR2,
116 x_return_status OUT NOCOPY VARCHAR2);
117
118 --======================================================================
119 -- FUNCTION
120 -- Check_Status_Order_Change
121 --
122 -- PURPOSE
123 -- Created to check if the status change is valid and allowed or not.
124 -- Returns success, if it is valid allowed status change
125 --
126 --======================================================================
127
128 PROCEDURE check_status_order_change (
129 p_status_type IN VARCHAR2,
130 p_current_status IN VARCHAR2,
131 p_next_status IN VARCHAR2,
132 x_return_status OUT NOCOPY VARCHAR2);
133
134
135 PROCEDURE Get_WF_Process_Name (
136 p_object IN VARCHAR2,
137 p_application_usg_code IN VARCHAR2 DEFAULT 'AHL',
138 x_active OUT NOCOPY VARCHAR2,
139 x_process_name OUT NOCOPY VARCHAR2,
140 x_item_type OUT NOCOPY VARCHAR2,
141 x_return_status OUT NOCOPY VARCHAR2,
142 x_msg_count OUT NOCOPY VARCHAR2,
143 x_msg_data OUT NOCOPY VARCHAR2);
144
145 FUNCTION Get_Unit_Name( p_instance_id in Number)
146 Return varchar2;
147
148 --======================================================================
149 -- FUNCTION
150 -- Is_Org_In_User_Ou
151 --
152 -- PURPOSE
153 -- Created to check if the Organization is in users operating unit or not.
154 -- Returns FND_API.G_TRUE if the org belongs to user's operating unit
155 -- Returns FND_API.G_FALSE if the org doesnt belong to user's operating unit
156 -- Returns 'X' on error.
157 --======================================================================
158 FUNCTION IS_ORG_IN_USER_OU
159 (
160 p_org_id IN NUMBER,
161 p_org_name IN VARCHAR2,
162 x_return_status OUT NOCOPY VARCHAR2,
163 x_msg_data OUT NOCOPY VARCHAR2
164 )
165 RETURN VARCHAR2;
166
167 --======================================================================
168 -- FUNCTION
169 -- GET_LOOKUP_MEANING
170 --
171 -- PURPOSE
172 -- Return fnd_lookup_values_vl.meaning, given lookup_type & lookup_code.
173 -- This function will either return the correct meaning, or return null.
174 -- This function also will not raise any error.
175 --======================================================================
176 FUNCTION GET_LOOKUP_MEANING
177 (
181 RETURN VARCHAR2;
178 p_lookup_type IN VARCHAR2,
179 p_lookup_code IN VARCHAR2
180 )
182
183 END AHL_Utility_PVT;