DBA Data[Home] [Help]

PACKAGE: APPS.AMS_ACTMETRIC_PUB

Source


1 PACKAGE AMS_ActMetric_PUB AS
2 /* $Header: amspamts.pls 120.1 2005/06/27 05:39:01 appldev ship $ */
3 /*#
4  * This package provides methods to create, update, or delete marketing
5  * activity metrics.
6  *
7  * Note: The activity metrics record type is used as an input parameter for
8  * create and update methods.
9  *
10  * PACKAGE AMS_ACTMETRIC_PVT
11  * TYPE act_metric_rec_type is RECORD (
12  *  activity_metric_id            NUMBER,
13  *  last_update_date              DATE,
14  *  last_updated_by               NUMBER,
15  *  creation_date                 DATE,
16  *  created_by                    NUMBER,
17  *  last_update_login             NUMBER,
18  *  object_version_number         NUMBER,
19  *  act_metric_used_by_id         NUMBER,
20  *  arc_act_metric_used_by        VARCHAR2(30),
21  *  purchase_req_raised_flag      VARCHAR2(1),
22  *  application_id                NUMBER,
23  *  sensitive_data_flag           VARCHAR2(1),
24  *  budget_id                     NUMBER,
25  *  metric_id                     NUMBER,
26  *  transaction_currency_code     VARCHAR2(15),
27  *  trans_forecasted_value        NUMBER,
28  *  trans_committed_value         NUMBER,
29  *  trans_actual_value            NUMBER,
30  *  functional_currency_code      VARCHAR2(15),
31  *  func_forecasted_value         NUMBER,
32  *  dirty_flag                    VARCHAR2(1),
33  *  func_committed_value          NUMBER,
34  *  func_actual_value             NUMBER,
35  *  last_calculated_date          DATE,
36  *  variable_value                NUMBER,
37  *  forecasted_variable_value     NUMBER,
38  *  computed_using_function_value NUMBER,
39  *  metric_uom_code               VARCHAR2(3),
40  *  org_id                        NUMBER,
41  *  difference_since_last_calc    NUMBER,
42  *  activity_metric_origin_id     NUMBER,
43  *  arc_activity_metric_origin    VARCHAR2(30),
44  *  days_since_last_refresh       NUMBER,
45  *  scenario_id                   NUMBER,
46  *  SUMMARIZE_TO_METRIC           NUMBER,
47  *  ROLLUP_TO_METRIC              NUMBER,
48  *  hierarchy_id                  NUMBER,
49  *  start_node                    NUMBER,
50  *  from_level                    NUMBER,
51  *  to_level                      NUMBER,
52  *  from_date                     DATE,
53  *  TO_DATE                       DATE,
54  *  amount1                       NUMBER,
55  *  amount2                       NUMBER,
56  *  amount3                       NUMBER,
57  *  percent1                      NUMBER,
58  *  percent2                      NUMBER,
59  *  percent3                      NUMBER,
60  *  published_flag                VARCHAR2(1),
61  *  pre_function_name             VARCHAR2(4000),
62  *  post_function_name            VARCHAR2(4000),
63  *  attribute_category            VARCHAR2(30),
64  *  attribute1                    VARCHAR2(150),
65  *  attribute2                    VARCHAR2(150),
66  *  attribute3                    VARCHAR2(150),
67  *  attribute4                    VARCHAR2(150),
68  *  attribute5                    VARCHAR2(150),
69  *  attribute6                    VARCHAR2(150),
70  *  attribute7                    VARCHAR2(150),
71  *  attribute8                    VARCHAR2(150),
72  *  attribute9                    VARCHAR2(150),
73  *  attribute10                   VARCHAR2(150),
74  *  attribute11                   VARCHAR2(150),
75  *  attribute12                   VARCHAR2(150),
76  *  attribute13                   VARCHAR2(150),
77  *  attribute14                   VARCHAR2(150),
78  *  attribute15                   VARCHAR2(150),
79  *  description                   VARCHAR2(4000),
80  *  act_metric_date               DATE,
81  *  depend_act_metric             NUMBER,
82  *  FUNCTION_USED_BY_ID           NUMBER,
83  *  ARC_FUNCTION_USED_BY          VARCHAR2(30),
84  *  hierarchy_type                VARCHAR2(30),
85  *  status_code                   VARCHAR2(30),
86  *  method_code                   VARCHAR2(30),
87  *  action_code                   VARCHAR2(30),
88  *  basis_year                    NUMBER,
89  *  ex_start_node                 VARCHAR2(1)
90  *   );
91  *
92  * @rep:scope public
93  * @rep:product AMS
94  * @rep:displayname Oracle Marketing Activity Metrics Public API
95  * @rep:lifecycle active
96  * @rep:compatibility S
97  * @rep:category BUSINESS_ENTITY AMS_CAMPAIGN
98  */
99 
100 ---------------------------------------------------------------------
101 -- PROCEDURE
102 --    Create_ActMetric
103 --
104 -- PURPOSE
105 --    Create a new Activity Metric.
106 --
107 -- PARAMETERS
108 --    p_act_metric_rec: the new record to be inserted
109 --    x_activity_metric_id: return the activity_metric_id of the
110 --                      new Activity Metrics
111 --
112 -- NOTES
113 --    1. object_version_number will be set to 1.
114 --    2. If Activity_Metric_id is passed in, the uniqueness will be checked.
115 --       Raise exception in case of duplicates.
116 --    3. If Activity_Metric_id is not passed in, generate a unique one from
117 --       the sequence.
118 --    4. If a flag column is passed in, check if it is 'Y' or 'N'.
119 --       Raise exception for invalid flag.
120 --    5. If a flag column is not passed in, default it to 'Y' or 'N'.
121 --    6. Please don't pass in any FND_API.g_mess_char/num/date.
122 ---------------------------------------------------------------------
123 /*#
124  * This procedure creates a marketing activity metric.  Details of the
125  * activity metric are passed as p_act_metric_rec record type.  Check
126  * the x_return_status output to see if the creation was successful.  If
127  * successful, a unique identifier for the activity metric will be passed
128  * back to the x_activity_metric_id output parameter.
129  * @param p_api_version   This must match the version number of the API.  An
130  *                        unexpected error is returned if the calling program
131  *                        version number is incompatible with the current API
132  *                        version number.
133  * @param p_init_msg_list Flag to indicate if the message stack should be
134  *                        initialized.
135  * @param p_commit        Flag to indicate if changes should be commited on
136  *                        success.
137  * @param p_validation_level Level of validation required.  None: No
138  *                        validation will be performed.  Full: Item and record
139  *                        level validation will be performed.
140  * @param x_return_status Indicates the return status of the API.  The values
141  *                        are one of the following: FND_API.G_RET_SUCCESS:
142  *                        Indicates the API call was successful,
143  *                        FND_API.G_RET_ERROR: indicates an error has occured,
144  *                        FND_API.G_RET_UNEXPECTED: indicates an unexpected
145  *                        error has occurred.
146  * @param x_msg_count     Count of the number of error messages in the list.
147  * @param x_msg_data      Error messages returned by the API.  If more than
148  *                        one message is returned, this parameter is null and
149  *                        messages can be extracted from the message stack.
150  * @param p_act_metric_rec Record of type AMS_ACTMETRIC_PVT.ACT_METRIC_REC_TYPE
151  *                        that takes the details for the Activity Metric.
152  * @param x_activity_metric_id Unique identifier for the newly created
153  *                        Activity Metric.
154  * @rep:scope public
155  * @rep:lifecycle active
156  * @rep:displayname Create Activity Metric
157  */
158 PROCEDURE Create_ActMetric(
159    p_api_version             IN  NUMBER,
160    p_init_msg_list           IN  VARCHAR2  := FND_API.g_false,
161    p_commit                  IN  VARCHAR2  := FND_API.g_false,
162    p_validation_level        IN  NUMBER    := FND_API.g_valid_level_full,
163 
164    x_return_status           OUT NOCOPY VARCHAR2,
165    x_msg_count               OUT NOCOPY NUMBER,
166    x_msg_data                OUT NOCOPY VARCHAR2,
167 
168    p_act_metric_rec        IN  AMS_ActMetric_PVT.act_metric_rec_type,
169    x_activity_metric_id    OUT NOCOPY NUMBER
170 );
171 
172 
173 --------------------------------------------------------------------
174 -- PROCEDURE
175 --    Delete_ActMetric
176 --
177 -- PURPOSE
178 --    Delete a ActMetric.
179 --
180 -- PARAMETERS
181 --    p_acticity_metric_id: the Activity_Metric_id
182 --    p_object_version: the object_version_number
183 --
184 -- NOTES
185 --    1. Raise exception if the object_version_number doesn't match.
186 --------------------------------------------------------------------
187 /*#
188  * This procedure deletes a marketing activity metric.  The activity metric
189  * is identified by the parameter p_activity_metric_id.  The object version
190  * number must match the current value within the database for this activity
191  * metric or an error is returned.  Check the x_return_status output to see
192  * if the deletion was successful.
193  * @param p_api_version   This must match the version number of the API.  An
194  *                        unexpected error is returned if the calling program
195  *                        version number is incompatible with the current API
196  *                        version number.
197  * @param p_init_msg_list Flag to indicate if the message stack should be
198  *                        initialized.
199  * @param p_commit        Flag to indicate if changes should be commited on
200  *                        success.
201  * @param x_return_status Indicates the return status of the API.  The values
202  *                        are one of the following: FND_API.G_RET_SUCCESS:
203  *                        Indicates the API call was successful,
204  *                        FND_API.G_RET_ERROR: indicates an error has occured,
205  *                        FND_API.G_RET_UNEXPECTED: indicates an unexpected
206  *                        error has occurred.
207  * @param x_msg_count     Count of the number of error messages in the list.
208  * @param x_msg_data      Error messages returned by the API.  If more than
209  *                        one message is returned, this parameter is null and
210  *                        messages can be extracted from the message stack.
211  * @param p_activity_metric_id Unique id of activity metric to delete.
212  * @param p_object_version Current object version number.
213  * @rep:scope public
214  * @rep:lifecycle active
215  * @rep:displayname Delete Activity Metric
216  */
217 PROCEDURE Delete_ActMetric(
218    p_api_version             IN  NUMBER,
219    p_init_msg_list           IN  VARCHAR2 := FND_API.g_false,
220    p_commit                  IN  VARCHAR2 := FND_API.g_false,
221 
222    x_return_status           OUT NOCOPY VARCHAR2,
223    x_msg_count               OUT NOCOPY NUMBER,
224    x_msg_data                OUT NOCOPY VARCHAR2,
225 
226    p_activity_metric_id    IN  NUMBER,
227    p_object_version        IN  NUMBER
228 );
229 
230 
231 -------------------------------------------------------------------
232 -- PROCEDURE
233 --    Lock_ActMetric
234 --
235 -- PURPOSE
236 --    Lock a Activity Metric.
237 --
238 -- PARAMETERS
239 --    p_activity_Metric_id: the Activity_Metric_id
240 --    p_object_version: the object_version_number
241 --
242 -- NOTES
243 --    1. Raise exception if the object_version_number doesn't match.
244 --------------------------------------------------------------------
245 PROCEDURE Lock_ActMetric(
246    p_api_version           IN  NUMBER,
247    p_init_msg_list         IN  VARCHAR2 := FND_API.g_false,
248 
249    x_return_status         OUT NOCOPY VARCHAR2,
250    x_msg_count             OUT NOCOPY NUMBER,
251    x_msg_data              OUT NOCOPY VARCHAR2,
252 
253    p_activity_metric_id  IN  NUMBER,
254    p_object_version        IN  NUMBER
255 );
256 
257 
258 ---------------------------------------------------------------------
259 -- PROCEDURE
260 --    update_ActMetric
261 --
262 -- PURPOSE
263 --    Update a Activity Metric.
264 --
265 -- PARAMETERS
266 --    p_ActMetric_rec: the record with new items
267 --
268 -- NOTES
269 --    1. Raise exception if the object_version_number doesn't match.
273 /*#
270 --    2. If an attribute is passed in as FND_API.g_miss_char/num/date,
271 --       that column won't be updated.
272 ----------------------------------------------------------------------
274  * This procedure updates a marketing activity metric.  Details of the
275  * activity metric are passed as p_act_metric_rec record type.  Check
276  * the x_return_status output to see if the update was successful.  The record
277  * requires the Activity_metric_id and the current object_version_number
278  * to be filled in.  Other fields are optional, but must be set to
279  * FND_API.G_MISS_... if they are not to be changed.
280  * @param p_api_version   This must match the version number of the API.  An
281  *                        unexpected error is returned if the calling program
282  *                        version number is incompatible with the current API
283  *                        version number.
284  * @param p_init_msg_list Flag to indicate if the message stack should be
285  *                        initialized.
286  * @param p_commit        Flag to indicate if changes should be commited on
287  *                        success.
288  * @param p_validation_level Level of validation required.  None: No validation
289  *                        will be performed.  Full: Item and record level
290  *                        validation will be performed.
291  * @param x_return_status Indicates the return status of the API.  The values
292  *                        are one of the following: FND_API.G_RET_SUCCESS:
293  *                        Indicates the API call was successful,
294  *                        FND_API.G_RET_ERROR: indicates an error has occured,
295  *                        FND_API.G_RET_UNEXPECTED: indicates an unexpected
296  *                        error has occurred.
297  * @param x_msg_count     Count of the number of error messages in the list.
298  * @param x_msg_data      Error messages returned by the API.  If more than one
299  *                        message is returned, this parameter is null and
300  *                        messages can be extracted from the message stack.
301  * @param p_act_metric_rec Record of type AMS_ACTMETRIC_PVT.ACT_METRIC_REC_TYPE
302  *                        that takes the details for the Activity Metric.
303  * @rep:scope public
304  * @rep:lifecycle active
305  * @rep:displayname Update Activity Metric
306  */
307 PROCEDURE Update_ActMetric(
308    p_api_version       IN  NUMBER,
309    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
310    p_commit            IN  VARCHAR2  := FND_API.g_false,
311    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
312 
313    x_return_status     OUT NOCOPY VARCHAR2,
314    x_msg_count         OUT NOCOPY NUMBER,
315    x_msg_data          OUT NOCOPY VARCHAR2,
316 
317    p_act_metric_rec    IN  AMS_ActMetric_PVT.act_metric_rec_type
318 );
319 
320 
321 ---------------------------------------------------------------------
322 -- PROCEDURE
323 --    Validate_ActMetric
324 --
325 -- PURPOSE
326 --    Validate a Activity Metric record.
327 --
328 -- PARAMETERS
329 --    p_act_metric_rec: the Activity Metric record to be validated
330 --
331 -- NOTES
332 --    1. p_act_metric_rec should be the complete metric record. There
333 --       should not be any FND_API.g_miss_char/num/date in it.
334 ----------------------------------------------------------------------
335 PROCEDURE Validate_ActMetric(
336    p_api_version       IN  NUMBER,
337    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
338    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
339 
340    x_return_status     OUT NOCOPY VARCHAR2,
341    x_msg_count         OUT NOCOPY NUMBER,
342    x_msg_data          OUT NOCOPY VARCHAR2,
343 
344    p_act_metric_rec    IN  AMS_ActMetric_PVT.act_metric_rec_type
345 );
346 
347 ---------------------------------------------------------------------
348 -- PROCEDURE
349 --    Invalidate_Rollup
350 --
351 -- PURPOSE
352 --    Invalidate to rollup pointers.
353 --
354 -- PARAMETERS
355 --    p_act_metric_rec: the Activity Metric record to be validated
356 --
357 -- NOTES
358 --    1. p_act_metric_rec should be the complete metric record. There
359 --       should not be any FND_API.g_miss_char/num/date in it.
360 ----------------------------------------------------------------------
361 PROCEDURE Invalidate_Rollup(
362    p_api_version       IN  NUMBER,
363    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
364    p_commit            IN  VARCHAR2  := FND_API.g_false,
365 
366    x_return_status     OUT NOCOPY VARCHAR2,
367    x_msg_count         OUT NOCOPY NUMBER,
368    x_msg_data          OUT NOCOPY VARCHAR2,
369 
370    p_used_by_type      IN VARCHAR2,
371    p_used_by_id        IN NUMBER
372 );
373 
374 
375 END AMS_ActMetric_PUB;