The following lines contain the word 'select', 'insert', 'update' or 'delete':
* and selects the value from the database if the value being input is
* null, so that there wouldn't be any change to the data when null is passed
* as input.
* The conversions are done for the Plan_Res_List_IN_Rec.
* Attributes :
* INPUT VALUES :
* P_Plan_res_list_Rec : The record which hold's the resource list details.
* This contains the input record.
* P_Mode : The mode in which this procedure is called.
* It can be called in either Update or create mode
* 1 means update. 0 means create.
* OUTPUT VALUES :
*
* X_Plan_res_list_Rec : The record which hold's the resource list details with the
* changed values to the fields of the record.
* X_Error_Msg : The parameter will hold a message if there is an
* error in this API.
* There can be two modes in which this procedure can be called
* Update and create
* P_Mode = 1 means update
* P_Mode = 0 means create
* In Update
* if Update then Resource list id can be present.
* if Resource lsit id is not present then resource list name would be present .
* You can retreive the Resource list id from the resource list name.
* And then convert all GMISS to the database values.
*
* In create mode the Resource list name would be present
* Convert all missing values to null.
*
*
*******************************************************************************************/
PROCEDURE Convert_Missing_List_IN_Rec
(P_Plan_res_list_Rec IN Plan_Res_List_IN_Rec,
X_Plan_res_list_Rec OUT NOCOPY Plan_res_list_IN_Rec, -- 4537865
P_Mode IN NUMBER)
IS
Cursor C_Res_List_Details(P_Res_List_Id IN Number) IS
Select *
From Pa_Resource_Lists_All_Bg
Where resource_list_id=P_Res_List_Id;
SELECT resource_list_id
INTO l_resource_list_id
FROM pa_resource_lists_all_bg
WHERE name=l_resource_list_name;
* In Update
* This API can be called in both update and create mode. In both the cases
* the resource format identifier is checked against GMiss value. If it is Gmiss value
* the then identifier is converted into null.
*
*
*******************************************************************************************/
PROCEDURE Convert_Missing_Format_IN_Rec
(P_Plan_RL_Format_Tbl IN Plan_RL_Format_In_Tbl,
X_Plan_RL_Format_Tbl OUT NOCOPY Plan_RL_Format_In_Tbl) -- 4537865
IS
l_resource_format_id NUMBER;
* and selects the value from the database if the value being input is
* null, so that there wouldn't be any change to the data when null is passed
* as input.
* The conversions are done for the Planning_Resource_In_Tbl.
* Attributes :
* INPUT VALUES :
* P_Plan_res_list_Rec : The record which hold's the resource list
* members details.
* This contains the input record.
* P_Mode : The mode in which this procedure is called.
* It can be called in either Update or create mode
* 1 means update. 0 means create.
* OUTPUT VALUES :
*
* X_Plan_res_list_Rec : The record which hold's the resource list members
* details with the
* changed values to the fields of the record.
* There can be two modes in which this procedure can be called
* Update and create
* P_Mode = 1 means update
* P_Mode = 0 means create
* In Update
* if Update then Resource list member id can be present.
* Convert all GMISS to the database values.
*
* In create mode,
* Convert all missing values to null.
*
*
*******************************************************************************************/
PROCEDURE Convert_Missing_Member_IN_Rec
(P_planning_resource_in_tbl IN Planning_Resource_In_Tbl,
P_Plan_res_list_Rec IN Plan_Res_List_IN_Rec,
X_planning_resource_in_tbl OUT NOCOPY Planning_Resource_In_Tbl, -- 4537865
P_Mode IN Number)
IS
Cursor C_Member_Details(P_Member_Id IN Number) Is
Select *
From Pa_resource_list_members
Where
resource_list_member_id=P_Member_Id;
SELECT resource_list_member_id
INTO l_member_id
FROM pa_resource_list_members
WHERE alias = p_planning_resource_in_tbl(i).P_resource_alias
and resource_list_id = P_Plan_res_list_Rec.p_resource_list_id;
SELECT resource_list_member_id
INTO l_member_id
FROM PA_RESOURCE_LIST_MEMBERS
WHERE resource_list_id = P_Plan_res_list_Rec.p_resource_list_id
AND ALIAS = p_planning_resource_in_tbl(i).p_resource_alias
AND object_type = l_object_type
AND object_id = l_object_id;
* from CREATE_RESOURCE_LIST or UPDATE_RESOURCE_LIST API in this
* package.
****************************************************************************************/
Procedure Create_Plan_RL_Format(
p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
P_Res_List_id IN NUMBER,
P_Plan_RL_Format_Tbl IN Plan_RL_Format_In_Tbl,
X_Plan_RL_Format_Tbl OUT NOCOPY Plan_RL_Format_Out_Tbl,
X_Return_Status OUT NOCOPY VARCHAR2,
X_Msg_Count OUT NOCOPY NUMBER,
X_Msg_Data OUT NOCOPY VARCHAR2);
Select
business_group_id
Into
l_business_group_id
From
Pa_Implementations;
* Procedure : Update_Resource_List
* Description : AMG API, used to Update a resource list
* and its corresponding members and formats.
* The detailed information is in the spec.
*********************************************************/
PROCEDURE Update_Resource_List(
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_api_version_number IN NUMBER,
P_plan_res_list_Rec IN Plan_Res_List_IN_Rec,
X_plan_res_list_Rec OUT NOCOPY Plan_Res_List_OUT_Rec,
P_Plan_RL_Format_Tbl IN Plan_RL_Format_In_Tbl,
X_Plan_RL_Format_Tbl OUT NOCOPY Plan_RL_Format_Out_Tbl,
P_planning_resource_in_tbl IN Planning_Resource_In_Tbl,
X_planning_resource_out_tbl OUT NOCOPY Planning_Resource_Out_Tbl,
X_Return_Status OUT NOCOPY VARCHAR2,
X_Msg_Count OUT NOCOPY NUMBER,
X_Msg_Data OUT NOCOPY VARCHAR2)
IS
l_api_version_number CONSTANT NUMBER := G_API_VERSION_NUMBER;
l_api_name CONSTANT VARCHAR2(30) := 'Update_Resource_List';
SELECT resource_list_id,
control_flag,
record_version_number,
name,
description,
start_date_active,
end_date_active,
job_group_id,
use_for_wp_flag
FROM PA_RESOURCE_LISTS_ALL_BG
WHERE resource_list_id = p_resource_list_id;
* Call to API Pa_Create_Resource.Update_Resource_List to update
* the resource_list with the newly passed values. Values are
* passed thro the record struc P_plan_res_list_Rec.
*********************************************************/
Pa_Create_Resource.Update_Resource_List
(p_resource_list_name => L_plan_res_list_Rec.p_resource_list_name,
p_description => L_plan_res_list_Rec.p_description,
p_start_date => L_plan_res_list_Rec.p_start_date,
p_end_date => L_plan_res_list_Rec.p_end_date,
p_job_group_id => L_Plan_Res_List_Rec.p_job_group_id,
p_job_group_name => L_plan_res_list_Rec.p_job_group_name,
p_use_for_wp_flag => L_plan_res_list_Rec.p_use_for_wp_flag,
p_control_flag => L_plan_res_list_Rec.p_control_flag,
--p_migration_code => 'N',
p_record_version_number => L_Plan_res_list_Rec.p_record_version_number,
p_resource_list_id => L_plan_res_list_Rec.p_resource_list_id,
x_msg_count => l_msg_count,
x_return_status => l_return_status,
x_msg_data => l_msg_data);
* We can either create/delete resource formats.
* Deletion is taken care thro another api. So here we are
* going to create_resource_format using the pl/sql tables
* P_Plan_RL_Format_Tbl and X_Plan_RL_Format_Tbl passed.
*****************************************************/
--SAVEPOINT Update_Resource_List_Pub_A;
SELECT 'Y'
INTO l_exists
FROM pa_res_formats_b
WHERE res_format_id = L_Plan_RL_Format_Tbl(i).P_Res_Format_Id;
* Pa_Planning_resource_pvt.Update_Planning_Resource api,
* which would just update the corr record in the table.
* If it is not present then we'll call the
* pa_planning_resource_pvt.Create_Planning_Resource api,
* which would take care of creating the corr record in
* the table. Once a resource list member is succ created/Updated,
* we'll commit it in the db.
************************************************************/
/*
--commented out for bug 4103909
If L_planning_resource_in_tbl(i).p_resource_list_member_id Is Null Then
IF l_planning_resource_in_tbl(i).p_resource_alias is null THEN
Pa_Utils.Add_Message(
P_App_Short_Name => 'PA',
P_Msg_Name => 'PA_RLM_ALIAS_AND_ID_NULL');
SELECT resource_list_member_id,
record_version_number
INTO L_planning_resource_in_tbl(i).p_resource_list_member_id,
l_rlm_record_version_number
FROM PA_RESOURCE_LIST_MEMBERS
WHERE resource_list_id = l_old_resource_list_rec.resource_list_id
AND ALIAS = L_planning_resource_in_tbl(i).p_resource_alias;
SELECT resource_list_member_id,
record_version_number
INTO l_planning_resource_in_tbl(i).p_resource_list_member_id,
l_rlm_record_version_number
FROM PA_RESOURCE_LIST_MEMBERS
WHERE resource_list_id = l_old_resource_list_rec.resource_list_id
AND ALIAS = L_planning_resource_in_tbl(i).p_resource_alias
AND object_type = l_object_type
AND object_id = l_object_id;
Select record_version_number
Into l_rlm_record_version_number
From pa_resource_list_members
Where resource_list_member_id = L_planning_resource_in_tbl(i).p_resource_list_member_id;
SELECT resource_class_flag
INTO l_res_class_flag
FROM pa_res_formats_b
WHERE res_format_id = L_planning_resource_in_tbl(i).p_res_format_id;
SELECT 'Y'
INTO l_project_exists
FROM pa_projects_all
WHERE project_id = L_planning_resource_in_tbl(i).p_project_id;
SELECT 'Y'
INTO l_format_exists
FROM pa_plan_rl_formats
WHERE resource_list_id = L_Plan_res_list_Rec.p_resource_list_id
AND res_format_id = L_planning_resource_in_tbl(i).p_res_format_id;
SELECT meaning || ' ' || to_char(i) || ':'
INTO Pa_Planning_Resource_Pvt.g_token
FROM pa_lookups
WHERE lookup_type = 'PA_PLANNING_RESOURCE'
AND lookup_code = 'PLANNING_RESOURCE';
SELECT meaning || ' ' || to_char(i) || ':'
INTO Pa_Planning_Resource_Pvt.g_token
FROM pa_lookups
WHERE lookup_type = 'PA_PLANNING_RESOURCE'
AND lookup_code = 'PLANNING_RESOURCE';
Pa_Planning_Resource_Pvt.Update_Planning_Resource(
p_resource_list_id => L_plan_res_list_Rec.p_resource_list_id,
p_resource_list_member_id => L_planning_resource_in_tbl(i).p_resource_list_member_id,
p_enabled_flag => L_planning_resource_in_tbl(i).p_enabled_flag,
p_resource_alias => L_planning_resource_in_tbl(i).p_resource_alias,
p_spread_curve_id => L_planning_resource_in_tbl(i).p_spread_curve_id,
p_etc_method_code => L_planning_resource_in_tbl(i).p_etc_method_code,
p_mfc_cost_type_id => L_planning_resource_in_tbl(i).p_mfc_cost_type_id,
p_attribute_category => L_planning_resource_in_tbl(i).p_attribute_category,
p_attribute1 => L_planning_resource_in_tbl(i).p_attribute1,
p_attribute2 => L_planning_resource_in_tbl(i).p_attribute2,
p_attribute3 => L_planning_resource_in_tbl(i).p_attribute3,
p_attribute4 => L_planning_resource_in_tbl(i).p_attribute4,
p_attribute5 => L_planning_resource_in_tbl(i).p_attribute5,
p_attribute6 => L_planning_resource_in_tbl(i).p_attribute6,
p_attribute7 => L_planning_resource_in_tbl(i).p_attribute7,
p_attribute8 => L_planning_resource_in_tbl(i).p_attribute8,
p_attribute9 => L_planning_resource_in_tbl(i).p_attribute9,
p_attribute10 => L_planning_resource_in_tbl(i).p_attribute10,
p_attribute11 => L_planning_resource_in_tbl(i).p_attribute11,
p_attribute12 => L_planning_resource_in_tbl(i).p_attribute12,
p_attribute13 => L_planning_resource_in_tbl(i).p_attribute13,
p_attribute14 => L_planning_resource_in_tbl(i).p_attribute14,
p_attribute15 => L_planning_resource_in_tbl(i).p_attribute15,
p_attribute16 => L_planning_resource_in_tbl(i).p_attribute16,
p_attribute17 => L_planning_resource_in_tbl(i).p_attribute17,
p_attribute18 => L_planning_resource_in_tbl(i).p_attribute18,
p_attribute19 => L_planning_resource_in_tbl(i).p_attribute19,
p_attribute20 => L_planning_resource_in_tbl(i).p_attribute20,
p_attribute21 => L_planning_resource_in_tbl(i).p_attribute21,
p_attribute22 => L_planning_resource_in_tbl(i).p_attribute22,
p_attribute23 => L_planning_resource_in_tbl(i).p_attribute23,
p_attribute24 => L_planning_resource_in_tbl(i).p_attribute24,
p_attribute25 => L_planning_resource_in_tbl(i).p_attribute25,
p_attribute26 => L_planning_resource_in_tbl(i).p_attribute26,
p_attribute27 => L_planning_resource_in_tbl(i).p_attribute27,
p_attribute28 => L_planning_resource_in_tbl(i).p_attribute28,
p_attribute29 => L_planning_resource_in_tbl(i).p_attribute29,
p_attribute30 => L_planning_resource_in_tbl(i).p_attribute30,
p_record_version_number => L_planning_resource_in_tbl(i).p_record_version_number,
x_record_version_number => x_planning_resource_out_tbl(i).x_record_version_number,
x_return_status => x_return_status,
x_msg_count => l_msg_count,
x_error_msg_data => l_msg_data);
End Update_Resource_List;
* Procedure : Delete_Resource_List
* Description : AMG API, used to Delete a resource list
* and its corresponding members and formats.
* The detailed information is in the sepc.
*********************************************************/
PROCEDURE Delete_Resource_List(
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_api_version_number IN NUMBER,
P_Res_List_Id IN NUMBER ,
X_Return_Status OUT NOCOPY VARCHAR2,
X_Msg_Count OUT NOCOPY NUMBER,
X_Msg_Data OUT NOCOPY VARCHAR2)
IS
l_api_version_number CONSTANT NUMBER := G_API_VERSION_NUMBER;
l_api_name CONSTANT VARCHAR2(30) := 'Update_Resource_List';
* error when trying to delete a format */
l_err_code := 0;
PA_GET_RESOURCE.delete_resource_list_ok(
p_res_list_id, 'Y', l_err_code, l_msg_data);
* Call to the Delete_Planning_Resources procedure
* to Delete all the members from the pa_resource_list_members
* table. We are passing a table of resource_list_member_id's
* to the procedure.
**************************************************/
/*****************************************************
* First Retrieve all the resource list member id's
* belonging to the resource_list_id passed.
* Bulk collect into a PL/SQL table l_res_list_member_id_tbl.
* ******************************************************/
BEGIN
SELECT resource_list_member_id
BULK COLLECT INTO l_res_list_member_id_tbl
FROM Pa_resource_list_members
WHERE resource_list_id = p_res_list_id;
* Call to API Pa_Planning_Resource_Pvt.Delete_Planning_Resource
* passing the pl/sql table od resource_list_member_id's
* This API would take care of deletion.
********************************************************/
SELECT meaning || ' ' || to_char(i) || ':'
INTO Pa_Planning_Resource_Pvt.g_token
FROM pa_lookups
WHERE lookup_type = 'PA_PLANNING_RESOURCE'
AND lookup_code = 'PLANNING_RESOURCE';
Pa_Planning_Resource_Pvt.Delete_Planning_Resource(
p_resource_list_member_id => l_res_list_member_id_tbl(i),
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_error_msg_data => l_msg_data);
SELECT res_format_id,plan_rl_format_id
BULK COLLECT INTO l_res_format_id_tbl,l_plan_rl_format_id_tbl
FROM Pa_Plan_rl_formats
WHERE resource_list_id = p_res_list_id;
* Call to the Pa_Plan_RL_Formats_Pvt.Delete_Plan_RL_Format API
* to Delete all the formats from the pa_plan_rl_formats
* table. We are passing table elements
**************************************************/
Pa_Plan_RL_Formats_Pvt.Delete_Plan_RL_Format (
P_Res_List_Id => P_res_list_id,
P_Res_Format_Id => l_res_format_id_tbl(i),
P_Plan_RL_Format_Id => l_plan_rl_format_id_tbl(i),
X_Return_Status => l_return_status,
X_Msg_Count => l_msg_count,
X_Msg_Data => l_msg_data);
* table. If it does then ewe cannot delete the record from
* the pa_resource_lists_all_bg table, as corr child members
* are present.
*****************************************************/
BEGIN
SELECT 'Y'
INTO l_exist_res_list
FROM DUAL
WHERE EXISTS
(SELECT 'Y' from pa_resource_list_members
WHERE resource_list_id = P_res_list_id
UNION
SELECT 'Y' from pa_plan_rl_formats
WHERE resource_list_id = P_res_list_id);
PA_CREATE_RESOURCE.Delete_Plan_Res_List (
p_resource_list_id => P_res_list_id,
X_Return_Status => l_return_status,
X_Msg_Count => l_msg_count,
X_Msg_Data => l_msg_data);
END Delete_Resource_List;
* Validate each one of them and insert accordingly.
****************************************************************/
FOR i IN 1..P_Plan_RL_Format_Tbl.COUNT
LOOP
--For bug 3675288.
BEGIN
l_format_exists:='N';
Select 'Y'
Into l_format_exists
From pa_res_formats_b
Where res_format_id=L_Plan_RL_Format_Tbl(i).P_Res_Format_Id;
* Procedure : Delete_Plan_RL_Format
* Description : This procedure is used the pass a Table of
* Record, and call the
* Pa_Plan_RL_Formats_Pvt.Delete_Plan_RL_Format
* procedure, which would Delete the res formats.
* The detailed information is in the spec.
**************************************************************/
Procedure Delete_Plan_RL_Format (
p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
P_Res_List_Id IN NUMBER DEFAULT PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
P_Plan_RL_Format_Tbl IN Plan_RL_Format_In_Tbl ,
X_Return_Status OUT NOCOPY VARCHAR2,
X_Msg_Count OUT NOCOPY NUMBER,
X_Msg_Data OUT NOCOPY VARCHAR2)
IS
L_Plan_RL_Format_Tbl Plan_RL_Format_In_Tbl;
* Validate each one of them and Update accordingly.
****************************************************************/
FOR i IN 1..P_Plan_RL_Format_Tbl.COUNT
LOOP
Pa_Plan_RL_Formats_pvt.Delete_Plan_RL_Format (
P_Res_List_Id =>P_Res_List_Id,
P_Res_Format_Id =>L_Plan_RL_Format_Tbl(i).P_Res_Format_Id,
P_Plan_RL_Format_Id =>Null,
X_Return_Status =>X_Return_Status,
X_Msg_Count =>X_Msg_Count,
X_Msg_Data =>X_Msg_Data);
END Delete_Plan_RL_Format;
* Validate each one of them and insert accordingly.
**************************************************************/
For i IN 1..L_Planning_Resource_In_Tbl.Count
Loop
SELECT meaning || ' ' || to_char(i) || ':'
INTO Pa_Planning_Resource_Pvt.g_token
FROM pa_lookups
WHERE lookup_type = 'PA_PLANNING_RESOURCE'
AND lookup_code = 'PLANNING_RESOURCE';
select count(*) INTO l_validate_resource_code
FROM pa_resource_classes_b
WHERE resource_class_code=L_Planning_resource_in_tbl(i).P_Resource_Class_Code;
select count(*) INTO l_validate_resource_id
FROM pa_resource_classes_b
WHERE resource_class_id=L_Planning_resource_in_tbl(i).P_Resource_Class_id;
SELECT decode(f.RES_TYPE_ENABLED_FLAG, 'Y', t.res_type_code, NULL) ,
decode(f.FIN_CAT_ENABLED_FLAG, 'Y', 'Financial Category', NULL) ,
decode(f.ORGN_ENABLED_FLAG, 'Y', 'Organization', NULL) ,
decode(f.SUPPLIER_ENABLED_FLAG, 'Y', 'Supplier', NULL) ,
decode(f.ROLE_ENABLED_FLAG, 'Y', 'Role', NULL) ,
decode(f.INCURRED_BY_ENABLED_FLAG, 'Y', 'Incurred By', NULL)
INTO
l_resource,
l_financial,
l_organization,
l_supplier,
l_role,
l_incurred
FROM pa_res_formats_b f, pa_res_types_b t
WHERE f.res_format_id = L_Planning_resource_in_tbl(i).P_Res_Format_Id
AND f.RES_TYPE_ID = t.res_type_id(+);
SELECT 'Y'
INTO l_format_exists
FROM pa_plan_rl_formats
WHERE resource_list_id = p_resource_list_id
AND res_format_id = L_planning_resource_in_tbl(i).p_res_format_id;
SELECT 'Y'
INTO l_project_exists
FROM pa_projects_all
WHERE project_id = L_planning_resource_in_tbl(i).p_project_id;
Select resource_class_flag
Into l_res_class_flag
From pa_res_formats_b
Where res_format_id = L_planning_resource_in_tbl(i).p_res_format_id;
* Procedure : Update_Planning_Resource
* Description : The purpose of this procedure is to
* Validate and update attributes on an existing
* planning resource for a resource list.
* The detailed information is in the spec.
******************************************************/
PROCEDURE Update_Planning_Resource
(p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
p_resource_list_id IN NUMBER,
p_enabled_flag IN VARCHAR2,
P_planning_resource_in_tbl IN Planning_Resource_In_Tbl,
X_planning_resource_out_tbl OUT NOCOPY Planning_Resource_Out_Tbl,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_error_msg_data OUT NOCOPY VARCHAR2 )
IS
-- If need to get the resource_list_member_id using the alias then
-- If control_flag <> 'N' from pa_resource_lists_all_bg this means centralized and only need the
-- predicates to resource_list_id and alias to get the resource_list_member_id
-- If the control_flag = 'N' then we need to add predicates for object_type and object_id.
-- The object_type = 'PROJECT' and the object_id is the project_id.
Cursor c1(P_Alias IN Varchar2,
P_Res_List_Id IN Number,
P_Prj_Id IN Number) Is
Select
rlm.Resource_List_Member_Id
From
Pa_Resource_List_Members rlm,
Pa_Resource_Lists_All_BG rl
Where
rlm.Alias = P_Alias
And rlm.Resource_List_Id = P_Res_List_Id
And rlm.Resource_List_Id = rl.Resource_List_Id
And ( rl.Control_Flag <> 'N' Or
( rl.Control_Flag = 'N' And
rlm.Object_Type = 'PROJECT' And
rlm.Object_Id = P_Prj_Id) );
Select
Record_Version_Number
From
Pa_Resource_List_Members
Where
Resource_List_Member_Id = P_rlm_Id;
SELECT meaning || ' ' || to_char(i) || ':'
INTO Pa_Planning_Resource_Pvt.g_token
FROM pa_lookups
WHERE lookup_type = 'PA_PLANNING_RESOURCE'
AND lookup_code = 'PLANNING_RESOURCE';
savepoint planning_res_list_update;
pa_planning_resource_pvt.Update_Planning_Resource(
p_resource_list_id => p_resource_list_id,
p_resource_list_member_id => l_rlm_id,
p_enabled_flag => p_enabled_flag,
p_resource_alias => P_planning_resource_in_tbl(i).p_resource_alias,
p_spread_curve_id => P_planning_resource_in_tbl(i).p_spread_curve_id,
p_etc_method_code => P_planning_resource_in_tbl(i).p_etc_method_code,
p_mfc_cost_type_id => P_planning_resource_in_tbl(i).p_mfc_cost_type_id,
p_attribute_category => P_planning_resource_in_tbl(i).p_attribute_category,
p_attribute1 => P_planning_resource_in_tbl(i).p_attribute1,
p_attribute2 => P_planning_resource_in_tbl(i).p_attribute2,
p_attribute3 => P_planning_resource_in_tbl(i).p_attribute3,
p_attribute4 => P_planning_resource_in_tbl(i).p_attribute4,
p_attribute5 => P_planning_resource_in_tbl(i).p_attribute5,
p_attribute6 => P_planning_resource_in_tbl(i).p_attribute6,
p_attribute7 => P_planning_resource_in_tbl(i).p_attribute7,
p_attribute8 => P_planning_resource_in_tbl(i).p_attribute8,
p_attribute9 => P_planning_resource_in_tbl(i).p_attribute9,
p_attribute10 => P_planning_resource_in_tbl(i).p_attribute10,
p_attribute11 => P_planning_resource_in_tbl(i).p_attribute11,
p_attribute12 => P_planning_resource_in_tbl(i).p_attribute12,
p_attribute13 => P_planning_resource_in_tbl(i).p_attribute13,
p_attribute14 => P_planning_resource_in_tbl(i).p_attribute14,
p_attribute15 => P_planning_resource_in_tbl(i).p_attribute15,
p_attribute16 => P_planning_resource_in_tbl(i).p_attribute16,
p_attribute17 => P_planning_resource_in_tbl(i).p_attribute17,
p_attribute18 => P_planning_resource_in_tbl(i).p_attribute18,
p_attribute19 => P_planning_resource_in_tbl(i).p_attribute19,
p_attribute20 => P_planning_resource_in_tbl(i).p_attribute20,
p_attribute21 => P_planning_resource_in_tbl(i).p_attribute21,
p_attribute22 => P_planning_resource_in_tbl(i).p_attribute22,
p_attribute23 => P_planning_resource_in_tbl(i).p_attribute23,
p_attribute24 => P_planning_resource_in_tbl(i).p_attribute24,
p_attribute25 => P_planning_resource_in_tbl(i).p_attribute25,
p_attribute26 => P_planning_resource_in_tbl(i).p_attribute26,
p_attribute27 => P_planning_resource_in_tbl(i).p_attribute27,
p_attribute28 => P_planning_resource_in_tbl(i).p_attribute28,
p_attribute29 => P_planning_resource_in_tbl(i).p_attribute29,
p_attribute30 => P_planning_resource_in_tbl(i).p_attribute30,
p_record_version_number => p_planning_resource_in_tbl(i).p_record_version_number,
x_record_version_number => x_planning_resource_out_tbl(i).x_record_version_number,
x_return_status => x_return_status,
x_msg_count => x_msg_count ,
x_error_msg_data => x_error_msg_data);
RollBack to planning_res_list_update;
RollBack to planning_res_list_update;
End Update_Planning_Resource;
* Procedure : Delete_Planning_Resource
* Description : The purpose of this procedure is to
* delete a planning resource if it is not
* being used, else disable it.
* Further details in the Body.
* The detailed information is in the spec.
***************************************************/
PROCEDURE Delete_Planning_Resource(
p_resource_list_member_id IN SYSTEM.PA_NUM_TBL_TYPE,
p_commit IN VARCHAR2,
p_init_msg_list IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_error_msg_data OUT NOCOPY VARCHAR2)
IS
BEGIN
Pa_Planning_Resource_Pvt.g_amg_flow := 'Y';
SELECT meaning || ' ' || to_char(i) || ':'
INTO Pa_Planning_Resource_Pvt.g_token
FROM pa_lookups
WHERE lookup_type = 'PA_PLANNING_RESOURCE'
AND lookup_code = 'PLANNING_RESOURCE';
pa_planning_resource_pvt.delete_planning_resource
(p_resource_list_member_id =>p_resource_list_member_id(i),
x_return_status =>x_return_status,
x_msg_count =>x_msg_count,
x_error_msg_data =>x_error_msg_data);
END Delete_Planning_Resource;
G_Plan_RL_format_In_Tbl.DELETE;
G_Plan_RL_format_Out_Tbl.DELETE;
G_Planning_resource_In_tbl.DELETE;
G_Planning_resource_Out_tbl.DELETE;
* Procedure : Init_Update_Resource_List
* Description : This procedure initializes the global
* temporary tables for the resource list,
* resource formats and,
* resoure list members.
* The detailed information is in the spec.
******************************************************/
PROCEDURE Init_Update_Resource_List
IS
l_api_name CONSTANT VARCHAR2(30) := 'Init_Update_Resource_List';
G_Plan_RL_format_In_Tbl.DELETE;
G_Plan_RL_format_Out_Tbl.DELETE;
G_Planning_resource_In_tbl.DELETE;
G_Planning_resource_Out_tbl.DELETE;
END Init_Update_Resource_List;
* Procedure : Exec_Update_Resource_List
* Description : This procedure passes the PL/SQL
* globals to the Update_Resource_List API.
* The API is typically used with the
* load-execute-fetch model.
* The detailed information is in spec.
***************************************************/
PROCEDURE Exec_Update_Resource_List
(p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_api_version_number IN NUMBER,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2
)
IS
l_api_version_number CONSTANT NUMBER := G_API_VERSION_NUMBER;
l_api_name CONSTANT VARCHAR2(30) := 'Exec_Update_Resource_List';
Update_Resource_List
(p_commit => p_commit,
p_init_msg_list => p_init_msg_list,
p_api_version_number => p_api_version_number,
P_plan_res_list_Rec => G_Plan_Res_List_IN_Rec,
X_plan_res_list_Rec => G_Plan_Res_List_Out_Rec,
P_Plan_RL_Format_Tbl => G_Plan_RL_format_In_Tbl,
X_Plan_RL_Format_Tbl => G_Plan_RL_format_Out_Tbl,
P_planning_resource_in_tbl => G_Planning_resource_in_tbl,
X_planning_resource_out_tbl => G_Planning_resource_out_tbl,
X_Return_Status => x_return_status,
X_Msg_Count => x_msg_count,
X_Msg_Data => x_msg_data);
END Exec_Update_Resource_List;