1 PACKAGE Pa_Rbs_Pub AUTHID CURRENT_USER AS
2 /* $Header: PARBSAPS.pls 120.3 2006/07/24 11:50:47 dthakker noship $*/
3 /*#
4 * This package contains the public APIs for resource breakdown structure information.
5 * @rep:scope public
6 * @rep:product PA
7 * @rep:lifecycle active
8 * @rep:displayname Resource Breakdown Structure API
9 * @rep:compatibility S
10 * @rep:category BUSINESS_ENTITY PA_RES_BRK_DWN_STRUCT
11 * @rep:doccd 120pjapi.pdf See the Oracle Projects API's, Client Extensions, and Open Interfaces Reference
12 */
13 /*
14 * *********************************************************************
15 * Package Name: Pa_Rbs_Pub
16 * Description:
17 * --This AMG package has 2 ways that it can be used depending on
18 * customer needs and/or limitations of third party software:
19 *
20 * 1) Directly calling the Create_Rbs() and Update_Rbs() apis
21 * passing it pl/sql records and tables and receiving back
22 * the rbs_header_id, rbs_version_id, and rbs_element_id's via
23 * pl/sql table.
24 *
25 * 2) Calling the Following sequence of apis:
26 * To add new Rbs:
27 * i) Init_Rbs_Processing() - required
28 * ii) Load_Rbs_Header() - required
29 * iii) Load_Rbs_Version() - optional
30 * iv) Load_Rbs_Elements() - optional
31 * v Exec_Create_Rbs() - required
32 * vi) Fetch_Rbs_Header() - optional
33 * vii) Fetch_Rbs_Version() - optional
34 * viii) Fetch_Rbs_Elements() - optional
35 * To Update the current Rbs:
36 * i) Init_Rbs_Processing() - required
37 * ii) Load_Rbs_Header() - optional
38 * iii) Load_Rbs_Version() - optional
39 * iv) Load_Rbs_Elements() - optional
40 * v Exec_Update_Rbs() - required
41 * vi) Fetch_Rbs_Header() - optional
42 * vii) Fetch_Rbs_Version() - optional
43 * viii) Fetch_Rbs_Elements() - optional
44 *
45 * On any error or failed validation the processing will stop and
46 * all insertion, updates, deletions will be undone and will not
47 * be saved.
48 * This package does not offer the ability to delete an RBS header
49 * or version record. If does not offer the ability to delete an
50 * entire RBS. To *ove the RBS from use within Projects,change the
51 * end date of the RBS Header to the data desired.
52 * ********************************************************************
53 */
54
55 /* Package constant used for package version validation */
56 G_Api_Version_Number CONSTANT NUMBER := 1;
57 G_Pkg_Name CONSTANT VARCHAR2(30) := 'PA_RBS_PUB';
58
59
60
61 /*
62 * *******************************************************************
63 * Rbs_Header_Rec_Typ
64 * Description :
65 * This is the resource breakdown strucure's header record structure. You need to
66 * pass the resource breakdown structure's header record whenever you are creating
67 * a new resource breakdown structure's header, or when you are updating an existing
68 * resource breakdown structure's header. The attributes which are defaulted need
69 * to be passed if required to be modified.
70 * Attributes:
71 * Rbs_Header_Id : The resource breakdown structure's header identifier.Need to be passed
72 * only while updating the resource breakdown structure's header.
73 * Name : The resource breakdown structure's name .Can be up to 240 characters long
74 * Description : Description of the resource breakdown structure.
75 * Effective_From_Date : The date from which the resource breakdown structure can be used.
76 * RBS with effective from date before the system date are eligible to
77 * be assigned to project. Effective From date cannot be null.
78 * Effective_To_Date : The date till which the resource breakdown structure can be used.
79 * RBS with effective to date on or after the system date are eligible to
80 * be assigned to project. Null effective from date is replaced with sysdate
81 * when checking to see if the RBS is eligible to be assigned to a project.
82 * Record_Version_Number : Record Version Number of the resource breakdown structure's header record
83 from the view PA_RBS_HEADERS_AMG_V
84 * ***************************************************************
85 */
86
87 TYPE Rbs_Header_Rec_Typ Is Record (
88 Rbs_Header_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
89 Name Varchar2(240) Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
90 Description Varchar2(2000) Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
91 Effective_From_Date Date Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE,
92 Effective_To_Date Date Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE,
93 Record_Version_Number Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM);
94
95 /*
96 * *******************************************************************
97 * Rbs_Header_Rec_Out_Typ
98 * Description :
99 * This is the resource breakdown strucure's header record structure which stores the output values of
100 * the newly created header identifier.
101 * Attributes:
102 * Rbs_Header_Id : The resource breakdown structure's header identifier.
103 *
104 * ***************************************************************
105 */
106 TYPE Rbs_Header_Rec_Out_Typ Is Record (
107 Rbs_Header_Id Number
108 );
109
110 /*
111 * *******************************************************************
112 * Rbs_Version_Rec_Typ
113 * Description :
114 * This is the resource breakdown strucure's version record structure.
115 *
116 * When creating an RBS, you need to pass the version record only if you want any specific
117 * version attributes. Else, the system will create a working version whenever you are
118 * creating an RBS header.
119 *
120 * When updating an RBS, you need to pass the version record only if you
121 * want to update the version attributes - such as version name or job group. If you are
122 * not updating any version attributes, you do not need to pass this record.
123 * The only version you can update is the current working version. The
124 * version attributes can be read from the view PA_RBS_VERSIONS_AMG_V.
125 * Attributes:
126 * Rbs_Version_Id : The resource breakdown structure's version identifier.Need to be passed
127 * only while updating the version of resource breakdown structure.
128 * Name : The resource breakdown structure's version's name .
129 * Description : Description of the resource breakdown structure's version.
130 * Version_Start_Date : The date from which the resource breakdown structure's version
131 * becomes effective. The date is used when deciding whether all the
132 * project transactions should be mapped to the version. If the date
133 * is before the sysdate, transactions will be mapped to this version.
134 *
135 * Job_Group_Id : Job Group Identifier of the job group for the RBS version. Jobs from this
136 * job group are eligible to be elements of the RBS hierarchy. You can select
137 * the job group from the view PA_JOB_GROUPS_VIEW .
138 *
139 * Record_Version_Number : The record version number of the rbs version record from the view
140 * PA_RBS_VERSIONS_AMG_V.
141 * ***************************************************************
142 */
143 TYPE Rbs_Version_Rec_Typ Is Record (
144 Rbs_Version_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
145 Name Varchar2(240) Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
146 Description Varchar2(2000) Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
147 Version_Start_Date Date Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE,
148 Job_Group_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
149 Record_Version_Number Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM);
150
151
152
153 /*
154 * *******************************************************************
155 * Rbs_Version_Rec_Out_Typ
156 * Description :
157 * This is the resource breakdown strucure's version record structure which stores the output values of
158 * the newly created version of the resource breakdown structure.
159 * Attributes:
160 * Rbs_Version_Id : The resource breakdown structure's version identifier for the newly created version.
161 *
162 * ***************************************************************
163 */
164 TYPE Rbs_Version_Rec_Out_Typ Is Record (
165 Rbs_Version_Id Number
166 );
167
168
169
170
171
172
173 /*
174 * *******************************************************************
175 * Rbs_Elements_Rec_Typ
176 * Description :
177 * This is the resource breakdown strucure's element's record structure. You need to
178 * pass the resource breakdown structure's element record whenever you are creating
179 * a new element for a resource breakdown structure, or when you are updating an existing
180 * element of a resource breakdown structure. The attributes which are defaulted don't need
181 * to be passed in unless they are modified and need to be updated.
182 * Attributes:
183 * Rbs_Version_Id : The resource breakdown structure's version identifier.
184 * The element belongs to this version.
185 * Rbs_Element_Id : The resource breakdown structure's element's identifier.
186 * This is a required field in the update mode.
187 * Parent_Element_Id : The element identifier of the parent of the current element.
188 * Resource_Type_Id : The resource type identifier of the element. You can get the value from
189 * view PA_RES_TYPES_AMG_V.
190 * Resource_Source_Id : The identifier of the resource that makes up the element of the RBS.
191 * If the element is a rule, then pass -1 as the resource_source_id
192 * If the element is an instance, pass the identifier for the resource, if
193 * the resource has an identifier. Following are the resource types for which
194 * Identifiers exists:
195 * BOM_LABOR: Get the BOM Labor ID from PA_BOM_LABOR_RES_V
196 * BOM_EQUIPMENT: Get the BOM Equipment ID from PA_BOM_EQUIPMENT_RES_V
197 * NAMED_PERSON: Get the person's ID from PA_EMPLOYEES_RES_V
198 * EVENT_TYPE: Get the event id from PA_EVENT_TYPES_RES_V
199 * EXPENDITURE_CATEGORY:
200 * Get the expenditure_type_id from PA_EXPEND_CATEGORIES_RES_V
201 * EXPENDITURE_TYPE:
202 * Get the EXPENDITURE_TYPE_ID from PA_EXPENDITURE_TYPES_RES_V
203 * ITEM_CATEGORY:
204 * Get the ITEM_CATEGORY_ID from PA_ITEM_CATEGORY_RES_V
205 * INVENTORY_ITEM: Get the ITEM_ID from PA_ITEMS_RES_V
206 * JOB: Get the JOB_ID from PA_JOBS_RES_V
207 * ORGANIZATION: Get the organization_Id from PA_ORGANIZATIONS_RES_V
208 * NON_LABOR_RESOURCE:
209 * Get the non-labor resource_id from PA_NON_LABOR_RESOURCES_RES_V
210 * RESOURCE_CLASS: Get the resource_class_Id from PA_RESOURCE_CLASS_RES_V
211 * ROLE: Get the project_role_id from PA_PROJECT_ROLES_RES_V
212 * SUPPLIER: Get vendor_id from PA_VENDORS_RES_V
213 * Resource_Source_Code : The resource breakdown structure's element's source code.
214 * This would have value if the element's resource type is
215 * associated to the resource type code of REVENUE_CATEGORY
216 * or USER_DEFINED.
217 *
218 * Order_Number : The order in which the elements should be displayed on a given
219 * level of the resource breakdown structure in project reporting .
220 *
221 * Process_Type : The type of processing required for the resource breakdown structure's
222 * element.
223 * Must contain a value of 'A' or 'U' or 'D'.
224 * Value Meaning
225 * ------- -------
226 * A Add element
227 * U Update element
228 * D Delete element and its children if the element exists.
229 * Rbs_Level : To be passed if creating the element. This is the level at which the element
230 * should be placed in the resource breakdown structure.
231 * The level can have a value between 1 and 10. 1 is reserved for the
232 * root element which will be ignored during processing.
233 *
234 * Record_Version_Number : Record version number of the resource breakdown structure's element. To
235 * be passed when updating or deleting the element.
236 * You can get the valie from the view. PA_RBS_ELEMENTS_AMG_V
237 *
238 * Rbs_Ref_Element_Id : To be passed when creating an element. Each Element must have
239 * Rbs_Ref_Element_Id . This is the identifier you are using to distinguish
240 * each element.
241 * processed at each rbs level
242 *
243 * Parent_Ref_Element_Id : During creation, each element must have a
244 * Parent_Ref_Element_Id which indicates the parent of the element.
245 * This Identier is the Rbs_Ref_Element_Id of the parent.
246 * If the rbs_level is 1 or 2 then it does not need to be
247 * populated. Rbs_level 1 element need no parent and
248 * rbs_level 2 elements parent is update by the system from the
249 * root element's Id.
250 * ***************************************************************
251 */
252 TYPE Rbs_Elements_Rec_Typ IS RECORD (
253 Rbs_Version_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
254 Rbs_Element_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
255 Parent_Element_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
256 Resource_Type_Id Number,
257 Resource_Source_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
261 Rbs_Level Number,
258 Resource_Source_Code Varchar2(240) Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
259 Order_Number Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
260 Process_Type Varchar2(1),
262 Record_Version_Number Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
263 Parent_Ref_Element_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
264 Rbs_Ref_Element_Id Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM);
265
266 TYPE Rbs_Elements_Tbl_Typ IS TABLE OF Rbs_Elements_Rec_Typ
267 INDEX BY BINARY_INTEGER;
268
269
270 /*
271 * *********************************************************************
272 * Rbs_Elements_Rec_Out_Typ
273 * Description :
274 * This is the resource breakdown strucure's element's record structure which stores the output values of
275 * the newly created element of the resource breakdown structure.
276 * Attributes:
277 * Rbs_Element_Id : The resource breakdown structure's element identifier for the newly created element.
278
279 * **********************************************************************
280 */
281 TYPE Rbs_Elements_Rec_Out_Typ Is Record (
282 Rbs_Element_Id Number
283 );
284
285 TYPE Rbs_Elements_Tbl_Out_Typ Is Table Of Rbs_Elements_Rec_Out_Typ
286 INDEX BY BINARY_INTEGER;
287
288 -- Header global pl/sql records
289 G_Rbs_Hdr_Rec Rbs_Header_Rec_Typ;
290 G_Empty_Rbs_Hdr_Rec Rbs_Header_Rec_Typ;
291 G_Rbs_Hdr_Out_Rec Rbs_Header_Rec_Out_Typ;
292 G_Empty_Rbs_Hdr_Out_Rec Rbs_Header_Rec_Out_Typ;
293
294 -- Version global pl/sql records
295 G_Rbs_Ver_Rec Rbs_Version_Rec_Typ;
296 G_Empty_Rbs_Ver_Rec Rbs_Version_Rec_Typ;
297 G_Rbs_Ver_Out_Rec Rbs_Version_Rec_Out_Typ;
298 G_Empty_Rbs_Ver_Out_Rec Rbs_Version_Rec_Out_Typ;
299
300 -- Elements global pl/sql tablex
301 G_Rbs_Elements_Tbl Rbs_Elements_Tbl_Typ;
302 G_Empty_Rbs_Elements_Tbl Rbs_Elements_Tbl_Typ;
303 G_Rbs_Elements_Count Number := 0;
304 G_Rbs_Elements_Out_Tbl Rbs_Elements_Tbl_Out_Typ;
305
306
307 /*
308 * ***********************************************************************
309 * API Name : Init_Rbs_Processing
310 * Public/Private : Public
311 * Procedure/Function: Procedure
312 * Description : This procedure initialize global pl/sql records and tables and
313 * other variables.It is used solely in conjunction with option 2
314 * identified in the package description on how to use this package.
315 *
316 * ************************************************************************
317 */
318 /*#
319 * This API procedure is used to initialize the resource breakdown structure global tables prior to
320 * the Load-Execute-Fetch cycle.
321 * @rep:scope public
322 * @rep:lifecycle active
323 * @rep:displayname Initialize Resource Breakdown Structure
324 * @rep:compatibility S
325 */
326 Procedure Init_Rbs_Processing;
327
328
329
330
331
332
333
334 /*
335 * **************************************************************************
336 * API Name : Create_Rbs()
337 * Public/Private : Public
338 * Procedure/Function : Procedure
339 * Description : This API will create a Resource Breakdown Structure.
340 * At a minimum this API will create the header and a working version
341 * for the Resource Breakdown Structure.
342 * The API can also create the entire hierarchy, if the elements of the
343 * hierarchy are passed.
344 * The root element of the hierarchy for a version, if the version itself.
345 * This is not an updatable element.
346 * If you provide a root element it will be ignored here.
347 *
348 * Attributes:
349 * INPUT Values:
350 * P_Commit : This parameter is optional, by default no commit will take place.
351 * P_Init_Msg_List : This parameter is optional, by default the error msg stack
352 * is not initialized.
353 * P_API_Version_Number : This parameter is required.It is the API version number.
354 * P_Header_Rec : This parameter is required, See the package specification for
355 * record structure details.This will hold the values for the RBS header.
356 * P_Version_Rec : This parameter is optional, if not populated then the version
357 * record will use the (P_Header_Rec) header record parameter
358 * to create the version record. See the package
359 * specification for record structure for details.
360 * P_Elements_Tbl : Pass this table, if you want to create elements in the RBS.
361 * This holds the actual RBS structure; See the package
362 * specifications for table record structure for details.
363 * If this table is populated then it is required to have the root
364 * element data included in one of the records.
365 * OUTPUT Values:
366 * X_Rbs_Header_Id : The Resource breakdown structure's header identifier .
370 * would be empty. If P_Elements_Tbl
367 * X_Rbs_Version_Id : The Resource breakdown structure's version identifier.
368 * X_Elements_Tbl : This element will only be populated if the input parameter
369 * P_Elements_Tbl has records in it, otherwise this element
371 * is populated then the only difference X_Elements_Tbl
372 * will have with P_Elements_Tbl is that the Rbs_Elements_Id
373 * and Parent_Element_Id will be populated.
374 * X_Return_Status : Return Status of the API. The API will error out even if one of the
375 * elements errors out.
376 * It will return "S" if the API call was successfull.
377 * It will return a value of 'E' when the API fails
378 * due to a validation error.
379 * It will return a value of 'U' when the API hits
380 * and unexpected error(Some ORA or such error).
381 * The API will error out if even one of the
382 * elements in the hierarchy errors out.
383 * X_Msg_Count : Depending on the P_Init_Msg_List parameter value
384 * this paramenter may have a value of 1 or higher
385 * X_Error_Msg_Data : The parameter will hold a message if there is an
386 * error in this API.
387 *
388 * Considerations:
389 * : If the P_Version_Rec parameter is not populated then the API
390 * will use the data stored in the P_Header_Rec parameter to
391 * create the version record.
392 * : Even if no records exist in the the P_Elements_Tbl parameter a root
393 * node/element will always be created for the RBS.
394 * : When populating the P_Header_Rec parameter the rbs_header_id,
395 * description, effective_to_date, record_version_number are not
396 * required.
397 * : When populating the P_Version_Rec parameter the version_start_date
398 * must be greater or equal to the Effective_From_Date
399 * of the header record.
400 * : When populating the P_Elements_Tbl parameter, for each record added
401 * the rbs_level, process_type, parent_ref_element_id, rbs_ref_element_id
402 * must be populated. And either the Resource_Source_Id or the
403 * Resource_Source_Code must be populated.
404 * ***************************************************************************
405 */
406 /*#
407 * This API is used to create a resource breakdown structure (RBS), which is composed of the RBS header,
408 * the RBS version, and its elements of the hierarchy.
409 * @param p_commit API standard (default = F): indicates if the transaction will be committed
410 * @param p_init_msg_list API standard (default = F): indicates if message stack will be initialized
411 * @param p_api_version_number API standard: version number
412 * @rep:paraminfo {@rep:required}
413 * @param p_header_rec Input record of RBS header information
414 * @rep:paraminfo {@rep:required}
415 * @param p_version_rec Input record of RBS version information
416 * @param p_elements_tbl Input record of RBS version elements
417 * @param x_rbs_header_id Identifier of the RBS header
418 * @rep:paraminfo {@rep:required}
419 * @param x_rbs_version_id Identifier of the RBS version
420 * @rep:paraminfo {@rep:required}
421 * @param x_elements_tbl Table of RBS element identifiers
422 * @rep:paraminfo {@rep:required}
423 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
424 * @rep:paraminfo {@rep:precision 1} {@rep:required}
425 * @param x_msg_count API standard: number of error messages
426 * @rep:paraminfo {@rep:required}
427 * @param x_error_msg_data API standard: error message
428 * @rep:paraminfo {@rep:precision 2000} {@rep:required}
429 * @rep:scope public
430 * @rep:lifecycle active
431 * @rep:displayname Create Resource Breakdown Structure
432 * @rep:compatibility S
433 */
434 Procedure Create_Rbs(
435 P_Commit IN Varchar2 Default Fnd_Api.G_False,
436 P_Init_Msg_List IN Varchar2 Default Fnd_Api.G_True,
437 P_API_Version_Number IN Number,
438 P_Header_Rec IN Pa_Rbs_Pub.Rbs_Header_Rec_Typ,
439 P_Version_Rec IN Pa_Rbs_Pub.Rbs_Version_Rec_Typ Default G_Empty_Rbs_Ver_Rec,
440 P_Elements_Tbl IN Rbs_Elements_Tbl_Typ Default G_Empty_Rbs_Elements_Tbl,
441 X_Rbs_Header_Id OUT NOCOPY Number,
442 X_Rbs_Version_Id OUT NOCOPY Number,
443 X_Elements_Tbl OUT NOCOPY Rbs_Elements_Tbl_Typ,
444 X_Return_Status OUT NOCOPY Varchar2,
445 X_Msg_Count OUT NOCOPY Number,
446 X_Error_Msg_Data OUT NOCOPY Varchar2);
447
448
449 /*
450 * ****************************************************************************
451 * API Name : Update_Rbs()
452 * Public/Private : Public
453 * Procedure/Function : Procedure
454 * Description : This API can be used to update the RBS header, RBS Version, or the
458 * If this API is called for a non-existant RBS then the API will error
455 * RBS Element/Node records or a combination of them.
456 * If P_Header_Rec, P_Version_Rec, and P_Elements_Tbl are null then
457 * nothing will be updated.
459 * out with a No Data Found error.
460 *
461 * If the P_Elements_Tbl is populated then the data will be processed in
462 * the following order:
463 * Process_Type: 'D','U','A'.
464 * Example:
465 * You want to update the description in the header record.
466 * You must provide the rbs_header_id, record_version_number,
467 * and new value for description.
468 *
469 * Attributes :
470 * INPUT VALUES :
471 * P_Commit : This parameter is optional, by default no commit will take place
472 * P_Init_Msg_List : This parameter is optional, by default the error msg stack
473 * is not initialized.
474 * P_API_Version_Number : required
475 * P_Header_Rec : This parameter is optional,
476 * See the package specification for record structure details.
477 * P_Version_Rec : This parameter is optional,
478 * See the package specification for record structure details.
479 * P_Elements_Tbl : This parameter is optional, this holds the actual RBS structure .
480 * See the package specifications for table record structure for details.
481 *
482 * OUTPUT VALUES :
483 * X_Elements_Tbl : This element will only be populated if the
484 * input parameter P_Elements_Tbl has records in it,
485 * otherwise it will be empty.If P_Elements_Tbl
486 * is populated then the only difference
487 * X_Elements_Tbl will have with
488 * P_Elements_Tbl is that the Rbs_Elements_Id
489 * and Parent_Element_Id will be populated where
490 * the process_type = 'A'.
491 * X_Return_Status : Will return a value of 'S' when the API is
492 * succesful in updating the RBS.
493 * Will return a value of 'E' when the API fails
494 * due to a validation error.
495 * Will return a value of 'U' when the API hits
496 * and unexpected error(Some ORA or such error).
497 * X_Msg_Count : Depending on the P_Init_Msg_List parameter value
498 * this parameter may have a value of 1 or higher.
499 * X_Error_Msg_Data : This paramter will hold a message if there is an
500 * error in this API.
501 *
502 * Considerations:
503 * : If the P_Header_Rec parameter is not populated then the API
504 * will not update the header record.
505 * : If the P_Version_Rec parameter is not populated then the API
506 * will not update the version record.
507 * : If the P_Elements_Tbl parameter is not populated then the API
508 * will not update/delete/add node/element records to the RBS.
509 * : The API will not allow to add a root node/element record with your own values.
510 * This is done automatically with preset values being system generated.
511 * : The API will not allow to update or delete the root node/element record because
512 * it is system generated.
513 *
514 * *****************************************************************************
515 */
516 /*#
517 * This API is used to update the resource breakdown structure header and version and delete, update, or
518 * add records to element records.
519 * @param p_commit API standard (default = F): indicates if the transaction will be committed
520 * @param p_init_msg_list API standard (default = F): indicates if message stack will be initialized
521 * @param p_api_version_number API standard: version number
522 * @rep:paraminfo {@rep:required}
523 * @param p_header_rec Input record of RBS header information
524 * @rep:paraminfo {@rep:required}
525 * @param p_version_rec Input record of RBS version information
526 * @rep:paraminfo {@rep:required}
527 * @param p_elements_tbl Input record of RBS version elements
528 * @rep:paraminfo {@rep:required}
529 * @param x_elements_tbl Table of RBS element identifiers
530 * @rep:paraminfo {@rep:required}
531 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
532 * @rep:paraminfo {@rep:precision 1} {@rep:required}
533 * @param x_msg_count API standard: number of error messages
534 * @rep:paraminfo {@rep:required}
535 * @param x_error_msg_data API standard: error message
536 * @rep:paraminfo {@rep:precision 2000} {@rep:required}
537 * @rep:scope public
538 * @rep:lifecycle active
539 * @rep:displayname Update Resource Breakdown Structure
540 * @rep:compatibility S
541 */
542 Procedure Update_Rbs(
543 P_Commit IN Varchar2 Default Fnd_Api.G_False,
544 P_Init_Msg_List IN Varchar2 Default Fnd_Api.G_True,
545 P_API_Version_Number IN Number,
546 P_Header_Rec IN Pa_Rbs_Pub.Rbs_Header_Rec_Typ,
547 P_Version_Rec IN Pa_Rbs_Pub.Rbs_Version_Rec_Typ,
548 P_Elements_Tbl IN Rbs_Elements_Tbl_Typ,
552 X_Error_Msg_Data OUT NOCOPY Varchar2);
549 X_Elements_Tbl OUT NOCOPY Rbs_Elements_Tbl_Typ,
550 X_Return_Status OUT NOCOPY Varchar2,
551 X_Msg_Count OUT NOCOPY Number,
553
554
555
556
557
558
559
560
561
562 /*
563 * ***********************************************************************************
564 * API Name : Load_Rbs_Header
565 * Public/Private : Public
566 * Procedure/Function: Procedure
567 * Description : This API allows the user to load the RBS header record data.
568 * This has to be executed to create a new RBS.
569 * If used for Creating an RBS then the following parameter must be
570 * populated. p_api_version_number, p_name and p_effective_start_datr .
571 *
572 *
573 *
574 *
575 * Attributes :
576 * INPUT VALUES:
577 * P_Api_Version_Number : The Api version number.This is a mandatory parameter.
578 * P_Rbs_Header_Id : The identifier for the resource breakdown structure's header.
579 * P_Name : The name of the resource breakdown structure.
580 * P_Description : The description of the resource breakdown structure.
581 * P_Effective_From_Date : The date from which the resource breakdown structure is effective.
582 * P_Effective_To_Date : The date till which the resource breakdown structure is effective.
583 * P_Record_Version_Number : The record version number of the RBS header.
584 *
585 * OUTPUT VALUES:
586 * X_Return_Status : Will return a value of 'S' when the API is
587 * succesful in loading the RBS.
588 * Will return a value of 'E' when the API fails
589 * due to a validation error.
590 * Will return a value of 'U' when the API hits
591 * and unexpected error(Some ORA or such error).
592 * *************************************************************************************
593 */
594 /*#
595 * This API is used to load header record information to a global PL/SQL table for the resource
596 * breakdown structure.
597 * @param p_api_version_number API standard: version number
598 * @rep:paraminfo {@rep:required}
599 * @param p_rbs_header_id Resource breakdown structure header identifier
600 * @param p_name Resource breakdown structure header name
601 * @rep:paraminfo {@rep:required}
602 * @param p_description Resource breakdown structure header description
603 * @param p_effective_from_date Resource breakdown structure header effective start date
604 * @rep:paraminfo {@rep:required}
605 * @param P_Effective_To_Date Resource breakdown structure header effective end date
606 * @param p_record_version_number Resource breakdown structure header record version number
607 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
608 * @rep:paraminfo {@rep:precision 1} {@rep:required}
609 * @rep:scope public
610 * @rep:lifecycle active
611 * @rep:displayname Load Resource Breakdown Structure Header
612 * @rep:compatibility S
613 */
614 Procedure Load_Rbs_Header(
615 P_Api_Version_Number IN Number,
616 P_Rbs_Header_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
617 P_Name IN Varchar2 Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
618 P_Description IN Varchar2 Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
619 P_Effective_From_Date IN Date Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE,
620 P_Effective_To_Date IN Date Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE,
621 P_Record_Version_Number IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
622 X_Return_status OUT NOCOPY Varchar2);
623
624
625
626 /*
627 * ***************************************************************************************
628 * API Name : Load_Rbs_Version
629 * Public/Private : Public
630 * Procedure/Function : Procedure
631 * Description :
632 * This API allows the user to load the RBS version record data.
633 * It is never required to be executed.
634 *
635 * It can be used for Creating an RBS version record.In that case the
636 * following parameter must be populated. p_api_version_number, p_name,
637 * p_effective_start_date.
638 *
639 *
640 * It can be used for Updating an RBS version. In that case the
641 * following parameters must be populated. p_api_version_number,
642 * p_rbs_header_id, p_rbs_version_id, p_name,p_version_start_date,
643 * p_record_version_number.
644 * Attributes:
645 * INPUT VALUES:
646 * P_Api_Version_Number : The Api version number.This is a mandatory parameter.
647 * P_Rbs_Version_Id : The identifier for the resource breakdown structure's version.
648 * P_Name : The name of the resource breakdown structure's version.
649 * P_Description : The description of the resource breakdown structure's version.
650 * P_Version_Start_Date : The date from which the resource breakdown structure's version is effective.
654 * X_Return_Status : Will return a value of 'S' when the API is
651 * P_Job_Group_Id : The job group identifier associated with the RBS version.
652 * P_Record_Version_Number : The record version number of the RBS version.
653 * OUTPUT VALUES:
655 * succesful in loading the RBS version.
656 * Will return a value of 'E' when the API fails
657 * due to a validation error.
658 * Will return a value of 'U' when the API hits
659 * and unexpected error(Some ORA or such error).
660 * *************************************************************************************
661 */
662 /*#
663 * This API is used to load resource breakdown structure version record information to a global
664 * PL/SQL table.
665 * @param p_api_version_number API standard: version number
666 * @rep:paraminfo {@rep:required}
667 * @param p_rbs_version_id Resource breakdown structure version identifier
668 * @param p_name Resource breakdown structure version name
669 * @rep:paraminfo {@rep:required}
670 * @param p_description Resource breakdown structure version description
671 * @param p_version_start_date Resource breakdown structure version start date
672 * @rep:paraminfo {@rep:required}
673 * @param p_job_group_id Job group identifier for resource breakdown structure version
674 * @param p_record_version_number Resource breakdown structure record version number
675 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
676 * @rep:paraminfo {@rep:precision 1} {@rep:required}
677 * @rep:scope public
678 * @rep:lifecycle active
679 * @rep:displayname Load Resource Breakdown Structure Version
680 * @rep:compatibility S
681 */
682 Procedure Load_Rbs_Version(
683 P_Api_Version_Number IN Number,
684 P_Rbs_Version_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
685 P_Name IN Varchar2 Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
686 P_Description IN Varchar2 Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
687 P_Version_Start_Date IN Date Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE,
688 P_Job_Group_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
689 P_Record_Version_Number IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
690 X_Return_Status OUT NOCOPY VARCHAR2);
691
692
693
694 /*
695 * ****************************************************************************
696 * API Name : Load_Rbs_Elements
697 * Public/Private : Public
698 * Procedure/Function : Procedure
699 * Description :
700 * This API allows the user to load the RBS element records data.
701 * It is never required to be executed.
702 *
703 * If used with Exec_Create_Rbs() api the following parameters
704 * must be populated when used: p_api_version_number, P_Resource_Type_Id,
705 * P_Resource_Source_Id or P_Resource_Source_Code, P_Process_Type,
706 * P_Rbs_Level, P_Parent_Ref_Element_Id, P_Rbs_Ref_Element_Id. The process
707 * type must always be 'A'.
708 *
709 * If used with Exec_Update_Rbs() API then the following parameters
710 * must be populated when used: p_api_version_number, P_Resource_Type_Id,
711 * P_Resource_Source_Id or P_Resource_Source_Code, P_Process_Type,
712 * P_Rbs_Level. When process type is 'U' or 'D' then P_Rbs_Version_Id,
713 * P_Parent_Element_Id are required. When process type is 'A' then
714 * P_Parent_Ref_Element_Id, P_Rbs_Ref_Element_Id are required.
715 *
716 * If you are loading the root node/element then the rbs_level must be 1
717 * and the P_Parent_Ref_Element_Id and P_Parent_Element_Id are always null.
718 *
719 * Process_Type Meaning
720 * ------------ -------
721 * A Add Element
722 * U Update Node/Element
723 * D Delete Node/Element and its children if they exist.
724 *
725 * The P_Order_Number is used to specificy the order in which the elements
726 * are ordered under their parents. If no order number is provided then the order will
727 * be automatically created for the children of each parent node/element.
728 *
729 * Note that when using this API it is going to be called many times and you
730 * will need some mechanism in the calling routine to keep track of how many
731 * record were loaded if you wish to use the fetch_rbs_element() API.
732 * Attributes :
733 * INPUT VALUES:
734 * P_Api_Version_Number : This is a mandatory parameter.It specifies the API version number.
735 * P_Rbs_Version_Id : This specifies the Resource breakdown structure's version identifier.
736 * P_Rbs_Element_Id : This specifies the identifier of the resource breakdown structure's element.
737 * P_Parent_Element_Id : The element identifier of the parent of the current element.
741 * associated to the resource type of BOM_LABOR, BOM_EQUIPMENT, NAMED_PERSON,
738 * P_Resource_Type_Id : The resource type identifier of the element.
739 * P_Resource_Source_Id : The resource breakdown structure's element's source id.
740 * This would have value if the element's resource type is
742 * EVENT_TYPE, EXPENDITURE_CATEGORY,EXPENDITURE_TYPE, ITEM_CATEGORY,
743 * INVENTORY_ITEM JOB, ORGANIZATION, PERSON_TYPE, NON_LABOR_RESOURCE
744 * RESOURCE_CLASS, ROLE, SUPPLIER.
745 * P_Resource_Source_Code : The resource breakdown structure's element's source code.
746 * This would have value if the element's resource type is
747 * associated to the resource type code of REVENUE_CATEGORY
748 * or USER_DEFINED.
749 * P_Order_Number : The order in which the elements are displayed on a given
750 * level of the resource breakdown structure
751 *
752 * P_Process_Type : The type of processing required for the resource breakdown structure's element.
753 * Must contain a value of 'A' or 'U' or 'D'.
754 * Value Meaning
755 * ------- -------
756 * A Add element
757 * U Update element
758 * D Delete element and its children if the element exists.
759 *
760 * P_Rbs_Level : The level at which the element would be placed in the resource breakdown structure.
761 * The level can have a value between 1 and 10. 1 is reserved for the root element which
762 * will be ignored during processing.
763 *
764 * P_Record_Version_Number : Record version number of the resource breakdown structure's element.
765 * P_Parent_Ref_Element_Id : This is your parent internal identifier to the
766 * rbs. This cannot be an arbitrary value. At each
767 * rbs_level the rbs element must be associated to an
768 * existing rbs element parent so must contain a value
769 * from the previous rbs_level Rbs_Ref_Element_Id. If
770 * the rbs_level is 1 or 2 then it does not need to be
771 * populated. Rbs_level 1 element need no parent and
772 * rbs_level 2 elements parent is automatically create
773 * and root element internal identifier will be used.
774 *
775 * P_Rbs_Ref_Element_Id : This is your internal identifier but does
776 * effect the order with which the records are
777 * processed at each rbs level
778 * OUTPUT VALUES:
779 * X_Return_Status : Will return a value of 'S' when the API is
780 * succesful in loading the RBS elements.
781 * Will return a value of 'E' when the API fails
782 * due to a validation error.
783 * Will return a value of 'U' when the API hits
784 * and unexpected error(Some ORA or such error).
785 * ********************************************************************************
786 */
787 /*#
788 * This API is used to load resource breakdown structure element record information to a global
789 * PL/SQL table.
790 * @param p_api_version_number API standard: version number
791 * @rep:paraminfo {@rep:required}
792 * @param p_rbs_version_id Resource breakdown structure version identifier
793 * @param p_rbs_element_id Identifier of the resource breakdown structure element
794 * @param p_parent_element_id Parent element identifier of the current element
795 * @rep:paraminfo {@rep:required}
796 * @param p_resource_type_id Resource type of the element
797 * @rep:paraminfo {@rep:required}
798 * @param p_resource_source_id Source identifier of the resource
799 * @param p_resource_source_code Source code of the resource
800 * @param p_order_number Order number of the element
801 * @param p_process_type Indicates whether to insert, update, or delete the element
802 * @rep:paraminfo {@rep:required}
803 * @param P_Rbs_Level Level at which the element will be placed in the resource breakdown structure
804 * @rep:paraminfo {@rep:required}
805 * @param p_record_version_number Element record version number
806 * @param p_parent_ref_element_id Parent element reference identifier
807 * @param p_rbs_ref_element_id Element reference identifier
808 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
809 * @rep:paraminfo {@rep:precision 1} {@rep:required}
810 * @rep:scope public
811 * @rep:lifecycle active
812 * @rep:displayname Load Resource Breakdown Structure Elements
816 P_Api_Version_Number IN Number,
813 * @rep:compatibility S
814 */
815 Procedure Load_Rbs_Elements(
817 P_Rbs_Version_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
818 P_Rbs_Element_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
819 P_Parent_Element_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
820 P_Resource_Type_Id IN Number,
821 P_Resource_Source_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
822 P_Resource_Source_Code IN Varchar2 Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
823 P_Order_Number IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
824 P_Process_Type IN Varchar2,
825 P_Rbs_Level IN Number,
826 P_Record_Version_Number IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
827 P_Parent_Ref_Element_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
828 P_Rbs_Ref_Element_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
829 X_Return_Status OUT NOCOPY Varchar2);
830
831
832
833
834
835 /*
836 * *************************************************************************************
837 * API Name : Fetch_Rbs_Header
838 * Public/Private : Public
839 * Procedure/Function : Procedure
840 * Description :
841 * This API returns the internal identifier and status of the Rbs Header
842 * record.
843 *
844 * There are 3 status that can be returned:
845 * S - Success
846 * E - Error; caused when fails validation
847 * U - Unexpected Error; system error and unhandle issue like ORA errors
848 * Attributes :
849 * INPUT VALUES:
850 * P_Api_Version_Number : This is a mandatory parameter.It specifies the API version number.
851 * OUTPUT VALUES:
852 * X_Rbs_Header_Id : The identifier for the resource breakdown structure's header.
853 *
854 * X_Return_Status : Will return a value of 'S' when the API is
855 * succesful in fetching the RBS header.
856 * Will return a value of 'E' when the API fails
857 * due to a validation error.
858 * Will return a value of 'U' when the API hits
859 * and unexpected error(Some ORA or such error).
860 * *****************************************************************************************
861 */
862 /*#
863 * This API is used to fetch output parameters related to resource breakdown structure header information.
864 * @param p_api_version_number API standard: version number
865 * @rep:paraminfo {@rep:required}
866 * @param x_rbs_header_id Resource breakdown structure header identifier
867 * @rep:paraminfo {@rep:required}
868 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
869 * @rep:paraminfo {@rep:precision 1} {@rep:required}
870 * @rep:scope public
871 * @rep:lifecycle active
872 * @rep:displayname Fetch Resource Breakdown Structure Header
873 * @rep:compatibility S
874 */
875 Procedure Fetch_Rbs_Header(
876 P_Api_Version_Number IN Number,
877 X_Rbs_Header_Id OUT NOCOPY Number,
878 X_Return_Status OUT NOCOPY Varchar2);
879
880
881
882
883
884 /*
885 * *****************************************************************************************
886 * API Name : Fetch_Rbs_Version
887 * Public/Private : Public
888 * Procedure/Function : Procedure
889 * Description :
890 * This API returns the internal identifier and status of the Rbs Version
891 * record.
892 *
893 * There are 3 status that can be returned:
894 * S - Success
895 * E - Error; caused when fails validation
896 * U - Unexpected Error; system error and unhandle issue like ORA errors
897 * Attributes :
898 * INPUT VALUES :
899 * P_Api_Version_Number : This is a mandatory parameter.It specifies the API version number.
900 * OUTPUT VALUES:
901 * X_Rbs_Version_Id : The identifier for the resource breakdown structure's version.
902 *
903 * X_Return_Status : Will return a value of 'S' when the API is
904 * succesful in fetching the RBS Version.
905 * Will return a value of 'E' when the API fails
906 * due to a validation error.
907 * Will return a value of 'U' when the API hits
908 * and unexpected error(Some ORA or such error).
909 * ********************************************************************************************
910 */
911 /*#
912 * This API is used to fetch output parameters related to resource breakdown structure version information.
913 * @param p_api_version_number API standard: version number
914 * @rep:paraminfo {@rep:required}
918 * @rep:paraminfo {@rep:precision 1} {@rep:required}
915 * @param x_rbs_version_id Resource Breakdown Structure version identifier
916 * @rep:paraminfo {@rep:required}
917 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
919 * @rep:scope public
920 * @rep:lifecycle active
921 * @rep:displayname Fetch Resource Breakdown Structure Version
922 * @rep:compatibility S
923 */
924 Procedure Fetch_Rbs_Version(
925 P_Api_Version_Number IN Number,
926 X_Rbs_Version_Id OUT NOCOPY Number,
927 X_Return_Status OUT NOCOPY Varchar2);
928
929
930
931
932
933
934 /*
935 * ****************************************************************************************
936 * API Name : Fetch_Rbs_Element
937 * Public/Private : Public
938 * Procedure/Function : Procedure
939 * Description :
940 * This API returns the internal identifier and status of the Rbs element/node
941 * record. If no records were loaded using load_rbs_elements then there
942 * will no records to fetch.
943 *
944 * There are 3 status that can be returned:
945 * S - Success
946 * E - Error; caused when fails validation
947 * U - Unexpected Error; system error and unhandle issue like ORA errors
948 *
949 *
950 *
951 * Attributes :
952 * INPUT VALUES:
953 * P_Api_Version_Number : This is a mandatory parameter.It specifies the API version number.
954 * P_Rbs_Element_Index : The p_rbs_element_index in parameter is the order in which you called
955 * load_rbs_elements() API. So you will need to track that when
956 * when using the load_rbs_elements() API in your calling routine.
957 * OUTPUT VALUES:
958 * X_Rbs_Element_Id : The identifier for the resource breakdown structure's element.
959 *
960 * X_Return_Status : Will return a value of 'S' when the API is
961 * succesful in fetching the RBS element.
962 * Will return a value of 'E' when the API fails
963 * due to a validation error.
964 * Will return a value of 'U' when the API hits
965 * and unexpected error(Some ORA or such error).
966 * ********************************************************************************************************************
967 */
968 /*#
969 * This API is used to fetch output parameters related to resource breakdown structure element information.
970 * @param p_api_version_number API standard: version number
971 * @rep:paraminfo {@rep:required}
972 * @param p_rbs_element_index Resource breakdown structure element index
973 * @rep:paraminfo {@rep:required}
974 * @param x_rbs_element_id Resource breakdown structure element identifier
975 * @rep:paraminfo {@rep:required}
976 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
977 * @rep:paraminfo {@rep:precision 1} {@rep:required}
978 * @rep:scope public
979 * @rep:lifecycle active
980 * @rep:displayname Fetch Resource Breakdown Structure Element
981 * @rep:compatibility S
982 */
983 Procedure Fetch_Rbs_Element(
984 P_Api_Version_Number IN Number,
985 P_Rbs_Element_Index IN Number,
986 X_Rbs_Element_Id OUT NOCOPY Number,
987 X_Return_Status OUT NOCOPY Varchar2);
988
989
990
991
992
993
994
995
996
997 /*
998 * ********************************************************************************************************
999 * API Name : Exec_Create_Rbs
1000 * Public/Private : Public
1001 * Procedure/Function : Procedure
1002 * Description :
1003 * This API uses the data that was loaded via the load_rbs_header(),
1004 * load_rbs_version(), and load_rbs_elements() API's to call the
1005 * Create_Rbs() API.
1006 * Attributes :
1007 * INPUT VALUES :
1008 * P_Commit : This parameter is optional, by default no commit will take place.
1009 * P_Init_Msg_List : This parameter is optional, by default the error msg stack
1010 * is not initialized.
1011 * P_Api_Version_Number : This parameter is required. The Api version number.
1012 *
1013 * OUTPUT VALUES :
1014 * X_Return_Status : Will return a value of 'S' when the API is
1015 * successful in creating the RBS.
1016 * : Will return a value of 'E' when the API fails
1017 * due to a validation error.
1018 * : Will return a value of 'U' when the API hits
1019 * and unexpected error(Some ORA or such error).
1020 * X_Msg_Count : Depending on the P_Init_Msg_List parameter value
1021 * this paramenter may have a value of 1 or higher
1022 * X_Error_Msg_Data : The parameter will hold a message if there is an
1023 * error in this API.
1024 * *******************************************************************************************************
1025 */
1029 * @param p_init_msg_list API standard (default = F): indicates if message stack will be initialized
1026 /*#
1027 * This API is used to create resource breakdown structure using the data stored in the global tables.
1028 * @param p_commit API standard (default = F): indicates if the transaction will be committed
1030 * @param p_api_version_number API standard: version number
1031 * @rep:paraminfo {@rep:required}
1032 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
1033 * @rep:paraminfo {@rep:precision 1} {@rep:required}
1034 * @param x_msg_count API standard: number of error messages
1035 * @rep:paraminfo {@rep:required}
1036 * @param x_msg_data API standard: error message
1037 * @rep:paraminfo {@rep:precision 2000} {@rep:required}
1038 * @rep:scope public
1039 * @rep:lifecycle active
1040 * @rep:displayname Execute Create Resource Breakdown Structure
1041 * @rep:compatibility S
1042 */
1043 Procedure Exec_Create_Rbs(
1044 P_Commit IN Varchar2 := Fnd_Api.G_False,
1045 P_Init_Msg_List IN Varchar2 := Fnd_Api.G_True,
1046 P_Api_Version_Number IN Number,
1047 X_Return_Status OUT NOCOPY Varchar2,
1048 X_Msg_Count OUT NOCOPY Number,
1049 X_Msg_Data OUT NOCOPY Varchar2);
1050
1051
1052
1053
1054
1055
1056
1057 /*
1058 * ********************************************************************************************************
1059 * API Name : Exec_Update_Rbs
1060 * Public/Private : Public
1061 * Procedure/Function : Procedure
1062 * Description :
1063 * This API uses the data that was loaded via the load_rbs_header(),
1064 * load_rbs_version(), and load_rbs_elements() API's to call the
1065 * Update_Rbs() API.
1066 * INPUT VALUES :
1067 * P_Commit : This parameter is optional, by default no commit will take place
1068 * P_Init_Msg_List : This parameter is optional, by default the error msg stack
1069 * is initialized
1070 * P_Api_Version_Number : This parameter is required. The Api version number.
1071 *
1072 * OUTPUT VALUES :
1073 * X_Return_Status : Will return a value of 'S' when the API is
1074 * successful in creating the RBS.
1075 * Will return a value of 'E' when the API fails
1076 * due to a validation error.
1077 * Will return a value of 'U' when the API hits
1078 * and unexpected error(Some ORA or such error).
1079 * X_Msg_Count : Depending on the P_Init_Msg_List parameter value
1080 * this paramenter may have a value of 1 or higher
1081 * X_Error_Msg_Data : The parameter will hold a message if there is an
1082 * error in this API.
1083 * *****************************************************************************************************
1084 */
1085 /*#
1086 * This API is used to update resource breakdown structure using the data stored in the global tables.
1087 * @param p_commit API standard (default = F): indicates if the transaction will be committed
1088 * @param p_init_msg_list API standard (default = F): indicates if message stack will be initialized
1089 * @param p_api_version_number API standard: version number
1090 * @rep:paraminfo {@rep:required}
1091 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
1092 * @rep:paraminfo {@rep:precision 1} {@rep:required}
1093 * @param x_msg_count API standard: number of error messages
1094 * @rep:paraminfo {@rep:required}
1095 * @param x_msg_data API standard: error message
1096 * @rep:paraminfo {@rep:precision 2000} {@rep:required}
1097 * @rep:scope public
1098 * @rep:lifecycle active
1099 * @rep:displayname Execute Update Resource Breakdown Structure
1100 * @rep:compatibility S
1101 */
1102 Procedure Exec_Update_Rbs(
1103 P_Commit IN Varchar2 := Fnd_Api.G_False,
1104 P_Init_Msg_List IN Varchar2 := Fnd_Api.G_True,
1105 P_Api_Version_Number IN Number,
1106 X_Return_Status OUT NOCOPY Varchar2,
1107 X_Msg_Count OUT NOCOPY Number,
1108 X_Msg_Data OUT NOCOPY Varchar2);
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118 /*
1119 * *****************************************************************************************************
1120 * API Name : Copy_Rbs_Working_Version
1121 * Public/Private : Public
1122 * Procedure/Function : Procedure
1123 * Description :
1124 * This API is used to create a working version from an existing frozen version.
1125 * Attributes :
1126 * INPUT VALUES :
1127 * P_Commit : This parameter is optional, by default no commit will take place.
1128 * P_Init_Msg_List : This parameter is optional, by default the error msg stack
1129 * is not initialized.
1130 * P_Api_Version_Number : This parameter is required. The Api version number.
1131 *
1132 * P_RBS_Version_Id : The RBS frozen version's id to copy from.
1133 * P_Rbs_Header_Id : The RBS Header for the frozen and the working version.
1134 * P_Rbs_Header_Name : The rbs header name of the version selected to make a copy.
1138 * X_Return_Status : Will return a value of 'S' when the API is
1135 * P_Rbs_Version_Number : The version number of the rbs version selected to make a copy.
1136 * P_Rec_Version_Number : The record version number for the current working version.
1137 * OUTPUT VALUES :
1139 * successful in creating the RBS.
1140 * : Will return a value of 'E' when the API fails
1141 * due to a validation error.
1142 * : Will return a value of 'U' when the API hits
1143 * and unexpected error(Some ORA or such error).
1144 * X_Msg_Count : Depending on the P_Init_Msg_List parameter value
1145 * this paramenter may have a value of 1 or higher
1146 * X_Error_Msg_Data : The parameter will hold a message if there is an
1147 * error in this API.
1148 * *************************************************************************************************************
1149 */
1150
1151 /*#
1152 * This API is used to create a working version of a resource breakdown structure from an existing frozen
1153 * version.
1154 * @param p_commit API standard (default = F): indicates if the transaction will be committed
1155 * @param p_init_msg_list API standard (default = F): indicates if message stack will be initialized
1156 * @param p_api_version_number API standard: version number
1157 * @rep:paraminfo {@rep:required}
1158 * @param p_rbs_version_id Resource breakdown structure version identifier of the frozen version to be copied
1159 * @param p_rbs_header_id Identifier of the resource breakdown structure header
1160 * @param p_rbs_header_name Name of the resource breakdown structure header
1161 * @param p_rbs_version_number Number of the resource breakdown structure version
1162 * @param p_rec_version_number Record version number of the current resource breakdown structure working version
1163 * @rep:paraminfo {@rep:required}
1164 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
1165 * @rep:paraminfo {@rep:precision 1} {@rep:required}
1166 * @param x_msg_count API standard: number of error messages
1167 * @rep:paraminfo {@rep:required}
1168 * @param x_error_msg_data API standard: error message
1169 * @rep:paraminfo {@rep:precision 2000} {@rep:required}
1170 * @rep:scope public
1171 * @rep:lifecycle active
1172 * @rep:displayname Copy Resource Breakdown Structure Working Version
1173 * @rep:compatibility S
1174 */
1175 Procedure Copy_Rbs_Working_Version(
1176 P_Commit IN Varchar2 Default Fnd_Api.G_False,
1177 P_Init_Msg_List IN Varchar2 Default Fnd_Api.G_True,
1178 P_Api_Version_Number IN Number,
1179 P_RBS_Version_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1180 P_Rbs_Header_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1181 P_Rbs_Header_Name IN Varchar2 Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
1182 P_Rbs_Version_Number IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1183 P_Rec_Version_Number IN Number,
1184 X_Return_Status OUT NOCOPY Varchar2,
1185 X_Msg_Count OUT NOCOPY Number,
1186 X_Error_Msg_Data OUT NOCOPY Varchar2 );
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198 /*
1199 * ************************************************************************************************************
1200 * API Name : Freeze_Rbs_Version
1201 * Public/Private : Public
1202 * Procedure/Function : Procedure
1203 * Description :
1204 * This API to freeze the current working version for the RBS and create and new
1205 * working version.
1206 * Attributes :
1207 *
1208 * INPUT VALUES :
1209 * P_Commit : This parameter is optional, by default no commit will take place.
1210 * P_Init_Msg_List : This parameter is optional, by default the error msg stack
1211 * is not initialized.
1212 * P_Api_Version_Number : This parameter is required. The Api version number.
1213 *
1214 * P_RBS_Version_Id : The version id of the RBS which has to be freezed.
1215 * P_Rbs_Header_Name : The rbs header name of the version to be freezed.
1216 * P_Rbs_Header_Id : The header id of the RBS that has to be freezed.
1217 *
1218 * P_Rbs_Version_Record_Ver_Num : The record version number of the RBS Version.
1219 *
1220 *
1221 * OUTPUT VALUES :
1222 * X_Return_Status : Will return a value of 'S' when the API is
1223 * successful in creating the RBS.
1224 * : Will return a value of 'E' when the API fails
1225 * due to a validation error.
1226 * : Will return a value of 'U' when the API hits
1227 * and unexpected error(Some ORA or such error).
1228 * X_Msg_Count : Depending on the P_Init_Msg_List parameter value
1229 * this paramenter may have a value of 1 or higher
1230 * X_Error_Msg_Data : The parameter will hold a message if there is an
1231 * error in this API.
1232 * *****************************************************************************************************
1233 */
1234 /*#
1238 * @param p_init_msg_list API standard (default = F): indicates if message stack will be initialized
1235 * This API is used to freeze the current working resource breakdown structure version and enable the user
1236 * to create a new working version.
1237 * @param p_commit API standard (default = F): indicates if the transaction will be committed
1239 * @param p_api_version_number API standard: version number
1240 * @rep:paraminfo {@rep:required}
1241 * @param p_rbs_version_id Resource breakdown structure version identifier
1242 * @rep:paraminfo {@rep:required}
1243 * @param p_rbs_header_name Name of resource breakdown structure whose working version should be frozen
1244 * @param p_rbs_header_id Resource breakdown structure header identifier whose working version should be frozen
1245 * @param P_Rbs_Version_Record_Ver_Num Resource breakdown structure version record version number
1246 * @rep:paraminfo {@rep:required}
1247 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
1248 * @rep:paraminfo {@rep:precision 1} {@rep:required}
1249 * @param x_msg_count API standard: number of error messages
1250 * @rep:paraminfo {@rep:required}
1251 * @param x_error_msg_data API standard: error message
1252 * @rep:paraminfo {@rep:precision 2000} {@rep:required}
1253 * @rep:scope public
1254 * @rep:lifecycle active
1255 * @rep:displayname Freeze Resource Breakdown Structure Version
1256 * @rep:compatibility S
1257 */
1258 Procedure Freeze_Rbs_Version(
1259 P_Commit IN Varchar2 Default Fnd_Api.G_False,
1260 P_Init_Msg_List IN Varchar2 Default Fnd_Api.G_True,
1261 P_API_Version_Number IN Number,
1262 P_Rbs_Version_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1263 P_Rbs_Header_Name IN Varchar2 Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
1264 P_Rbs_Header_Id IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1265 P_Rbs_Version_Record_Ver_Num IN Number Default PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1266 X_Return_Status OUT NOCOPY Varchar2,
1267 X_Msg_Count OUT NOCOPY Number,
1268 X_Error_Msg_Data OUT NOCOPY Varchar2);
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282 /*
1283 * **************************************************************************************************
1284 * API Name : Assign_Rbs_To_Project
1285 * Public/Private : Public
1286 * Procedure/Function : Procedure
1287 * Description :
1288 * This API will assign the RBS to a project.
1289 * You must provide the Rbs Header Id and the Project Id as in parameters
1290 * The rest have default values. The RBS will always have a usage of Reporting.
1291 * Attributes:
1292 * INPUT VALUES:
1293 * P_Commit : This parameter is optional, by default no commit will take place.
1294 * P_Init_Msg_List : This parameter is optional, by default the error msg stack
1295 * is not initialized.
1296 * P_Api_Version_Number : This parameter is required. The Api version number.
1297 * P_RBS_Version_Id : The version identifier of the RBS which has to be associated with the project.
1298 * P_Rbs_Header_Id : The header identifier of the RBS that has to be associated to the project.
1299 * P_Project_Id : The identifier of the project to which the RBS has to be associated.
1300 * P_Pm_Project_Reference : The project reference that would be generated when a third party software
1301 * gets migrated to oracle applications.Like a project from Microsoft project getting
1302 * created/migrated to Oracle projects.If a project is created in Oracle Projects
1303 * this would have a null value.
1304 * P_Rbs_Header_Name : The Resource breakdown structure's header's name.
1305 * P_Rbs_Version_Number : The version number of the RBS. This is not the version id.
1306 * P_Prog_Rep_Usage_Flag : Flag which indicates whether the RBS would be used for Program Reporting.
1307 * 'Y' indicates that it would be used.
1308 * 'N' indicates that it would not be used.
1309 * P_Primary_Rep_Flag : Flag which indicates whether the RBS would be used for Primary Reporting.
1310 * 'Y' indicates that it would be used.
1311 * 'N' indicates that it would not be used.
1312 *
1313 * OUTPUT VALUES :
1314 * X_Return_Status : Will return a value of 'S' when the API is
1315 * successful in creating the RBS.
1316 * : Will return a value of 'E' when the API fails
1317 * due to a validation error.
1318 * : Will return a value of 'U' when the API hits
1319 * and unexpected error(Some ORA or such error).
1320 * X_Msg_Count : Depending on the P_Init_Msg_List parameter value
1321 * this paramenter may have a value of 1 or higher
1322 * X_Error_Msg_Data : The parameter will hold a message if there is an
1323 * error in this API.
1324 * NOTE: The parameter P_Rbs_Version_Id is not used in the procedure. It is retained for the time being.
1325 * *********************************************************************************************************
1326 */
1327 /*#
1328 * This API is used to assign the resource breakdown structure to a project.
1329 * @param p_commit API standard (default = F): indicates if the transaction will be committed
1330 * @param p_init_msg_list API standard (default = F): indicates if message stack will be initialized
1331 * @param p_api_version_number API standard: version number
1332 * @rep:paraminfo {@rep:required}
1333 * @param p_project_id Identifier of the project to which the resource breakdown structure should be assigned
1334 * @rep:paraminfo {@rep:required}
1335 * @param p_pm_project_reference Identifier of the project of the external system to which the resource
1336 * breakdown structure should be assigned
1337 * @param p_rbs_header_id Resource breakdown structure header identifier
1338 * @rep:paraminfo {@rep:required}
1339 * @param p_rbs_header_name Name of resource breakdown structure
1340 * @param p_rbs_version_number Resource breakdown structure version number
1341 * @rep:paraminfo {@rep:required}
1342 * @param p_rbs_version_id Resource breakdown structure version identifier
1343 * @param p_prog_rep_usage_flag Flag indicating whether the assigned resource breakdown structure is used for
1344 * program reporting
1345 * @param p_primary_rep_flag Flag indicating whether the assigned resource breakdown structure is the primary
1346 * reporting resource breakdown structure
1347 * @param x_return_status API standard: return status of the API (success/failure/unexpected error)
1348 * @rep:paraminfo {@rep:precision 1} {@rep:required}
1349 * @param x_msg_count API standard: number of error messages
1350 * @rep:paraminfo {@rep:required}
1351 * @param x_error_msg_data API standard: error message
1352 * @rep:paraminfo {@rep:precision 2000} {@rep:required}
1353 * @rep:scope public
1354 * @rep:lifecycle active
1355 * @rep:displayname Assign Resource Breakdown Structure To Project
1356 * @rep:compatibility S
1357 */
1358 Procedure Assign_Rbs_To_Project(
1359 P_Commit IN Varchar2 DEFAULT FND_API.G_FALSE,
1360 P_Init_Msg_List IN Varchar2 DEFAULT FND_API.G_True,
1361 P_API_Version_Number IN Number,
1362 P_Rbs_Header_Id IN Number DEFAULT PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1363 P_Rbs_Version_Id IN Number DEFAULT PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM, --Not used
1364 P_Project_Id IN Number DEFAULT PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1365 P_Pm_Project_Reference IN Varchar2 DEFAULT PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
1366 P_Rbs_Header_Name IN Varchar2 DEFAULT PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
1367 P_Rbs_Version_Number IN Number DEFAULT PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
1368 P_Prog_Rep_Usage_Flag IN Varchar2 DEFAULT 'N',
1369 P_Primary_Rep_Flag IN Varchar2 DEFAULT 'N',
1370 X_Return_Status OUT NOCOPY Varchar2,
1371 X_Msg_Count OUT NOCOPY Number,
1372 X_Error_Msg_Data OUT NOCOPY Varchar2);
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384 /*
1385 * *****************************************************************************************************
1386 * API Name : PopulateErrorStack
1387 * Public/Private : Private
1388 * Procedure/Function : Procedure
1389 * Description :
1390 * This API is used to generate a usable message when processing the
1391 * rbs elements. If is for internal use only and should not be called
1392 * externally.
1393 * Attributes :
1394 * INPUT VALUES :
1395 * P_Ref_Element_Id : This is an internal identifier for the element but does
1396 * effect the order with which the records are
1397 * processed at each rbs_level.
1398 * P_Element_Id : The RBS element id.
1399 * P_Process_Type : The type of the process.It can have the following values.'U','A','D'
1400 * P_Error_Msg_Data : The parameter will hold a message if there is an
1401 * error in the which calls this method.
1402 * ********************************************************************************************************
1403 */
1404
1405 Procedure PopulateErrorStack(
1406 P_Ref_Element_Id IN Number,
1407 P_Element_Id IN Number,
1408 P_Process_Type IN Varchar,
1409 P_Error_Msg_Data IN Varchar2);
1410
1411
1412
1413
1414 END Pa_Rbs_Pub;