Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Wednesday, 26 September 2018

Script to delete the employee record using API in oracle


--Create Table

create table papf_16082018 (person_id number, employee_number varchar2(10));

--Insert Data

insert into papf_16082018 values (53687,'215677');


commit;

update apps.fnd_user set employee_id=null where employee_id in
                (select distinct p.person_id from apps.per_all_people_f p,papf_16082018 i where p.employee_number=i.employee_number);

commit;
               
set serveroutput on;
DECLARE
  -- Input Variables
  l_validate BOOLEAN    := FALSE;
  l_effective_date DATE := sysdate;
  l_person_id                 NUMBER    := 0;
  l_perform_predel_validation BOOLEAN   := FALSE;
  -- Output Variables
  l_person_org_manager_warning VARCHAR2(2000);
BEGIN

--Capture in Cursor
declare   
Cursor res is
  SELECT person_id,employee_number from papf_16082018;

--Start Loop

 BEGIN
  FOR rc in res
    LOOP
                BEGIN
        --API Update
                                --  Calling API HR_PERSON_API.DELETE_PERSON
                                                hr_person_api.delete_person(p_validate         => l_validate ,
                              p_effective_date             => l_effective_date ,
                              p_person_id                  => rc.person_id ,
                              p_perform_predel_validation  => l_perform_predel_validation ,
                              p_person_org_manager_warning => l_person_org_manager_warning );
                                                ddbms_output.put_line('Employee deleted successfully. Person ID ' || rc.person_id || ' Employee Number ' || rc.employee_number);
                                                COMMIT;
                EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.put_line ('Unable to delete Employee : '||SQLCODE||' '||SUBSTR(SQLERRM, 1, 100));
    END;       
    END LOOP;
               
 DBMS_OUTPUT.put_line ('Process Completed');
END;


EXCEPTION
WHEN OTHERS THEN
  dbms_output.put_line('Error : ' || sqlerrm);
END;
/

Tuesday, 16 January 2018

Dynamic Approver List for AME

Oracle has provided an API to get the dynamic list of approvers for AME. ame_dynamic_approval_pkg.get_ame_apprs_and_ins_list.
We need to pass the transaction type id and transaction number. Rransaction Id is available in HR_API_TRANSACTION_TABLE and transaction_type_id is available in AME_CALLING_APPS table.

API Usage Code

CREATE OR REPLACE PROCEDURE GET_AME_TRANSACTION_APPROVERS

(P_AME_TRANSACTION_ID IN NUMBER,
 P_TRANSACTION_TYPE_ID IN VARCHAR2 DEFAULT ‘LSGEXLR’,
P_AME_APPROVERS_LIST OUT AME_APPROVER_RECORD2_TABLE_SS )

IS
 p_apprs_view_type varchar2(100):=’Active’;
p_coa_insertions_flag varchar2(100):= ‘N’;
v_ame_approvers_list ame_approver_record2_table_ss;
 v_ame_order_type_list ame_insertion_record2_table_ss:= ame_insertion_record2_table_ss();
 v_all_approvers_count varchar2(100);
 v_warning_msg_name varchar2(100);
 v_error_msg_text varchar2(100);

BEGIN

–Reference to get the Transaction Type ID, Note that LSG is my custom Application Name
–select * from ame_calling_apps
–where fnd_application_id = 800
–and application_name = ‘LSG External Learning Request’

v_ame_approvers_list := ame_approver_record2_table_ss();

AME_DYNAMIC_APPROVAL_PKG.GET_AME_APPRS_AND_INS_LIST

(

p_application_id => 800
 ,p_transaction_type =>P_TRANSACTION_TYPE_ID
 ,p_transaction_id => P_AME_TRANSACTION_ID
 ,p_ame_approvers_list => v_ame_approvers_list
 ,p_ame_order_type_list => v_ame_order_type_list
 ,p_all_approvers_count => v_all_approvers_count
 ,p_warning_msg_name => v_warning_msg_name
 ,p_error_msg_text => v_error_msg_text

);

P_AME_APPROVERS_LIST := v_ame_approvers_list;

EXCEPTION WHEN OTHERS THEN

dbms_output.put_line(‘exception ‘sqlerrm);

