1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Script to peform Create employee API

Discussion in 'Oracle Apps Technical' started by heepth, May 4, 2015.

  1. heepth

    heepth Active Member

    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    100
    Location:
    chennai
    Create Employee API

    The hr_employee_api.create_employee procedure holds the script to do interface to create employee

    Code:

    Code (SQL):

    DECLARE

     
     LC_EMPLOYEE_NUMBER                                PER_ALL_PEOPLE_F.EMPLOYEE_NUMBER%TYPE    ;
     LN_PERSON_ID                                      PER_ALL_PEOPLE_F.PERSON_ID%TYPE ;
     LN_ASSIGNMENT_ID                                  PER_ALL_ASSIGNMENTS_F.ASSIGNMENT_ID%TYPE;
     LN_OBJECT_VER_NUMBER                              PER_ALL_ASSIGNMENTS_F.OBJECT_VERSION_NUMBER%TYPE;
     ln_asg_ovn                                        NUMBER:=5;
     
     LD_PER_EFFECTIVE_START_DATE                       PER_ALL_PEOPLE_F.EFFECTIVE_START_DATE%TYPE;
     LD_PER_EFFECTIVE_END_DATE                         PER_ALL_PEOPLE_F.EFFECTIVE_END_DATE%TYPE:=NULL;
     LC_FULL_NAME                                      PER_ALL_PEOPLE_F.FULL_NAME%TYPE;
     LN_PER_COMMENT_ID                                 PER_ALL_PEOPLE_F.COMMENT_ID%TYPE:=NULL;
     LN_ASSIGNMENT_SEQUENCE                            PER_ALL_ASSIGNMENTS_F.ASSIGNMENT_SEQUENCE%TYPE;
     lc_assignment_number                              PER_ALL_ASSIGNMENTS_F.ASSIGNMENT_NUMBER%TYPE;
     
     LB_NAME_COMBINATION_WARNING                       BOOLEAN;
     LB_ASSIGN_PAYROLL_WARNING                         BOOLEAN;
     LB_ORIG_HIRE_WARNING                              BOOLEAN;
     
     

    BEGIN
               hr_employee_api.create_employee
               (   -- Input data elements  
                   -- ------------------------------
                   p_hire_date                              => TO_DATE('08-JUN-2011'),
                   P_BUSINESS_GROUP_ID                      => FND_PROFILE.VALUE_SPECIFIC('PER_BUSINESS_GROUP_ID'),
                   P_LAST_NAME                              => 'bogggjnjjhs',
                   P_FIRST_NAME                             => 'adajjhujms12',
                   p_middle_names                           => NULL,
                   p_sex                                    => 'M',
                   p_national_identifier                    => '183-09-6723',
                   P_DATE_OF_BIRTH                          => TO_DATE('03-DEC-1988'),
                   p_known_as                               => 'adam',  
                   -- Output data elements  
                   -- --------------------------------
                   p_employee_number                        => lc_employee_number,
                   p_person_id                              => ln_person_id,
                   p_assignment_id                          => ln_assignment_id,
                   p_per_object_version_number              => ln_object_ver_number,
                   p_asg_object_version_number              => ln_asg_ovn,
                   p_per_effective_start_date               => ld_per_effective_start_date,
                   p_per_effective_end_date                 => ld_per_effective_end_date,
                   p_full_name                              => lc_full_name,
                   p_per_comment_id                         => ln_per_comment_id,
                   p_assignment_sequence                    => ln_assignment_sequence,
                   p_assignment_number                      => lc_assignment_number,
                   p_name_combination_warning               => lb_name_combination_warning,
                   p_assign_payroll_warning                 => lb_assign_payroll_warning,
                   p_orig_hire_warning                      => lb_orig_hire_warning  
            );
     
                  COMMIT;

    EXCEPTION
          WHEN OTHERS THEN
                        ROLLBACK;
                        dbms_output.put_line(SQLERRM);
    END;