DECLARE
l_msg_count NUMBER;
l_msg_data VARCHAR2 (2000);
l_return_status VARCHAR2 (1);
l_out_pa_task_id NUMBER;
l_out_pm_task_reference VARCHAR2 (2000);
l_output VARCHAR2 (2000);
l_msg_dummy VARCHAR2 (2000);
n NUMBER := 0;
l_pm_product_code VARCHAR2 (10):= 'GMS';
l_pa_project_id NUMBER := 3432;
l_task_id NUMBER := 23432;
--> variables needed for
Oracle Project specific parameters
l_user_id NUMBER;
l_responsibility_id NUMBER;
BEGIN
--> SET GLOBAL INFO
SELECT user_id,
responsibility_id
INTO l_user_id,
l_responsibility_id
FROM pa_user_resp_v
WHERE 1=1
and user_name = 'OPERATIONS'
and RESPONSIBILITY_name =
'Project Billing Super
User'
;
PA_INTERFACE_UTILS_PUB.SET_GLOBAL_INFO ( p_api_version_number => 1.0
,p_responsibility_id => l_responsibility_id
,p_user_id => l_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 => 'T',
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 => l_task_id,
p_tasks_dff => 'Y',
p_attribute3 => TO_DATE (SYSDATE, 'YYYY/MM/DD HH24:MI:SS'),
p_attribute4 => TO_DATE (SYSDATE, 'YYYY/MM/DD HH24:MI:SS'),
p_out_pa_task_id => l_out_pa_task_id,
p_out_pm_task_reference => l_out_pm_task_reference
);
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 while updating the Task
: ' || l_output);
END LOOP;
ELSE
DBMS_OUTPUT.put_line
('Sucessfully Update the task,
Task ID is : '|| l_out_pa_task_id);
COMMIT;
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line
('Other Error in Project: ' || SQLERRM);
END;
1 comment:
declare
l_api_version_number NUMBER := 1.0;
l_commit VARCHAR2(1) := 'F';
l_return_status VARCHAR2(1);
l_init_msg_list VARCHAR2(1);
l_msg_count NUMBER;
l_msg_data VARCHAR2(2000);
l_errbuf VARCHAR2(20000);
l_pm_product_code VARCHAR2(10);
l_pa_project_id_out NUMBER(15);
l_pa_project_number_out VARCHAR2(25);
l_task_id NUMBER(15);
X_task_number VARCHAR2(20);
X_return_status varchar2(20);
X_TASK_ID number;
begin
DBMS_OUTPUT.put_line('Before procedure call: X_task_number = ' || X_task_number);
pa_project_pub.add_task
( p_api_version_number => l_api_version_number--
, p_commit => l_commit--
, p_init_msg_list => l_init_msg_list
, p_msg_count => l_msg_count
, p_msg_data => l_msg_data
, p_return_status => l_return_status
, p_pm_product_code => 'GMS'
, p_pm_project_reference => 'khr_123'
, p_pa_project_id => 100636
, p_pm_task_reference => X_task_number
, p_pa_task_number => 1
, p_task_name => 'Structure Asset 1'
, p_task_description => 'Description for Task 2'
, p_pa_project_id_out => l_pa_project_id_out
, p_pa_project_number_out => l_pa_project_number_out
, p_task_id => l_task_id
);
X_task_id := l_task_id;
X_return_status := l_return_status;
DBMS_OUTPUT.put_line('Task Reference: ' || X_task_number);
IF l_return_status = 'S' THEN
dbms_output.put_line('Task ID: ' || l_task_id);
ELSE
dbms_output.put_line('Error: ' || sqlerrm||' '||l_return_status||' '||X_task_number);
END IF;
end;
correct this code and give answer
Post a Comment