END;

Sample procedure given below:

DECLARE

v_AME_TRANSACTION_ID NUMBER:=21610630 ;
 v_TRANSACTION_TYPE_ID VARCHAR2(20):=’LSGEXLR’;
v_AME_APPROVERS_LIST AME_APPROVER_RECORD2_TABLE_SS ;

BEGIN

GET_AME_TRANSACTION_APPROVERS

(

P_AME_TRANSACTION_ID =>v_AME_TRANSACTION_ID

,P_AME_APPROVERS_LIST =>V_AME_APPROVERS_LIST

);

IF(v_ame_approvers_list.count() ) > 0THEN

FOR i IN 1..v_ame_approvers_list.count() LOOP

dbms_output.put_line(‘ approver_order_number =>‘ v_ame_approvers_list(i).approver_order_number
‘ **** display_name =>‘v_ame_approvers_list(i).display_name
‘ **** Approver Category =>‘v_ame_approvers_list(i).approver_category
‘ **** approval_status =>‘v_ame_approvers_list(i).approval_status
‘ **** source =>‘v_ame_approvers_list(i).source );

END LOOP;

ELSE

dbms_output.put_line(‘ No Approver Found’);

END IF;

END;

Tuesday, 18 October 2016


How to programmatically close PO using PO_ACTIONS API

PO_ACTIONS.CLOSE_PO is the API used to programmatically close/final close Purchase Order. We have to pass P_ACTION parameter value as 'CLOSE'/'FINALLY CLOSE' depending on the requirement to close a Purchase Order.
Before applying the API, we are taking a PO as CLOSE_CODE  as 'CLOSED' for testing purpose and query the purchase order in Backend. The result of PO is given in snapshot below. 



Below are the code to execute the api.
Sample:-
/* Formatted on 2016/10/18 12:08 (Formatter Plus v4.8.8) */
DECLARE
   x_action         CONSTANT VARCHAR2 (20)  := 'FINALLY CLOSE';
   -- Change this parameter as per requirement
   x_calling_mode   CONSTANT VARCHAR2 (2)   := 'PO';
   x_conc_flag      CONSTANT VARCHAR2 (1)   := 'N';
   x_return_code_h           VARCHAR2 (100);
   x_auto_close     CONSTANT VARCHAR2 (1)   := 'N';
   x_origin_doc_id           NUMBER;
   x_returned                BOOLEAN        := NULL;
BEGIN
  
   apps.mo_global.set_policy_context ('S', 204);
   fnd_global.apps_initialize (1015932, 50578, 201);
   DBMS_OUTPUT.put_line
             ('Calling PO_Actions.close_po for Closing/Finally Closing PO =>');
   x_returned :=
      po_actions.close_po (p_docid              => 131583,
                           p_doctyp             => 'PO',
                           p_docsubtyp          => 'STANDARD',
                           p_lineid             => NULL,
                           p_shipid             => NULL,
                           p_action             => x_action,
                           p_reason             => NULL,
                           p_calling_mode       => x_calling_mode,
                           p_conc_flag          => x_conc_flag,
                           p_return_code        => x_return_code_h,
                           p_auto_close         => x_auto_close,
                           p_action_date        => SYSDATE,
                           p_origin_doc_id      => NULL
                          );
   COMMIT;

   IF x_returned = TRUE
   THEN
      DBMS_OUTPUT.put_line
                   ('Purchase Order which just got Closed to Finally Closed. ');
      DBMS_OUTPUT.put_line (x_return_code_h);

   ELSE
      DBMS_OUTPUT.put_line
                      ('API Failed to Close/Finally Close the Purchase Order');
   END IF;
END;

After applying the API, the status of given PO is  changed successfully.



Posted By : Mohammad M Alam

Monday, 17 October 2016

Create Bulk GL Code Combinations Using API

DECLARE

CURSOR c1
   IS
   SELECT  a.rowid row_id,a.*
