Create Grade API

PROCEDURE XXHR_CREATE_grade
/* =====================================================================
— NAME : XXHR_CREATE_grade

— PROGRAM TYPE : Procedure

— DESCRIPTION : This is used to craete grade
— INPUTS : None
— OUTPUTS : None
— ===================================================================*/
IS

CURSOR cur_grade
IS
SELECT *
FROM xxhr_grade_stg
WHERE process_flag IS NULL;

l_grade_id NUMBER := NULL;
l_object_version_number NUMBER := NULL;
l_grade_definition_id NUMBER := NULL;
l_name VARCHAR2 (500) := NULL;
l_err_msg VARCHAR2 (500) := NULL;
BEGIN

for r_grade in cur_grade
loop

BEGIN
HR_GRADE_API.create_grade (
p_validate => FALSE,
p_business_group_id => fnd_profile.value(‘PER_BUSINESS_GROUP_ID’),–82, — Business Group ID
p_date_from => TO_DATE (’01-JAN-1950′, ‘DD-MON-YYYY’),
p_sequence => 22,
— p_date_to => TO_DATE (’31-DEC-4312′, ‘DD-MON-YYYY’),
p_segment1 => 22, — Segments Defined in Grade KFF
p_grade_id => l_grade_id,
p_object_version_number => l_object_version_number,
p_grade_definition_id => l_grade_definition_id,
p_name => l_name
);

UPDATE xxhr_grade_stg
SET PROCESS_FLAG = ‘S’
WHERE record_no = r_grade.record_no;
EXCEPTION
WHEN OTHERS
THEN
l_err_msg := SQLERRM;
— DBMS_OUTPUT.put_line (‘Inner Exception: ‘ || l_err_msg);
UPDATE xxhr_grade_stg
SET PROCESS_FLAG = ‘E’,
error_msg =l_err_msg
WHERE record_no = r_grade.record_no;
END;

end loop;
commit;
END XXHR_CREATE_grade;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s