Вы находитесь на странице: 1из 6

http://www.hcmaces.com/forums/ubbthreads7/ubbthreads.

php/topics/5520/all/Create_absen
ce_via_pl_sql_scri

---------------------simple Absence------------------------------
01 - Creation of the Element Type:
Code
apps.pay_element_types_api.create_element_type (
p_effective_date => V_DATE_EFFECTIVE
,p_classification_id => v_classification_id10
,p_element_name => V_NAME||' Element'
,p_input_currency_code =>
v_input_currency_code10
,p_output_currency_code =>
v_output_currency_code10
,p_multiple_entries_allowed_fla =>
v_multi_entry_allowed_flag10
,p_processing_type => v_processing_type10
,p_business_group_id => V_BUSINESS_GROUP_ID
,p_post_termination_rule =>
v_post_termination_rule10
,p_process_in_run_flag =>
v_process_in_run_flag10
,p_processing_priority =>
v_processing_priority10
,p_iterative_flag => v_iterative_flag10
,p_grossup_flag => v_grossup_flag10
,p_process_mode => v_process_mode10
,p_element_type_id => v_element_type_id10
,p_effective_start_date =>
v_effective_start_date10
,p_effective_end_date =>
v_effective_end_date10
,p_object_version_number =>
v_object_version_number10
,p_comment_id =>
v_comment_id10
,p_processing_priority_warning =>
v_process_priority_warning10
);

02 - Add input value for the element:


Code
apps.pay_input_value_api.create_input_value (
p_effective_date => V_DATE_EFFECTIVE
,p_element_type_id => v_element_type_id11
,p_name => v_name11
,p_uom => v_uom11
,p_display_sequence => v_display_sequence11
,p_input_value_id =>
v_input_value_id11
,p_object_version_number =>
v_object_version_number11
,p_effective_start_date =>
v_effective_start_date11
,p_effective_end_date =>
v_effective_end_date11
,p_default_val_warning =>
v_default_val_warning11
,p_min_max_warning => v_min_max_warning11
,p_pay_basis_warning => v_pay_basis_warning11
,p_formula_warning => v_formula_warning11
,p_assignment_id_warning =>
v_assignment_id_warning11
,p_formula_message => v_formula_message11
);

03 - Creation of the Element Link:


Code
apps.pay_element_link_api.create_element_link (
p_effective_date => V_DATE_EFFECTIVE
,p_element_type_id => v_element_type_id20
,p_business_group_id => V_BUSINESS_GROUP_ID
,p_costable_type => 'N'
,p_link_to_all_payrolls_flag => 'Y'
,p_standard_link_flag => 'N'
,p_cost_concat_segments => NULL
,p_balance_concat_segments => NULL
,p_element_link_id =>
v_element_link_id20
,p_comment_id =>
v_comment_id20
,p_object_version_number =>
v_object_version_number20
,p_effective_start_date =>
v_effective_start_date20
,p_effective_end_date =>
v_effective_end_date20
);

04 - Creation of the Absence Type:


Code
apps.hr_absence_type_api.create_absence_type (
p_language_code => 'US'
,p_business_group_id => V_BUSINESS_GROUP_ID
,p_input_value_id => v_input_value_id30
,p_date_effective => V_DATE_EFFECTIVE
,p_date_end => v_date_end30
,p_name => V_NAME
,p_absence_category => v_absence_category30
,p_hours_or_days => 'H'
,p_inc_or_dec_flag => 'I'
,p_absence_overlap_flag => 'N'
,p_absence_attendance_type_id =>
v_abs_attendance_type_id30
,p_object_version_number =>
v_object_version_number30
);

05 - Association between Absence Type and Absence Reason:


Code
APPS.PER_ABS_ATTENDANCE_REASONS_PKG.Insert_Row (
X_Rowid => v_Rowid310
,X_Abs_Attendance_Reason_Id =>
v_Abs_attendance_reason_id310
,X_Business_Group_Id => V_BUSINESS_GROUP_ID
,X_Absence_Attendance_Type_Id =>
v_abs_attendance_type_id310
,X_Name => v_name310
,X_Last_Update_Date => SYSDATE
,X_Last_Updated_By => NULL
,X_Last_Update_Login => NULL
,X_Created_By => NULL
,X_Creation_Date => V_DATE_EFFECTIVE
);

-----------------Absence With Accrual Plan----------------------