FROM    temp_gl_code a
WHERE   process_flag= 'N';
     
       
  l_segment1                 GL_CODE_COMBINATIONS.SEGMENT1%TYPE;
  l_segment2                 GL_CODE_COMBINATIONS.SEGMENT2%TYPE;
  l_segment3                 GL_CODE_COMBINATIONS.SEGMENT3%TYPE;
  l_segment4                 GL_CODE_COMBINATIONS.SEGMENT4%TYPE;
  l_segment5                 GL_CODE_COMBINATIONS.SEGMENT5%TYPE;
  l_segment6                 GL_CODE_COMBINATIONS.SEGMENT6%TYPE;
  l_valid_combination        BOOLEAN;
  l_cr_combination           BOOLEAN;
  l_ccid                     GL_CODE_COMBINATIONS_KFV.code_combination_id%TYPE;
  l_structure_num            FND_ID_FLEX_STRUCTURES.ID_FLEX_NUM%TYPE;
  l_conc_segs                GL_CODE_COMBINATIONS_KFV.CONCATENATED_SEGMENTS%TYPE;
  p_error_msg1               VARCHAR2(240);
  p_error_msg2               VARCHAR2(240);
  v_error_flag               BOOLEAN;
  v_error_msg                VARCHAR2(3000) :=NULL;
  v_count1                   NUMBER;
 v_count2                    NUMBER;
 v_row_count                 NUMBER := 0;
 v_req_message               VARCHAR2(3000);
 v_req_id                    NUMBER;
 v_req_status                BOOLEAN;
 v_rphase                    VARCHAR2(20);
 v_rstatus                   VARCHAR2(20);
 v_dphase                    VARCHAR2(20);
 v_dstatus                   VARCHAR2(20);
  -- ----------------------
--START OF VALIDATION
-- ----------------------
BEGIN
 
 FOR i in c1
 
   LOOP
     v_error_flag := FALSE;
     v_error_msg := NULL;
   
  l_segment1  := i.segment1;
  l_segment2  := i.segment2;
  l_segment3  := i.segment3;
  l_segment4  := i.segment4;
  l_segment5  := i.segment5;
  l_segment6  := i.segment6;
  l_conc_segs := l_segment1||'.'||l_segment2||'.'||l_segment3||'.'||l_segment4||'.'||l_segment5||'.'||l_segment6 ;
 
 

  BEGIN
    SELECT
    id_flex_num
      INTO l_structure_num
      FROM apps.fnd_id_flex_structures
     WHERE id_flex_code        = 'GL#'
       AND id_flex_structure_code='COVAD_ACCOUNTING_FLEXFIELD';
  EXCEPTION
  WHEN OTHERS THEN
    l_structure_num:=NULL;
  END;
 
  ---------------Check if CCID exits with the above Concatenated Segments---------------
  BEGIN
    SELECT code_combination_id
      INTO l_ccid
      FROM apps.gl_code_combinations_kfv
     WHERE concatenated_segments = l_conc_segs;
  EXCEPTION
  WHEN OTHERS THEN
    l_ccid         :=NULL;
  END;
   
    -- -------------------------------------------------------------------------------
-- UPDATING THE PROCESS FLAG FOR ERRORS IN temp_gl_code TABLE
-- -------------------------------------------------------------------------------
    IF l_ccid IS NOT NULL THEN
    ------------------------The CCID is Available----------------------
    --DBMS_OUTPUT.PUT_LINE('COMBINATION_ID= ' ||l_ccid);
    v_error_msg := v_error_msg ||'Combination already Exists '|| '; ' ;
   
        UPDATE  temp_gl_code
        SET process_flag                = 'E'
        ,errror_message                 = 'Validation Error:'||v_error_msg
        ,last_update_date               = SYSDATE
        WHERE rowid                     = i.row_id
        AND process_flag                = 'N' ;
COMMIT;
    ELSE
   
DBMS_OUTPUT.PUT_LINE('This is a New Combination. Validation Starts....');
    ------------Validate the New Combination--------------------------
    l_valid_combination := APPS.FND_FLEX_KEYVAL.VALIDATE_SEGS
                          (
                          operation => 'CHECK_COMBINATION',
                          appl_short_name => 'SQLGL',
                          key_flex_code => 'GL#',
                          structure_number => L_STRUCTURE_NUM,
                          concat_segments => L_CONC_SEGS
                          );
    p_error_msg1 := FND_FLEX_KEYVAL.ERROR_MESSAGE;
   
    BEGIN
        UPDATE  temp_gl_code
        SET process_flag                = 'E'
        ,errror_message                  = FND_FLEX_KEYVAL.ERROR_MESSAGE
        ,last_update_date               = SYSDATE
        WHERE rowid                     = i.row_id
        AND process_flag                = 'N' ;
