Search This Blog

Sunday, May 12, 2013

pa_project_pub.update_task


Script to Update Oracle Project Tasks: pa_project_pub.update_task

DECLARE
l_msg_count NUMBER;
l_msg_data VARCHAR2 (2000);
l_return_status VARCHAR2 (1);
l_pm_product_code VARCHAR2 (10);
l_out_pa_task_id NUMBER;
l_out_pm_task_reference VARCHAR2 (2000);
l_output VARCHAR2 (2000);
l_msg_dummy VARCHAR2 (2000);
api_error EXCEPTION;
n NUMBER := 0;
l_pa_project_id NUMBER := :project_id;
BEGIN
pa_interface_utils_pub.set_global_info (p_api_version_number => 1.0,
p_responsibility_id => :Responsibility_id,
p_user_id => :User_id,
p_msg_count => l_msg_count,
p_msg_data => l_msg_data,
p_return_status => l_return_status
);
pa_project_pub.update_task
(p_api_version_number => '1.0',
p_commit => 'F',
p_init_msg_list => 'F',
p_msg_count => l_msg_count,
p_msg_data => l_msg_data,
p_return_status => l_return_status,
p_pm_product_code => l_pm_product_code,
p_pa_project_id => l_pa_project_id,
p_pa_task_id => :pa_task_id,
-- p_task_description => 'TEST DESC1',
p_tasks_dff => 'N',
p_out_pa_task_id => l_out_pa_task_id,
p_out_pm_task_reference => l_out_pm_task_reference
);
COMMIT;

IF l_return_status <> 'S'
THEN
FOR n IN 1 .. l_msg_count
LOOP
fnd_msg_pub.get (n, fnd_api.g_false, l_msg_data, l_msg_dummy);
l_output := (TO_CHAR (n) || ': ' || l_msg_data);
DBMS_OUTPUT.put_line
( 'Error: API Error while updating the Task: '
|| l_output
);
COMMIT;
END LOOP;
ELSE
DBMS_OUTPUT.put_line ('Sucessfully Update the task');
COMMIT;
END IF;
EXCEPTION
WHEN api_error
THEN
DBMS_OUTPUT.put_line ('API Error in Project: ');
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Other Error in Project: ' || SQLERRM);
END;

No comments:

Post a Comment