The following lines contain the word 'select', 'insert', 'update' or 'delete':
select pa_workflow_itemkey_s.nextval
into PA_AUTOALLOC_WF_PKG.PA_item_key
from dual;
v_LAST_UPDATE_LOGIN Number;
v_LAST_UPDATED_BY Number;
v_LAST_UPDATED_BY := WF_ENGINE.GetItemAttrNumber(itemtype => v_gl_item_type,
itemkey => v_gl_item_key,
aname => 'LAST_UPDATED_BY');
v_LAST_UPDATE_LOGIN := WF_ENGINE.GetItemAttrNumber
(itemtype => v_gl_item_type,
itemkey => v_gl_item_key,
aname => 'LAST_UPDATE_LOGIN');
aname => 'LAST_UPDATED_BY',
avalue => v_LAST_UPDATED_BY);
WriteDebugMsg('Attribute LAST_UPDATED_BY = ' ||to_char(v_LAST_UPDATED_BY));
aname => 'LAST_UPDATE_LOGIN',
avalue => v_LAST_UPDATE_LOGIN);
WriteDebugMsg('Attribute LAST_UPDATE_LOGIN = '
||to_char(v_LAST_UPDATE_LOGIN));
'DF' or 'IP' so Delete Draft before restart**/
v_allocation_run_id := WF_ENGINE.GetItemAttrNumber(p_item_type,
p_item_key,
'ALLOCATION_RUN_ID');
G_Err_Stage:='Delete Draft before submitting Allocation Concurrent Process';
PA_ALLOC_RUN.Delete_ALLOC_TXNS (v_rule_id,
v_allocation_run_id);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
/** This function submits Concurrent Process to Update Project Summary Amounts.This is called from PA Step down Allocation Work Flow **/
PROCEDURE Submit_Conc_Sum( p_item_type IN VARCHAR2,
p_item_key IN VARCHAR2,
p_actid IN NUMBER,
p_funcmode IN VARCHAR2,
p_result OUT NOCOPY VARCHAR2) Is
v_request_id NUMBER;
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
select run_status,target_exp_group,offset_exp_group
into v_run_status,v_target_exp_group,v_offset_exp_group
from pa_alloc_runs_all
where run_id = v_allocation_run_id;
PA_ALLOC_RUN.Delete_ALLOC_TXNS (v_rule_id,
v_allocation_run_id);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
/** Select target_exp_group and offset_exp_group in NORMAL mode and
rev_target_exp_group and rev_offset_exp_group in ROLLBACK mode **/
select decode (v_operating_mode,'N',target_exp_group,
rev_target_exp_group),
decode (v_operating_mode, 'N',offset_exp_group,
rev_offset_exp_group)
into v_target_exp_group,v_offset_exp_group
from pa_alloc_runs_all
where run_id = v_allocation_run_id;
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
v_last_updated_by Number;
v_last_update_login Number;
Select tl.USER_CONCURRENT_PROGRAM_NAME
From fnd_concurrent_programs_tl tl,
fnd_concurrent_programs cp
Where cp.APPLICATION_ID = 275
AND cp.CONCURRENT_PROGRAM_NAME = p_prog_code
AND tl.CONCURRENT_PROGRAM_ID = cp.concurrent_program_id
AND tl.APPLICATION_ID = 275
AND tl.LANGUAGE = NVL(v_userenv_lang,'US');
v_last_updated_by := WF_ENGINE.GetItemAttrNumber
(PA_item_type,
PA_item_key,
'LAST_UPDATED_BY');
v_last_update_login := WF_ENGINE.GetItemAttrNumber
(PA_item_type,
PA_item_key,
'LAST_UPDATE_LOGIN');
WriteDebugMsg('Inserting req id = '||to_char(v_request_id)||
' into histroy detail');
GL_AUTO_ALLOC_WF_PKG.INSERT_BATCH_HIST_DET(
p_REQUEST_ID => v_request_id
,p_PARENT_REQUEST_ID => v_set_req_id
,p_STEP_NUMBER => v_step_number
,p_PROGRAM_NAME_CODE => p_prog_code
,p_RUN_MODE => v_operating_mode
,p_allocation_type => 'PA'
,p_created_by => v_created_by
,p_last_updated_by => v_last_updated_by
,p_last_update_login => v_last_update_login);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
/** This procedure deletes an allocation run given a rule_id and a run_id**/
Procedure Delete_Alloc_Run( p_item_type IN VARCHAR2,
p_item_key IN VARCHAR2,
p_actid IN NUMBER,
p_funcmode IN VARCHAR2,
p_result OUT NOCOPY VARCHAR2) IS
v_rule_id Number;
Set_PA_WF_Stack(p_item_type,p_item_key,'Delete_Alloc_Run');
PA_ALLOC_RUN.Delete_ALLOC_TXNS (v_rule_id,
v_allocation_run_id);
Wf_Core.Context('PA_AUTOALLOC_WF_PKG', 'DELETE_ALLOC_RUN', p_item_type, p_item_key);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
End Delete_Alloc_Run;
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
WriteDebugMsg('Updated Status Code Value = '||v_status_code);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
WriteDebugMsg('Updated Status Code Value = '||v_status_code);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
select run_status,run_id
into v_run_status,v_run_id
from PA_ALLOC_RUNS_ALL
where rule_id = v_batch_id
and draft_request_id = v_conc_request_id;
WriteDebugMsg('Calling GL API to update PA_ALLOCATION_RUN_ID');
WriteDebugMsg('Run ID could not be updated for request ID: '
||to_char(v_conc_request_id)||' and step number: '||
to_char(v_step_number));
WriteDebugMsg('GL_AUTO_ALLOC_BAT_HIST_DET updated with RUN_ID');
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
select run_status
into v_run_status
from PA_ALLOC_RUNS_ALL
where rule_id = v_batch_id
and release_request_id = v_conc_request_id;
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
select 'RELEASED'
into v_result
from PA_ALLOC_RUNS_ALL
where run_id = v_allocation_run_id
and run_status = 'RS';
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
select 'FAIL'
into v_result
From dual
where exists (select 'Y'
from PA_Expenditure_Items_All EI,
PA_Expenditures_All ES
where ES.expenditure_group = v_expenditure_group
and EI.expenditure_item_id = ES.expenditure_id
and EI.cost_distributed_flag||'' = 'N'
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,v_status_code
);
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
select 'FAIL'
into v_summarization_status
from dual
where exists
(select 'Exception'
from pa_projects_for_accum
where request_id = p_request_id
and exception_flag = 'Y');
GL_AUTO_ALLOC_WF_PKG.Update_Status(v_set_req_id
,v_step_number
,'UFE'
);
SELECT TRANSLATE(LTRIM(value),',',' ')
INTO TEMP_UTL
FROM v$parameter
WHERE name = 'utl_file_dir';
SELECT SUBSTRB(TEMP_UTL, 1, INSTR(TEMP_UTL,' ') - 1)
INTO TEMP_DIR
FROM dual ;