COMMIT;
    END;

    IF l_valid_combination then

      DBMS_OUTPUT.PUT_LINE('Validation Successful! Creating the Combination...');
      -------------------Create the New CCID--------------------------

      L_CR_COMBINATION := APPS.FND_FLEX_KEYVAL.VALIDATE_SEGS
                          (
                          operation => 'CREATE_COMBINATION',
                          appl_short_name => 'SQLGL',
                          key_flex_code => 'GL#',
                          structure_number => L_STRUCTURE_NUM,
                          concat_segments => L_CONC_SEGS );
         
          p_error_msg2 := FND_FLEX_KEYVAL.ERROR_MESSAGE;
         
         
   IF l_cr_combination THEN
        -------------------Fetch the New CCID--------------------------
        SELECT code_combination_id
          INTO l_ccid
          FROM apps.gl_code_combinations_kfv
        WHERE concatenated_segments = l_conc_segs;
       
        UPDATE  temp_gl_code
        SET process_flag                = 'S'
        ,errror_message                  = 'Import Success='|| l_ccid
        ,last_update_date               = SYSDATE
        WHERE rowid                     = i.row_id
        AND process_flag                = 'E' ;
    COMMIT;
    ELSE
        -------------Error in creating a combination-----------------
        DBMS_OUTPUT.PUT_LINE('Error in creating the combination: '||p_error_msg2);
      END IF;
    ELSE
      --------The segments in the account string are not defined in gl value set----------
      DBMS_OUTPUT.PUT_LINE('Error in validating the combination: '||p_error_msg1);
    END IF;
  END IF;
  END LOOP;
EXCEPTION
WHEN OTHERS THEN
  DBMS_OUTPUT.PUT_LINE(SQLCODE||' '||SQLERRM);
END;

--- By--  Sivachandaran ---

Tuesday, 27 September 2016

Bank Accounts APPEND , MICR , End Date using API


AR Cash Management

Description

This blog is used to load Bank and Branch data from the load files. It end date the bank accounts which are invalid. Create new bank account codes to insert and append scenarios. The mandatory validations are handled by the API’s.


-- This API used to create an external bank.


iby_ext_bankacct_pub.create_ext_bank
(
    p_api_version        => g_api_version,
    p_init_msg_list      => fnd_api.g_true,
    p_ext_bank_rec       => Px_extbank_rec_type,
    x_bank_id            => px_bank_id,
    x_return_status      => Px_return_status,
    x_msg_count          => Px_msg_count,
    x_msg_data           => Px_msg_data,
    x_response           => px_response
);


-- This API used to create an external bank branch.



iby_ext_bankacct_pub.create_ext_bank_branch
(
    p_api_version           => g_api_version,
    p_init_msg_list         => fnd_api.g_true,
    p_ext_bank_branch_rec   => px_ext_bank_branch_rec,
    x_branch_id             => px_branch_id,
    x_return_status         => px_return_status,
    x_msg_count             => px_msg_count,
    x_msg_data              => px_msg_data,
    x_response              => px_response
);

-- API to create external bank account

iby_ext_bankacct_pub.create_ext_bank_acct
(
    g_api_version,
    fnd_api.g_true,                --p_init_msg_list,
    px_ext_bank_acct_rec,
    px_acct_id,
    px_return_status,
    px_msg_count,
    px_msg_data,
    px_response
);


-- This API used to set payer assignment.


iby_fndcpt_setup_pub.set_payer_instr_assignment
(
    g_api_version,
    fnd_api.g_true,   -- p_init_msg_list,
    fnd_api.g_true,   -- p_commit,
    px_return_status,
    px_msg_count,
    px_msg_data,
    px_payer,
    px_assignment_attribs,
    px_assign_id,
    px_response

);

-- By
-- Eswaramoorthi M

