Compile Fast Formula from Pl/SQL

By | July 20, 2015

In this article of Oracle HRMS Overview, I am sharing the way to compile a fast formula from back end.  Normally it is not much needed functionality. But there could be a situation when you want to compile a list of fast formulas from back end or system might starts getting hang when you open application. In such cases you can use this code to compile oracle HRMS fast formula using PL SQL.

Find the Working copy of code. Only you need to change the values mentioned in red color.

DECLARE
p_formula_type_name VARCHAR2(100) := ‘Oracle Payroll’;
p_formula_name VARCHAR2(100) := ‘XXLSG_EARNED_LEAVE_ACCRUAL‘;
lv_req_id NUMBER(15) := NULL;
lv_phase VARCHAR2(50) := NULL;
lv_status VARCHAR2(50) := NULL;
lv_dev_phase VARCHAR2(50) := NULL;
lv_dev_status VARCHAR2(50) := NULL;
lv_message VARCHAR2(4000) := NULL;
lv_request_complete BOOLEAN := FALSE;
le_error EXCEPTION;

BEGIN
Fnd_Global.APPS_INITIALIZE(user_id =>45274,
resp_id =>50808,
resp_appl_id =>800);

lv_req_id := Fnd_Request.submit_request
( application => ‘FF’
, program => ‘SINGLECOMPILE’
, sub_request => FALSE
, argument1 => p_formula_type_name
, argument2 => p_formula_name
);

COMMIT;

dbms_output.put_line(‘lv_req_id ‘||lv_req_id );

IF lv_req_id = 0 THEN
dbms_output.put_line(‘Error: Unable to submit formula compilation’);
END IF;
dbms_output.put_line(‘Successfully submitted’);

— Now wait for job to complete
lv_request_complete := fnd_concurrent.wait_for_request
( request_id => lv_req_id
, max_wait => 7200
, phase => lv_phase
, status => lv_status
, dev_phase => lv_dev_phase
, dev_status => lv_dev_status
, message => lv_message
);

IF lv_request_complete AND  lv_phase = ‘Completed’ AND
lv_status = ‘Normal’
THEN
dbms_output.put_line(‘Formula compilation successfully completed’);
ELSIF NOT lv_request_complete OR lv_status = ‘Error’  THEN
dbms_output.put_line(‘Formula compilation completed in Error’);
END IF;
EXCEPTION

WHEN others  THEN
dbms_output.put_line(‘Exception ‘ ||SQLERRM);
END ;

HRMS Training

Related Posts

Oracle HRMS Training to Start
9 Steps to Become Apps Consultant
Problems Faced by Beginners
Interview Preparation Material
Free Online Assessment of your skills