Monday 30 March 2020

Script to update pa deliverable (pa_project_pub.update_deliverable)

Declare

l_api_version_number          NUMBER := 1.0;
l_init_msg_list VARCHAR2 (1) := 'F';
l_commit VARCHAR2 (1) := 'F';
l_debug_mode VARCHAR2 (1) := 'N';
l_return_status                VARCHAR2 (1);
l_completion_date  DATE;
l_deliverable_id              NUMBER;
l_proj_source_reference        pa_proj_elements.pm_source_reference%TYPE  := 'PGL_CONVERSION'; --pa_deliverables_v.pm_source_reference
    l_action_in                    pa_project_pub.action_in_tbl_type;
    l_action_out                  pa_project_pub.action_out_tbl_type;
l_pm_source_code              pa_proj_elements.pm_source_code%TYPE := NULL;
l_msg_count                    NUMBER := 0;
l_msg_data                    VARCHAR2 (4000);
v_msg_data          VARCHAR2(4000);
l_pgld_error_count            NUMBER := 0;
    l_msg_dummy                    VARCHAR2 (4000);
g_enter                        VARCHAR2 (10) := CHR (10);


BEGIN

fnd_file.put_line (fnd_file.LOG,'nuan_deliverable_upd start');

l_deliverable_id := 4964900;--5103921; pa_deliverables_v.proj_element_id

        fnd_global.apps_initialize ( 120865--p_user_id
                                , 57461--l_resp_id
                                , 275--- l_appln_id
                                 );


fnd_file.put_line (fnd_file.LOG,'l_deliverable_id:'||l_deliverable_id);
fnd_file.put_line (fnd_file.LOG,'pa_project_pub.update_deliverable start');

pa_project_pub.update_deliverable (
  p_api_version                    => l_api_version_number
, p_init_msg_list                  => l_init_msg_list
, p_commit                        => l_commit
, p_debug_mode                    => l_debug_mode
, x_return_status                  => l_return_status
, p_deliverable_name              => 'Upgrade Provider sss test1'--c_project_rec.name  || l_prefix --pa_deliverables_v.element_name
, p_deliverable_short_name        => 'Training sss test1'--c_project_rec.short_name || l_prefix --pa_deliverables_v.element_number
, p_deliverable_type_id            => 10000--10020--v_deliverable_type_id_pgl --pa_deliverables_v.dlvr_type_id
, p_deliverable_owner_id          => 88733--c_project_rec.project_manager_id --pa_deliverables_v.manager_person_id
, p_description                    => 'QTY 70 days of Upgrade Provider Training @ $2,000 ea = $140,000 sss test1'--c_project_rec.description ----pa_deliverables_v.manager_person_id
, p_status_code                    => 'DLVR_IN_PROGRESS'--'DLVR_COMPLETED'--NULL -- c_project_rec.status_code --pa_deliverables_v.deliverable_system_status_code
, p_due_date                      => NULL--'23-MAR-2020'--l_completion_date
, p_completion_date                => NULL--'23-MAR-2020'--NULL
, px_deliverable_id                => l_deliverable_id
, p_pm_deliverable_reference      => l_proj_source_reference
, p_project_id                    => 331512--334827--c_project_rec.project_id --pa_deliverables_v.project_id
, p_action_in_tbl                  => l_action_in
, x_action_out_tbl                => l_action_out
, p_pm_source_code                => l_pm_source_code
, x_msg_count                      => l_msg_count
, x_msg_data                      => l_msg_data
);

commit;

fnd_file.put_line (fnd_file.LOG,'l_return_status:'||l_return_status);
fnd_file.put_line (fnd_file.LOG,'l_deliverable_id:'||l_deliverable_id);

IF l_return_status <> 'S' THEN
l_pgld_error_count :=   l_pgld_error_count + 1;

fnd_msg_pub.get (p_msg_index          => 1
, p_encoded            => 'F'
, p_data                => l_msg_data
, p_msg_index_out      => l_msg_dummy
);

l_msg_data := SUBSTR (l_msg_data, 1, 250);
fnd_file.put_line (fnd_file.LOG,'l_msg_data:'||l_msg_data);
v_msg_data := v_msg_data || g_enter || l_msg_data;
fnd_file.put_line (fnd_file.LOG,'v_msg_data:'||v_msg_data);
ELSE

fnd_file.put_line (fnd_file.LOG,'Deliverable updated successfully for deliverable_id:'||l_deliverable_id);
END IF;

END;

No comments:

Post a Comment