Oracle HRMS- Person, Assignment , Job , Location Conversion Using Api

Workday Integration Process


Description

This blog is used to Creating new Person, Assignment, Job creation, Location creation, and Rehiring Person. This blog includes the updating of Person, Job, and assignment with email notification option the corresponding API will create and update the information Person and Job.



-- This query retrieves the phone_id to create and update phone

SELECT phone_id, object_version_number
  FROM per_phones
 WHERE phone_type = i_ph_type
   AND parent_table = 'PER_ALL_PEOPLE_F'
   AND parent_id = i_person_id
   AND (date_to IS NULL
        OR
        i_eff_date BETWEEN date_from AND NVL (TRUNC (date_to), 
        hr_general.end_of_time)
       );
            

-- This API is used to create the phone details based on the parameters.

      hr_phone_api.create_phone
        (
             p_validate              => FALSE
            ,p_date_from             => i_hire_date
            ,p_phone_type            => l_phone_type
            ,p_phone_number          => i_work_phone
            ,p_parent_id             => i_person_id
            ,p_parent_table          => 'PER_ALL_PEOPLE_F'
            ,p_effective_date        => i_hire_date
            ,p_object_version_number => l_ovn
            ,p_phone_id              => l_phone_id
        );


-- This API is used to update the phone details based on the parameters.


        hr_phone_api.update_phone
        (
            p_phone_id              => l_phone_id -- Phone id from per_phones
            ,p_phone_type           => l_phone_type -- Phone type 'W1'
            ,p_phone_number         => i_work_phone -- Input parameter
            ,p_object_version_number=> l_ovn
            ,p_validate             => FALSE
            ,p_effective_date       => i_hire_date
        );
                    
       



-- This API is used to create employee based on the parameters.
   
   
Hr_Employee_Api.CREATE_EMPLOYEE
(
    p_business_group_id           => g_business_group_id,
    p_person_id                   => v_person_id,
    p_assignment_id               => v_assignment_id,
    p_per_object_version_number   => v_per_object_version_number,
    p_asg_object_version_number   => v_asg_object_version_number,
    p_per_effective_start_date    => v_per_effective_start_date,
--Out Parameter
    p_per_effective_end_date      => v_per_effective_end_date,
    p_full_name                   => v_full_name,
    p_person_type_id              => g_person_type_id,
    p_per_comment_id              => v_per_comment_id,
    p_assignment_sequence         => v_assignment_sequence,
    p_assignment_number           => v_assignment_number,
    p_name_combination_warning    => v_name_combination_warning,
    p_assign_payroll_warning      => v_assign_payroll_warning,
    p_orig_hire_warning           => v_orig_hire_warning,--HEADER DETAILS
    p_last_name                   => l_get_all_per_inserts.per_last_name,
    p_first_name                  => l_get_all_per_inserts.per_first_name,
    p_sex                         => l_get_all_per_inserts.per_gender,
    p_middle_names                => l_get_all_per_inserts.per_middle_names,
    p_employee_number             =>
    l_get_all_per_inserts.per_employee_number,
      --OFFICE DETAILS TAB
    p_email_address               => l_get_all_per_inserts.per_email_address,
    p_hire_date                   =>  
   l_get_all_per_inserts.per_startdate_hiredate
)      

-- This API is used to update person based on the parameters.

Hr_Person_Api.UPDATE_PERSON
(
    p_validate                   => FALSE,
    p_effective_date             =>
l_get_all_per_update.per_effective_start_date,
    p_datetrack_update_mode      => v_datetrack_update_mode,
    p_person_id                  => l_get_all_per_update.person_id,
    p_object_version_number      => l_obj_ver_num,
    p_last_name                  => l_get_all_per_update.per_last_name,
    p_first_name                 => l_get_all_per_update.per_first_name,
    p_sex                        => l_get_all_per_update.per_gender,
    p_middle_names               => l_get_all_per_update.per_middle_names,
    p_employee_number            => l_get_all_per_update.per_employee_number,
    p_email_address              => l_get_all_per_update.per_email_address,
    p_effective_start_date       => v_o_effective_start_date,
    p_effective_end_date         => v_o_effective_end_date,
    p_full_name                  => v_o_full_name,
    p_comment_id                 => v_o_p_comment_id,
    p_name_combination_warning   => v_o_name_combination_warning,
    p_assign_payroll_warning     => v_o_assign_payroll_warning,
    p_orig_hire_warning          => v_o_orig_hire_warning
);
-- This query is used to retrieve the period service id and final process
   Date for person final process.


