DBA Data[Home] [Help]

PACKAGE: APPS.FND_FLEX_EXT

Source


1 PACKAGE fnd_flex_ext AUTHID CURRENT_USER AS
2 /* $Header: AFFFEXTS.pls 120.3.12020000.2 2012/10/08 19:39:19 tebarnes ship $ */
3 /*#
4 * Key FlexField server side validation functions.
5 * @rep:scope public
6 * @rep:product FND
7 * @rep:displayname Key Flexfield Validation Public
8 * @rep:lifecycle active
9 * @rep:compatibility S
10 * @rep:category BUSINESS_ENTITY FND_FLEX_KFF
11 */
12 
13 
14   --------
15   -- PUBLIC TYPES
16   --
17 
18   TYPE SegmentArray IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER;
19 
20 
21   --------
22   -- PUBLIC CONSTANTS
23   --
24 
25   MAX_SEG_SIZE          CONSTANT NUMBER := 4000;
26   DATE_FORMAT           CONSTANT VARCHAR2(44) := 'YYYY/MM/DD HH24:MI:SS';
27 
28   --------
29   -- PUBLIC FUNCTIONS
30   --
31 
32 /*#
33 * Gets the last error message in the current language of database.
34 * @return Returns the last error message in the current language of database.
35 * @rep:scope public
36 * @rep:displayname Get Error Message
37 * @rep:lifecycle active
38 * @rep:compatibility S
39 */
40   FUNCTION get_message RETURN VARCHAR2;
41 
42 /*#
43 * Gets the last error message in the encoded format.
44 * @return Returns the last error message in the encoded format.
45 * @rep:scope public
46 * @rep:displayname Get Encoded Error Message
47 * @rep:lifecycle active
48 * @rep:compatibility S
49 */
50   FUNCTION get_encoded_message RETURN VARCHAR2;
51 
52 /*#
53 * Concatenates segments from segment array to a string.
54 * Raises unhandled exception if any errors.
55 * @param n_segments Number of segments
56 * @param segments Input segment array
57 * @param delimiter Delimiter
58 * @return Returns the concatenated segment string.
59 * @rep:scope public
60 * @rep:displayname Get Concatenated Segment
61 * @rep:lifecycle active
62 * @rep:compatibility S
63 */
64   FUNCTION concatenate_segments(n_segments     IN  NUMBER,
65                                 segments       IN  SegmentArray,
66                                 delimiter      IN  VARCHAR2) RETURN VARCHAR2;
67 
68 /*#
69 * Breaks up concatenated segments into segment array.
70 * Truncates segments longer than MAX_SEG_SIZE bytes.
71 * Raises unhandled exception if any errors.
72 * @param concatenated_segs Concatenated string
73 * @param delimiter Delimiter
74 * @param segments Segment array
75 * @return Returns the number of segments found.
76 * @rep:scope public
77 * @rep:displayname Breakup Segments
78 * @rep:lifecycle active
79 * @rep:compatibility S
80 */
81   FUNCTION breakup_segments(concatenated_segs  IN  VARCHAR2,
82                             delimiter          IN  VARCHAR2,
83                             segments           OUT nocopy SegmentArray) RETURN NUMBER;
84 
85 /*#
86 * Gets the character used as the segment delimiter for the
87 * specified key flexfield structure.
88 * Returns NULL and sets error on the server if structure not found.
89 * @param application_short_name Application Short Name
90 * @param key_flex_code Key Flexfield Code
91 * @param structure_number Structure number
92 * @return Returns the delimiter for the key flexfield structure.
93 * @rep:scope public
94 * @rep:displayname Get Flexfield Structure Delimiter
95 * @rep:lifecycle active
96 * @rep:compatibility S
97 */
98   FUNCTION get_delimiter(application_short_name IN  VARCHAR2,
99                          key_flex_code          IN  VARCHAR2,
100                          structure_number       IN  NUMBER) RETURN VARCHAR2;
101 
102 /*#
103 * Finds combination_id for given set of key flexfield segment values.
104 * Segment values must be input in segments(1) - segments(n_segments)
105 * in the order displayed. Must explicitly assign segments(n) := NULL
106 * if a segment is null or this will generate a "no data found" error.
107 * Creates a new combination if it is valid and the flexfield allows
108 * dynamic inserts and the combination does not already exist.
109 * New valid combinations are committed within an autonomous transaction.
110 * Performs all checks on values including security and
111 * cross-validation. Value security rules will be checked for the
112 * current user identified in the FND_GLOBAL package. This will be
113 * set up automatically if the database session this package is called
114 * from underlies a concurrent program or a form.
115 * The validation date is used to determine if values have expired,
116 * and determines if cross-validation rules are still in effect.
117 * Generally pass in SYSDATE for validation date. If validation
118 * date is null, this function considers expired values valid
119 * and checks all cross-validation rules even if they are outdated.
120 * Returns TRUE if combination valid, or FALSE and sets error
121 * message using FND_MESSAGE utility on error or if invalid.
122 * If this function returns FALSE, use GET_MESSAGE to get the
123 * text of the error message in the language of the database, or
124 * GET_ENCODED_MESSAGE to get the error message in a language-
125 * independent encoded format.
126 * Combination_id output may be NULL if combination is invalid.
127 * @param application_short_name Application Short Name
128 * @param key_flex_code Key Flexfield Code
129 * @param structure_number Structure number
130 * @param validation_date Validation date
131 * @param n_segments Number of segments
132 * @param segments Segment array
133 * @param combination_id Code Combination Id
134 * @param data_set Data set number
135 * @return Returns TRUE if combination is valid, FALSE otherwise.
136 * @rep:scope public
137 * @rep:displayname Get Code Combination Id
138 * @rep:lifecycle active
139 * @rep:compatibility S
140 */
141 
142   FUNCTION get_combination_id(application_short_name    IN  VARCHAR2,
143                            key_flex_code        IN  VARCHAR2,
144                            structure_number     IN  NUMBER,
145                            validation_date      IN  DATE,
146                            n_segments           IN  NUMBER,
147                            segments             IN  SegmentArray,
148                            combination_id       OUT nocopy NUMBER,
149                            data_set             IN  NUMBER DEFAULT -1)
150              RETURN BOOLEAN;
151 
152 /*#
153 * Returns segment values for the given combination id in the key
154 * flexfield specified. Does not check value security rules.
155 * Returns TRUE if combination found and places displayed segment
156 * values in segments(1) through segments(n_segments) inclusive.
157 * Returns FALSE, sets n_segments = 0, and sets global error message
158 * using the FND_MESSAGE utility on error or if combination not found.
159 * If this function returns FALSE, use GET_MESSAGE to get the
160 * text of the error message in the language of the database, or
161 * GET_ENCODED_MESSAGE to get the error message in a language-
162 * independent encoded format.
163 * @param application_short_name Application Short Name
164 * @param key_flex_code Key Flexfield Code
165 * @param structure_number Structure number
166 * @param combination_id Code Combination Id
167 * @param n_segments Number of segments
168 * @param segments Segment array
169 * @param data_set Data set number
170 * @return Returns TRUE if combination is valid, FALSE otherwise.
171 * @rep:scope public
172 * @rep:displayname Get Segments
173 * @rep:lifecycle active
174 * @rep:compatibility S
175 */
176 
177   FUNCTION get_segments(application_short_name  IN  VARCHAR2,
178                         key_flex_code           IN  VARCHAR2,
179                         structure_number        IN  NUMBER,
180                         combination_id          IN  NUMBER,
181                         n_segments              OUT nocopy NUMBER,
182                         segments                OUT nocopy SegmentArray,
183                         data_set                IN  NUMBER  DEFAULT -1)
184                                                         RETURN BOOLEAN;
185 
186 /*#
187 * Gets combination id for the specified key flexfield segments.
188 * Identical to get_combination_id() except this function takes
189 * segment values in a string concatenated by the segment
190 * delimiter for this flexfield, and returns a positive combination
191 * id if valid or 0 on error. Validation date must be passed in
192 * as a character string using the DATE_FORMAT format defined in
193 * this package.
194 * If this function returns 0, use GET_MESSAGE to get the
195 * text of the error message in the language of the database, or
196 * GET_ENCODED_MESSAGE to get the error message in a language-
197 * independent encoded format.
198 * @param application_short_name Application Short Name
199 * @param key_flex_code Key Flexfield Code
200 * @param structure_number Structure number
201 * @param validation_date Validation date
202 * @param concatenated_segments Concatenated segments
203 * @return Returns a positive combination id if valid or 0 on error.
204 * @rep:scope public
205 * @rep:displayname Get Code Combination Id
206 * @rep:lifecycle active
207 * @rep:compatibility S
208 */
209 
210   FUNCTION get_ccid(application_short_name  IN  VARCHAR2,
211                     key_flex_code           IN  VARCHAR2,
212                     structure_number        IN  NUMBER,
213                     validation_date         IN  VARCHAR2,
214                     concatenated_segments   IN  VARCHAR2) RETURN NUMBER;
215 
216 /*#
217 * Gets concatenated segment values for the specified key flexfield
218 * combination id.
219 * Identical to get_segments() except returns the concatenated
220 * segment values as a string or NULL if invalid or on error.
221 * Note that this function is incapable of distinguishing a valid
222 * combination with a single null segment from an error.
223 * Caller must provide VARCHAR2(2000) storage for the returned string.
224 * If this function returns NULL, use GET_MESSAGE to get the
225 * text of the error message in the language of the database, or
226 * GET_ENCODED_MESSAGE to get the error message in a language-
227 * independent encoded format.
228 * Note: NULL does not necessarily mean an error occured. May be it is
229 * a single segment keyflexfield with NULL value.
230 * @param application_short_name Application Short Name
231 * @param key_flex_code Key Flexfield Code
232 * @param structure_number Structure number
233 * @param combination_id Code Combination Id
234 * @return Returns concatenated segment value or NULL if invalid or on error.
235 * @rep:scope public
236 * @rep:displayname Get Concatenated Segment
237 * @rep:lifecycle active
238 * @rep:compatibility S
239 */
240 
241   FUNCTION get_segs(application_short_name      IN  VARCHAR2,
242                     key_flex_code               IN  VARCHAR2,
243                     structure_number            IN  NUMBER,
244                     combination_id              IN  NUMBER) RETURN VARCHAR2;
245 
246 /*#
247 * Finds combination_id for given set of key flexfield segment values.
248 * Segment values must be input in segments(1) - segments(n_segments)
249 * in the order displayed. Must explicitly assign segments(n) := NULL
250 * if a segment is null or this will generate a "no data found" error.
251 * Creates a new combination if it is valid and the combination does not
252 * already exist, EVEN IF dynamic insert is not enabled. This is the only
253 * difference from the get_combination_id function.
254 * New valid combinations are committed within an autonomous transaction.
255 * Performs all checks on values including security and
256 * cross-validation. Value security rules will be checked for the
257 * current user identified in the FND_GLOBAL package. This will be
258 * set up automatically if the database session this package is called
259 * from underlies a concurrent program or a form.
260 * The validation date is used to determine if values have expired,
261 * and determines if cross-validation rules are still in effect.
262 * Generally pass in SYSDATE for validation date. If validation
263 * date is null, this function considers expired values valid
264 * and checks all cross-validation rules even if they are outdated.
265 * Returns TRUE if combination valid, or FALSE and sets error
266 * message using FND_MESSAGE utility on error or if invalid.
267 * If this function returns FALSE, use GET_MESSAGE to get the
268 * text of the error message in the language of the database, or
269 * GET_ENCODED_MESSAGE to get the error message in a language-
270 * independent encoded format.
271 * Combination_id output may be NULL if combination is invalid.
272 * @param application_short_name Application Short Name
273 * @param key_flex_code Key Flexfield Code
274 * @param structure_number Structure number
275 * @param validation_date Validation date
276 * @param n_segments Number of segments
277 * @param segments Segment array
278 * @param combination_id Code Combination Id
279 * @param data_set Data set number
280 * @return Returns TRUE if combination is valid, FALSE otherwise.
281 * @rep:scope public
282 * @rep:displayname Get Code Comb Id Allow Insert
283 * @rep:lifecycle active
284 * @rep:compatibility S
285 */
286 
287   FUNCTION get_comb_id_allow_insert(application_short_name    IN  VARCHAR2,
288                            key_flex_code        IN  VARCHAR2,
289                            structure_number     IN  NUMBER,
290                            validation_date      IN  DATE,
291                            n_segments           IN  NUMBER,
292                            segments             IN  SegmentArray,
293                            combination_id       OUT nocopy NUMBER,
294                            data_set             IN  NUMBER DEFAULT -1)
295              RETURN BOOLEAN;
299 /* ------------------------------------------------------------------------ */
296 
297 
298 
300 
301   PROCEDURE clear_ccid_cache;
302 
303 END fnd_flex_ext;