Labels

2017 absence absence management Account accounting AIM aliases AME and API application application utilities lookups approval assignments ATO Australia Bank bi publisher budget business business groups CAGR candidates cartisian product case CEMLI Center Stage channels Classification competency concurrent Configuration configuration profile constants contextualization conversion correction cost costing coverage area customization data database date DateTracked deductions define design develop DFF diagnostics document earnings ebs EIT Element employee enhancements erp excel expression extension failure Fastformula FBT Flexfield FND fndload foreign key forms Formula fringe benefit FRM-40654 from FTE Functions fund fusion GL global transfer grade help hierarchy HR HRMS human resource management system implementation income information interfaces internet interview job join key flexfield KFF KPI language learning leave legal employer legislation links lists localization location management New Year obia obiee OLF onboarding oracle oracle applications oracle descriptive flex field oracle descriptive flexfield oracle ebs oracle erp oracle fusion HCM oracle hrms oracle hrms interview questions oracle hrms modules oracle hrms modules list oracle hrms organization oracle hrms table oracle hrms tables oracle hrms tutorial oracle irecruitment oracle legal entities oracle lookups oracle organization hierarchy oracle payroll oracle payroll interview questions oracle payroll tables oracle self service order by Organization organization type otbi package package body package specification patch payg Payment payroll people group perform person personalisation phase pl/sql position primary key process profile programs project qualifier Query question questions Recruiting Center Recruitment regex regular expression reporting tool reports requests requirement requisition resume retropay RICE salary schema security profile select SIT smartorg sql statutory stores STP Super Superannuation system systems Table Taleo taleo 15B Taleo Recruitment tax termination test testing trunc update user group user management user type value set variables View Views Web ADI webadi where work relationship

Sunday 30 July 2017

How to run APIs using standalone anonymous block

In this illustration we would try and delete an existing element entry using oracle's seeded API

Pay Period: May 22nd – Jun 04th 2017

Element to be deleted: EA037 Public Holiday



Element details:



Get Element entry id by navigating to - 
Help > diagnostic > Examine
Search for ELEMENT_ENTRY_ID


If you don’t have access to Help > Diagnostics > Examine option (due to profile option settings), you can use an sql query to find the required details

select   peef.element_entry_id
       , petf.element_name
       , petf.reporting_name
       , peef.effective_start_date
       , peef.effective_end_date
       , peef.assignment_id
      , peef.object_version_number
  from  PAY_ELEMENT_ENTRIES_F peef
      , pay_element_links_f pelf
      , pay_element_types_f petf
 where 1=1
   and peef.element_link_id = pelf.element_link_id
   and pelf.element_type_id = petf.element_type_id
   and peef.assignment_id = (select paaf.assignment_id
                               from per_all_assignments_f paaf
                              where paaf.assignment_number like 60075166)    -- assg number in this example
   and petf.element_name = 'EA037 Public Holiday'
   order by element_entry_id desc 


We get the element_entry_id = 479143354



Below is one of the ways we can test the delete element entry seeded functionality by using the code i.e. using the standard API for deleting element entry and running it as an anonymous block

DECLARE
   l_obj_version NUMBER := 1;   -- from the query
   l_effective_start_date   DATE;
   l_effective_end_date     DATE;
   l_delete_warning         BOOLEAN := NULL;

      BEGIN
         pay_element_entry_api.delete_element_entry
            (
                p_validate                                           => false ,
                p_datetrack_delete_mode         => 'ZAP',    -- to completely delete the entry from database
                p_effective_date                            => TO_DATE ('04-JUN-2017'),
                p_element_entry_id                     => 479143354,   -- from the query         
                p_object_version_number         => l_obj_version,
                p_effective_start_date                => l_effective_start_date,
                p_effective_end_date                  => l_effective_end_date,
                p_delete_warning                          => l_delete_warning
            );

       DBMS_OUTPUT.put_line ('Element entry successfully deleted');
     
EXCEPTION
         WHEN OTHERS
         THEN
         DBMS_OUTPUT.put_line(SQLERRM);
         DBMS_OUTPUT.put_line(' ... ');
         DBMS_OUTPUT.put_line(fnd_message.get);
         DBMS_OUTPUT.put_line(' ... ');
         DBMS_OUTPUT.put_line ('Element Exception:  '|| SQLERRM);
      END;



Note: Before executing the code, ensure that DBMS Output is enabled (View > DBMS Output)


Commit (Session > Commit)


Now navigate back to Oracle EBS, the element entry will be deleted. In case if the API goes into any exception or error. The DBMS OUTPUT window will display the error 







No comments:

Post a Comment