SELECT period_of_service_id, object_version_number,
       last_standard_process_date, final_process_date
  INTO l_period_of_service_id, l_object_version_number,
       l_last_standard_process_date, l_final_process_date
  FROM per_periods_of_service pps
 WHERE person_id = l_get_all_per_rehire.person_id
   AND pps.date_start = (
                            SELECT MAX (date_start)
                            FROM per_periods_of_service pps2
                            WHERE pps2.person_id = pps.person_id
                        );     
                           


-- This API is used to perform the final process of employee.
                                

Hr_Ex_Employee_Api.final_process_emp
(
    p_validate                     => g_validate,
    p_period_of_service_id         => l_period_of_service_id,
    p_object_version_number        => l_object_version_number,
    p_final_process_date           => l_final_process_date,
    p_org_now_no_manager_warning   => l_supervisor_warning,
    p_asg_future_changes_warning   => l_asg_future_changes_warning,
    p_entries_changed_warning      => l_entries_changed_warning
);                                          
                                           
 

-- This API is used to re-hire the employee’s.
                                 
   
Hr_Employee_Api.re_hire_ex_employee
(
    p_validate                    => FALSE,
    p_hire_date                   =>
   l_get_all_per_rehire.per_startdate_hiredate,
    p_person_id                   => l_get_all_per_rehire.person_id,
    p_per_object_version_number   =>
    l_get_all_per_rehire.object_version_number,
    p_person_type_id              => l_person_type_id,
    p_rehire_reason               => 'REHIRED',
    p_assignment_id               => v_out_assignment_id,
    p_asg_object_version_number   => v_asg_object_version_number,
    p_per_effective_start_date    => v_per_effective_start_date,
    p_per_effective_end_date      => v_per_effective_end_date,
    p_assignment_sequence         => v_asg_sequence,
    p_assignment_number           => v_asg_number,
    p_assign_payroll_warning      => v_asg_payroll_warning
);
   




-- This API is used to process the employee termination.

Hr_Ex_Employee_Api.actual_termination_emp
(
  p_validate                     => l_validate,
  p_effective_date               => NVL (l_actual_termination_date, l_date),
  p_period_of_service_id         => l_period_of_service_id,
  p_object_version_number        => l_object_version_number,
  p_actual_termination_date      => NVL( l_actual_termination_date, l_date ),
  p_last_standard_process_date   => NVL ( l_last_std_process_date, l_date ),
  p_leaving_reason               => NULL,
  p_last_std_process_date_out    => l_last_std_process_date_out,
  p_supervisor_warning           => l_supervisor_warning,
  p_event_warning                => l_event_warning,
  p_interview_warning            => l_interview_warning,
  p_review_warning               => l_review_warning,
  p_recruiter_warning            => l_recruiter_warning,
  p_asg_future_changes_warning   => l_asg_future_changes_warning,
  p_entries_changed_warning      => l_entries_changed_warning,
  p_pay_proposal_warning         => l_pay_proposal_warning,
  p_dod_warning                  => l_dod_warning
);


-- This API is used to update the employee assignment.


Hr_Assignment_Api.update_emp_asg
(
   p_validate                     => FALSE
  ,p_effective_date               => l_get_all_asgn.asg_effective_start_date
  ,p_datetrack_update_mode        => v_datetrack_update_mode
  ,p_assignment_id                => v_in_assignment_id
  ,p_object_version_number        => l_object_version_number
  ,p_supervisor_id                => v_supervisor_id
  ,p_ass_attribute_category       => Hr_Api.g_varchar2
  ,p_default_code_comb_id         => l_expense_account
  ,p_set_of_books_id              => l_set_of_books_id -- Out arguments
  ,p_soft_coding_keyflex_id       => l_soft_coding_keyflex_id     --out
  ,p_effective_start_date         => l_effective_start_date       --out
  ,p_effective_end_date           => l_effective_end_date         --out
  ,p_no_managers_warning          => l_no_mgr_warn                --out
  ,p_other_manager_warning        => l_other_mgr_warng            --out
  ,p_hourly_salaried_warning      => l_salaried_warn              --out
  ,p_gsp_post_process_warning     => l_gsp_post_proc_war          --out
  ,p_cagr_grade_def_id            => l_cagr_grade_def_id          --in out
  ,p_cagr_concatenated_segments   => l_cagr_concatenated_segments --out
  ,p_comment_id                   => l_comment_id               -- out number
  ,p_concatenated_segments        => l_concatenated_segments      --out
);   