06 - Creation of the Fast Fromula:
Code
apps.ff_formulas_f_pkg.insert_row (
X_Rowid => v_Rowid40
,X_Formula_Id => v_Formula_Id40
,X_Effective_Start_Date => V_DATE_EFFECTIVE
,X_Effective_End_Date => to_date('31-DEC-
4712')
,X_Business_Group_Id => V_BUSINESS_GROUP_ID
,X_Legislation_Code => NULL
,X_Formula_Type_Id => v_Formula_Type_Id40
,X_Formula_Name => v_Formula_Name40
,X_Description => v_Description40
,X_Formula_Text => v_Formula_Text40
,X_Sticky_Flag => NULL
,X_Last_Update_Date => v_Last_Update_Date40
);

07 - Verification of the Fast Formula:


Code
v_request_id41 := apps.fnd_request.submit_request (
application => 'FF'
,program => 'SINGLECOMPILE'
,sub_request => FALSE
,argument1 => V_FORMULA_TYPE_NAME
,argument2 => v_Formula_Name40
);
v_request_complete41 := apps.fnd_concurrent.wait_for_request
( request_id => v_request_id41
, INTERVAL => 5
, max_wait => 10
, phase => v_phase41
, status => v_status41
, dev_phase => v_dev_phase41
, dev_status => v_dev_status41
, message => v_message41
);

08 - Creation of the Accrual Plan:


Code
apps.hr_accrual_plan_api.create_accrual_plan (
p_effective_date => V_DATE_EFFECTIVE
,p_business_group_id => V_BUSINESS_GROUP_ID
,p_accrual_formula_id => v_formula_id50
,p_co_formula_id =>
v_carryover_formula_id50
,p_pto_input_value_id => v_input_value_id50
,p_accrual_plan_name => v_name||' Plan'
,p_accrual_units_of_measure => 'H'
,p_accrual_category => 'V'
,p_accrual_start => 'HD'
,p_accrual_plan_id => v_accrual_plan_id50
,p_accrual_plan_element_type_id =>
v_accr_plan_elem_type_id50
,p_co_element_type_id =>
v_co_element_type_id50
,p_co_input_value_id => v_co_input_value_id50
,p_co_date_input_value_id =>
v_co_date_input_value_id50
,p_co_exp_date_input_value_id =>
v_co_exp_date_input_value_id50
,p_residual_element_type_id =>
v_residual_element_type_id50
,p_residual_input_value_id =>
v_residual_input_value_id50
,p_residual_date_input_value_id =>
v_residual_date_inp_val_id50
,p_payroll_formula_id =>
v_payroll_formula_id50
,p_defined_balance_id =>
v_defined_balance_id50
,p_balance_element_type_id =>
v_balance_element_type_id50
,p_tagging_element_type_id =>
v_tagging_element_type_id50
,p_object_version_number =>
v_object_version_number50
,p_no_link_message => v_no_link_message50
,p_check_accrual_ff => v_check_accrual_ff50
);

09 - Deletion of the wrong Element Link automaticly generated:


Code
apps.pay_element_link_api.delete_element_link(
p_effective_date => SYSDATE
,p_element_link_id => v_element_link_id51
,p_datetrack_delete_mode =>
p_datetrack_delete_mode51
,p_object_version_number =>
v_object_version_number51
,p_effective_start_date =>
v_effective_start_date51
,p_effective_end_date =>
v_effective_end_date51
,p_entries_warning =>
v_entries_warning51
);

10 - Creation of a new Element Link with standard flag = "Y":


Code
apps.pay_element_links_pkg.insert_row (
p_rowid => v_row_id52,
p_element_link_id => v_element_link_id52,
p_effective_start_date => V_DATE_EFFECTIVE,
p_effective_end_date => V_MAX_END_DATE,
p_payroll_id => NULL,
p_job_id => NULL,
p_position_id => NULL,
p_people_group_id => NULL,
p_cost_allocation_keyflex_id => NULL,
p_organization_id => NULL,
p_element_type_id => v_element_type_id52,
p_location_id => NULL,
p_grade_id => NULL,
p_balancing_keyflex_id => NULL,
p_business_group_id => V_BUSINESS_GROUP_ID,
p_legislation_code => V_LEGISLATION_CODE,
p_element_set_id => NULL,
p_pay_basis_id => NULL,
p_costable_type => 'N',
p_link_to_all_payrolls_flag => 'Y',
p_multiply_value_flag => 'N',
p_standard_link_flag => 'Y',
p_transfer_to_gl_flag => 'N',
p_comment_id => v_comment_id52,
p_employment_category => NULL,
p_qualifying_age => NULL,
p_qualifying_length_of_service => NULL,
p_qualifying_units => NULL,
p_attribute_category => NULL
);

11 - Add new entry for everybody in the business group:


Code
XXCUSTOM.pay_pel_bus.chk_standard_entries (
p_business_group_id => V_BUSINESS_GROUP_ID
,p_element_link_id =>
v_element_link_id52
,p_element_type_id =>
v_element_type_id52
,p_effective_start_date => V_DATE_EFFECTIVE
,p_effective_end_date => V_MAX_END_DATE
,p_payroll_id => NULL
,p_link_to_all_payrolls_flag => 'Y'
,p_job_id => NULL
,p_grade_id => NULL
,p_position_id => NULL
,p_organization_id => NULL
,p_location_id => NULL
,p_pay_basis_id => NULL
,p_employment_category => NULL
,p_people_group_id => NULL
);

I hope my experience will help somebody

Вам также может понравиться