-- 创建资源
DECLARE
p_project_id NUMBER := 155233;
p_task_id NUMBER := 244639;
p_resource_list_member_id NUMBER := 2023;
p_planned_quantity NUMBER := 101;
p_pm_task_asgmt_reference VARCHAR2(240) := 'CXYTEST0001';
p_task_assignments_in pa_task_assignments_pub.assignment_in_tbl_type;
p_task_assignments_out pa_task_assignments_pub.assignment_out_tbl_type;
--
x_return_status VARCHAR2(240);
x_msg_count NUMBER;
l_msg_index NUMBER;
x_msg_data VARCHAR2(30000);
BEGIN
fnd_global.apps_initialize(user_id => 0
,resp_id => 52998
,resp_appl_id => 275);
mo_global.init('M');
p_task_assignments_in(1).pa_project_id := p_project_id;
-- p_task_assignments_in(1).pa_structure_version_id := 353108;
p_task_assignments_in(1).pa_task_id := p_task_id;
p_task_assignments_in(1).resource_list_member_id := p_resource_list_member_id;
p_task_assignments_in(1).planned_quantity := p_planned_quantity;
p_task_assignments_in(1).pm_task_asgmt_reference := p_pm_task_asgmt_reference;
pa_task_assignments_pub.create_task_assignments(p_api_version_number => 1.0
,p_pm_product_code => 'pjm'
,p_pa_project_id => p_project_id
,p_task_assignments_in => p_task_assignments_in
,p_task_assignments_out => p_task_assignments_out
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data
,x_return_status => x_return_status);
dbms_output.put_line('x_msg_count: ' || x_msg_count);
dbms_output.put_line('x_msg_data: ' || x_msg_data);
dbms_output.put_line('x_return_status: ' || x_return_status);
FOR i IN 1 .. fnd_msg_pub.count_msg LOOP
fnd_msg_pub.get(p_msg_index => i
,p_encoded => fnd_api.g_false
,p_data => x_msg_data
,p_msg_index_out => l_msg_index);
dbms_output.put_line('x_msg_data: ' || x_msg_data);
END LOOP;
END;