-- This API is used to update the employee assignment criteria.

 
Hr_Assignment_Api.update_emp_asg_criteria
(
    p_effective_date                 => l_get_all_asgn.asg_effective_start_date,
    p_datetrack_update_mode          => 'CORRECTION',
    p_assignment_id                  => v_in_assignment_id,
    p_validate                       => FALSE,
    p_called_from_mass_update        => FALSE,
    p_job_id                         => l_job_id,
    p_location_id                    => l_location_id,-- in out
    p_object_version_number          => l_object_version_number,
    p_special_ceiling_step_id        => l1_special_ceiling,
    p_people_group_id                => l_people_group_id,
    p_soft_coding_keyflex_id         => l1_soft_coding_keyflex_id,-- out
    p_group_name                     => l1_group_name,
    p_effective_start_date           => l1_effective_start_date,
    p_effective_end_date             => l1_effective_end_date,
    p_org_now_no_manager_warning     => l1_org_no_mgr_warning,
    p_other_manager_warning          => l1_other_mgr_warning,
    p_spp_delete_warning             => l1_spp_delete_warning,
    p_entries_changed_warning        => l1_entries_changed_warning,
    p_tax_district_changed_warning   => l1_tax_dist_chng_warn,
    p_concatenated_segments          => l1_concatenated_segments,
    p_gsp_post_process_warning       => l1_gsp_post_warning
);
   
  

-- This API is used to create job.



Hr_Job_Api.CREATE_JOB
(
    p_business_group_id           => g_business_group_id
    ,p_date_from                  => '01-JAN-1900'
    ,p_job_group_id               => v_job_group_id
    ,p_segment1                   => SUBSTR(l_get_insert_jobs.job_name,1,60)
    -- ,p_concat_segments => l_get_insert_jobs.job_division||'.'||
 l_get_insert_jobs.job_discipline||'.'||l_get_insert_jobs.job_name
 --Hr_Api.g_varchar2
    ,p_job_information_category   => v_job_info_cat --in param
    ,p_attribute16                => l_get_insert_jobs.job_wd_profile_id
    ,p_approval_authority         => l_authority_level
    ,p_job_id                     => v_job_id            --OUT
    ,p_object_version_number      => v_obj_ver_num       --OUT
    ,p_job_definition_id          => v_job_definition_id --OUT
    ,p_name                       => v_name              --OUT
);  
 



 
-- This API is used to update job.


Hr_Job_Api.UPDATE_JOB
(
    p_validate                       => FALSE,
    p_job_id                         => l_get_upd_del_jobs.job_id,
    p_object_version_number          =>
l_get_upd_del_jobs.object_version_number,
    p_date_to                        => l_get_upd_del_jobs.job_date_to,
    p_job_information_category       =>
l_get_upd_del_jobs.job_information_category,
    p_segment1                       =>
SUBSTR (l_get_upd_del_jobs.job_name,1,60),
    p_concat_segments                =>
SUBSTR (l_get_upd_del_jobs.job_name,1, 60 ),
    p_attribute16                    => l_get_upd_del_jobs.job_wd_profile_id,
    p_approval_authority             => l_authority_level,
    p_language_code                  => Hr_Api.userenv_lang,
    p_job_definition_id              => v_job_definition_id,       -- out
    p_name                           => v_name,                    --out
    p_valid_grades_changed_warning   => v_valid_grd_ch_warning,    --out
    p_effective_date                 => l_get_upd_del_jobs.date_from
);

                     

-- By 
-- Eswaramoorthi M