---- 创建任务
DECLAREp_project_id NUMBER := 155233;p_task_number VARCHAR2(240) := 'CXYTEST0001';p_task_name VARCHAR2(240) := '接口测试CXYTEST0001';p_task_description VARCHAR2(240) := 'TASKCXYTEST0001';p_scheduled_start_date DATE := SYSDATE + 1;p_scheduled_finish_date DATE := SYSDATE + 10;P_PARENT_TASK_ID NUMBER := 244637;--x_return_status VARCHAR2(240);x_msg_count NUMBER;x_msg_data VARCHAR2(30000);x_project_id NUMBER;x_project_number VARCHAR2(240);x_task_id NUMBER;l_msg_index NUMBER;
BEGINfnd_global.apps_initialize(user_id => 0,resp_id => 52998,resp_appl_id => 275);mo_global.init('M');pa_project_pub.add_task(p_api_version_number => 1.0,p_init_msg_list => 'T',p_msg_count => x_msg_count,p_msg_data => x_msg_data,p_return_status => x_return_status,p_pm_product_code => NULL,p_pa_project_id => p_project_id,p_pm_task_reference => p_task_number,p_pa_task_number => p_task_number,p_task_name => p_task_name,p_task_description => p_task_description,p_scheduled_start_date => p_scheduled_start_date,p_scheduled_finish_date => p_scheduled_finish_date,p_pa_parent_task_id => p_parent_task_id,p_pa_project_id_out => x_project_id,p_pa_project_number_out => x_project_number,p_task_id => x_task_id);dbms_output.put_line('x_project_id: ' || x_project_id);dbms_output.put_line('x_project_number: ' || x_project_number);dbms_output.put_line('x_task_id: ' || x_task_id);dbms_output.put_line('x_msg_data: ' || x_msg_data);dbms_output.put_line('x_return_status: ' || x_return_status);dbms_output.put_line('x_msg_count: ' || x_msg_count);FOR i IN 1 .. fnd_msg_pub.count_msg LOOPfnd_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;