Quantcast
Channel: Oracle Fusion Apps | Oracle Fusion | Oracle Apps Training
Viewing all 103 articles
Browse latest View live

Exception in JAVA

$
0
0

Objective: In the previous article Interface in Java we have learned about the Interfaces, Extending Interface and Extending Multiple Interface. In this article we will learn about the Exception in Java.

 

Exceptions:

In java, exception is an event that disrupts the normal flow of the program. It is an object which is thrown at runtime.

There are two types of Exceptions in Java:

  1. 1.Checked Exceptions

  2. 2.Unchecked Exceptions

  3. 3.Error

1. Checked exception: The classes that extend Throwable class except RuntimeException and Error are known as checked exceptions.     

e.g.IOException, SQLException etc. Checked exceptions are checked at compile-time.

2. Unchecked Exception: The classes that extend RuntimeException are known as unchecked exceptions e.g. ArithmeticException, NullPointerException, ArrayIndexOutOfBoundsException etc. Unchecked exceptions are not checked at compile-time rather they are checked at runtime.

There are given some scenarios where unchecked exceptions can occur. They are as follows:

 

  • ->Arithmetic Expression:

 

If we divide any number by zero, there occurs an ArithmeticException.

int a=50/0;//ArithmeticException  

 

  • ->Null Pointer Exception:

 

If we have null value in any variable, performing any operation by the variable occurs an ->NullPointerException

String s=null;  

System.out.println(s.length());//NullPointerException

 

  • ->Number format Exception:

 

The wrong formatting of any value, may occur NumberFormatException. Suppose I have a string variable that have characters, converting this variable into digit will occur ->NumberFormatException.

String s="abc";  

int i=Integer.parseInt(s);//NumberFormatException  

 

  • ->ArrayINdexOutOfBound Exception:

 

If you are inserting any value in the wrong index, it would result ArrayIndexOutOfBoundsException as shown below:

int a[]=new int[5];  

a[10]=50; //ArrayIndexOutOfBoundsException  

3. Error: Error is irrecoverable e.g. OutOfMemoryError, VirtualMachineError, AssertionError etc.

 

Exception Handling in Java:

There are 5 keywords used in java exception handling.

  1. 1. try

  2. 2. catch

  3. 3. finally

  4. 4. throw

  5. 5. throws


Oracle Fusion HCM (Human Capital Management) Overview

$
0
0

Overview:  Oracle Fusion HCM (Human Capital Management)

It is a next generation of application that Oracle has came up with, previously Oracle was only associated with database products, then it came up with ERP(Enterprise Resource Planning) as well, it started acquiring other ERP products as well like PeopleSoft, Seibel etc.

Previously if a company wanted to implement HCM it has to go for products like PeopleSoft which was specialized in a particular area & Seibel for CRM (Customer Relationship Management) & Oracle was very well known for supply chain & financials, so there after a situation came up where if a customer wanted to use HCM it has to use Peoplesoft & if wanted to go for CRM it had to opted for Seibel in all they had to opt for two different product at the same time which raised the cost of operation for them.

Then Oracle came with a solution of coming with a unique way which had the best of both HCM, E Business Suite & CRM, it took best in class features both from Peoplesoft & Seibel and they came up with a new product from scratch using application development framework, Oracle fusion was created.

Cloud computing was upcoming product in the market, companies were more on a move towards cloud technology and replacing the server system. When it comes to undertaking a Fusion HCM implementation, especially if this is your first experience with Software as a Service (SaaS), the same logic applies – it makes sense to work with someone who knows the lay of the land and what to expect.

FHCM2 

Oracle Fusion has been further categorized into Workforce Deployment, Workforce Development & Compensation Management. Mainly these are the 3 primary business processes included in Oracle Fusion HCM.

Workforce Deployment

It has been further categorized into:

1. Global Human Resources: It deals with the core HR (Human Resource) activities. It enables organizations to maximize employee value, by aligning resources with people & also includes localization i.e. setup, processing, monitoring, internal & external touch points & reporting.

2. Global Payroll & Localization: Fusion payroll, it comes under HCM, it consist of full fledge payroll service for both global i.e. par with the world or local i.e. for a particular country.

3.Global Payroll Interface: It is used only as an interface and not for full fledge payroll service E.g. If a company is already using a third party product for executing payroll and only uses Oracle Fusion as an interface application. Oracle Fusion HCM collects the data & send it to the third party payroll provider.

4. Workforce Prediction: It uses “what if” scenario modeling, it uses historical, current and indicators to predict the performance & attrition & provide the ability to enable corrective measure.

5. Workforce Lifecycle Manager: It covers all the stages of workers association i.e. creation of an employee in the database to termination of work relationship. E.g. Hiring, Promotion, changing assignment etc.

# For the next assignment I will be covering workforce development & Compensation Management.

Oracle Fusion Payroll - Functional Setup Manager (Part 1)

$
0
0

This tutorial deals with Fusion Payroll, and how it functions.

Having dealt with an overview of Oracle Fusion, you must now be familiar with the basic concepts. We will now move on to the Functional Setup Manager (FSM), and then Common Application Configuration.

The topics covered in this first part of the tutorial are:
● Functional Setup Manager - An Overview
● Offerings
● Implementation Projects

Functional Setup Manager - An Overview

The Functional Setup Manager (FSM) is a central module where implementation takes place in Fusion Applications. It is based on Business Process Management, to optimise or adapt to organisational needs. The FSM is the one place to configure and set up Fusion Applications in a consistent manner.

The role associated with the Functional Setup Manager is Application Implementation Consultant, and unless that role is assigned, a user cannot view the whole of the Functional Setup Manager.

The FSM can be accessed through the Navigator -> Tools -> Setup and Maintenance.

FP1

How-to Create a Custom ESS Job in Fusion Applications

$
0
0

How-to Create a Custom ESS Job in Fusion Applications

Creation of Custom Data Loader Summary Report  

Create a Data Model :  

SQL query to be used :

SELECT hdbo.bus_obj_file_discriminator EntityName,fr.key_source_owner SourceSystemOwner, fr.key_source_id SourceSystemId, l.msg_text ErrorMessage,bo.data_file_name,bo.imported_status,bo.validated_status, bo.skipped_status,bo.loaded_status,'Error' DataLoadStatus,'N' DataLoadFlag   FROM   fusion.hrc_dl_message_lines l   ,      

fusion.hrc_dl_data_set_bus_objs  bo   ,      

fusion.hrc_dl_data_sets          ds   ,      

fusion.hrc_dl_physical_lines pl   ,      

fusion.hrc_dl_file_rows     fr   ,      

fusion.hrc_dl_file_lines    fl   ,      

fusion.hrc_dl_business_objects hdbo    

WHERE  l.message_source_table_name = 'HRC_DL_PHYSICAL_LINES'  

AND    bo.data_set_bus_obj_id      = l.data_set_bus_obj_id  

AND    ds.data_set_id              = bo.data_set_id  

AND    pl.physical_line_id   = l.message_source_line_id                              

AND    fr.row_id             = pl.row_id  

AND    fl.line_id            = fr.line_id  

AND    hdbo.business_object_id = bo.business_object_id  

And    ds.ucm_content_id = :p_ucm_content_id  

union    

SELECT hdbo.bus_obj_file_discriminator EntityName,fr.key_source_owner SourceSystemOwner, fr.key_source_id SourceSystemId, l.msg_text ErrorMessage,bo.data_file_name,bo.imported_status,bo.validated_status,bo.skipped_status,bo.loaded_status,'Error' dataloadstatus,'N' dataloadflag  

FROM   fusion.hrc_dl_message_lines l

, fusion.hrc_dl_data_set_bus_objs bo

, fusion.hrc_dl_data_sets ds

, fusion.hrc_dl_logical_lines ll

, fusion.hrc_dl_file_rows fr

, fusion.hrc_dl_file_lines fl

, fusion.hrc_dl_business_objects hdbo

WHERE l.message_source_table_name = 'HRC_DL_LOGICAL_LINES'

AND bo.data_set_bus_obj_id = l.data_set_bus_obj_id

AND ds.data_set_id = bo.data_set_id AND ll.logical_line_id = l.message_source_line_id

AND fr.logical_line_id = ll.logical_line_id AND fl.line_id = fr.line_id

AND hdbo.business_object_id = bo.business_object_id

And ds.ucm_content_id = :p_ucm_content_id

Screenshot :

CustESS1

Create a Report :

CustESS2

 

Create a Scheduled Process :

Navigation : Setup and Maintainenance -> Name ( Enter : Manage Custom Enterprise Scheduler Jobs for HCM Core Processes)

CustESS3

 

Select : Go to Task

You will see the following screen

CustESS4

 

Click Create and this navigates you to the following screen :

CustESS5

 

Schedule Jobs Details :

CustESS6

CustESS7

CustESS8

 

Parameter Details :

CustESS9

CustESS11

 

Running the Newly Created Custom Scheduled Job :

Navigation : Scheduled Processes -> Schedule New Process -> ( Search for ‘HCM Data Loader Summary Report’)

 

CustESS12

CustESS13

CustESS14

Sample Output Screenshot : 

 

Sample Output Screenshot :

Oracle Fusion Payroll - Functional Setup Manager (Part 2)

$
0
0

This tutorial deals with Fusion Payroll, and how it functions.

Having dealt with an overview of Oracle Fusion, you must now be familiar with the basic concepts. We will now continue from the Functional Setup Manager (Part 1), and then Common Application Configuration.

The topics covered in this first part of the tutorial are:
● Creating an Implementation Project
● Export and Import
● Customisation

Creating an Implementation Project

The steps to create an implementation project are as follows:

1. Go to Navigator -> Tools -> Setup and Maintenance -> Manage Implementation Projects and click on the Create icon (highlighted in the screenshot below).

2. Enter the basic information and click on Next.

3. Select the offerings and options to be included in the project and click on Next.

4. Click on the Add Task Lists and Tasks icon (circled in the screenshot below) to add tasks, and click on Apply.

5. Click on the Assign Tasks button to assign users to the tasks. After searching and selecting users, click on Save and Close.

The following screenshots depict the above steps:

FP7
Fig. 7 - Creating a new implementation project. The Create icon is highlighted
FP8
Fig. 8 - Entering basic information of the implementation project
FP9

Fig. 9 - Selecting offerings to implement in the project

FP10
Fig. 10 - The task lists and tasks in the project. Click on the circled icon to add tasks

FP11
Fig. 11 - Searching and adding task lists and tasks to the implementation project
FP12
Fig. 12 - Assigning tasks to specific users

 

Export and Import

You can configure packages by identifying the entities (or business objects) you want to export. It gives you a package that has an XML data of your entities, along with appropriate tags. After configuring a package, an Export and Import process has to be run. This is used as input for the following export and import process. It is essential to note that not all entities are capable of being exported and imported.

The steps of the Export and Import process are detailed below:

1. Go to Manage Configuration Packages under Setup Data Export and Import in the Regional Area.

2. To create a configuration package, click on the New icon (circled in the screenshot below) under Search Results.

3. Select the appropriate implementation project and click on Next.

4. Select the objects to be exported and click on Next.

5. Select the required schedule for running the process and click on Submit to run the export process

(or)

Select the required schedule for running the process and click on Save and Close.

a. Select the package under Search Results and click on the Export Setup Data button to start the export process.

b. Click on Next on the screen that follows. Select the required schedule for running the process and click on Submit.

These steps are depicted in the following screenshots:
FP13
Fig. 13 - Main screen of the Export and Import process, with the New icon circled
FP14
Fig. 14 - Choosing the implementation project for the package
FP15
Fig. 15 - Selecting the objects for export

FP16
Fig. 16 - Scheduling the export

Unlike a traditional export and import, where interface tables and mappings are created before the data is loaded, this export and import process is within the Fusion Application, where the data is loaded onto the Fusion instance.

Customisation

There are a few customisable elements in the Functional Setup Manager: offerings and functional areas, features, business processes, task lists and tasks, and business objects. This allows you to set up your own task lists, tasks, and business objects for your implementation project(s).

The steps to customise task lists are as follows:

1. To manage task lists and tasks, click on Manage Task Lists and Tasks under Implementation Objects in the Regional Area of the FSM. Clicking on a task’s name will give you a list of the technical details related to the task.

2. Click on the Create Task List button.

3. Enter the basic information, then click on the Add Task icon under Tasks.

4. Search and select the required task(s) and click on Done. The task(s) will get added to the task list.

5. Under Task List Scope, click on the Business Object dropdown to add a scope to the task list. To search for a particular business object, click on Search… in the dropdown.

6. Click on Save and Close to save the task list.

You can also create individual tasks by clicking on the Create Task button on the Manage Task Lists and Tasks screen.

FP17
Fig. 17 - Managing task lists and tasks

FP18
Fig. 18 - Entering basic information and adding tasks to task list

FP19
Fig. 19 - Searching and adding tasks to the task list

FP20
Fig. 20 - Searching and adding a scope to the task list

Sending Output of Concurrent Programs as Email Attmt

$
0
0

Sending Output Of Concurrent Programs Via Email  

While working on Oracle Applications E- Business Suite it is a very common requirement that we want to send the output of a concurrent program as an email attachment to specific email id.  

This requirement can be easily achieved by creating a shell script which will take the output file and send email to the subscribers.  

For this you have to follow the below mentioned steps:

a) Create a Executable with execution file type as Host.

b) Create a Concurrent program which will have parameters as Request ID(for normal request whose output is stored in fnd_concurrent requests) , Output Request ID ( for XML based concurrent requests where otput is stored in fnd_conc_request_outputs), Attachment type( ‘LOG’/’OUT’ for Log file and output file respectively, Email Id ( email id to whom request needs to be send, Email Subject (Email Subject)          

Now whenever you will call this concurrent program passing the correct parameters you will be able to send the output to email id.  

Moreover, in order to have the control you can have flexibility to control which concurrent programs output you want to send via email and the corresponding email id create a lookup  

Lookup Type : XXC_GET_SUBSCRIBERS  

Code : 10,20,30 ..etc

Meaning : 10,20,30...etc

Description : Concurrent program Name whose output needs to be send  

Tag : Email ID to which the concurrent program output will be send.  

Attaching the shell script program for ready reference.  

SendEmail

Please save the above file in desktop and open with textpad ,  wordpad, notepad.

#!/bin/sh
# *************************************************************************************************
# Filename: ebs2fusion_send_email.sh
# Author: Sandip
# Date Created: 14-OCT-2010
# Description: Send output/log File as an attachment
# Parameters: 1. Request ID
# 2. Output Request ID
# 2. Attachment Type: LOG / OUT
# 3. Email Ids
# 4. Email Subject
# History:
# Name Date Version Description
# --------------- ------------ ------- -----------------------
# Ashish 14-OCT-2010 1.0 Original Creation
# *************************************************************************************************

# -- ------------------------
# -- Extract input parameters
# -- ------------------------
USER_PWD=`echo $1|cut -d '"' -f2` # -- Database User/Pwd
USERNAME=`echo $1|cut -d '"' -f4` # -- UserName

REQ_ID=`echo $1|cut -d '"' -f8` # -- Request Id
OUT_REQ_ID=`echo $1|cut -d '"' -f10` # -- Output Request Id
ATTACHMENT_TYPE=`echo $1|cut -d '"' -f12` # -- Attachment Type
EMAIL_ID=`echo $1|cut -d '"' -f14` # -- Email Id
EMAIL_SUB=`echo $1|cut -d '"' -f16` # -- Email Subject

# -- ----------------------
# -- Print input parameters
# -- ----------------------
echo " "
echo "User Name: "$USERNAME
echo "Request Id: "$REQ_ID
echo "Output Request Id: "$OUT_REQ_ID
echo "Attachment Type: "$ATTACHMENT_TYPE
echo "Email Id: "$EMAIL_ID
echo "Subject: "$EMAIL_SUB
echo "---------------------------------------------------------------------------------------------"

# -- ----------------
# -- Email Validation
# -- ----------------
case $EMAIL_ID in
*@?*.?*) echo "Email Address Validated.";;
*) echo "Invalid Email Address. Please enter the correct format of email address and re-run the program";
exit 1;;
esac

if [ "$OUT_REQ_ID" == "" ]; then
echo "Fetching based on Request Id"
# -- -------------------------------------------
# -- Fetch OUT and LOG filename using Request ID
# -- -------------------------------------------
QUERY_OUTPUT=`sqlplus -s /nolog <<end_stmt1
set heading off
set feedback off
set verify off
set termout off
set pages 0

CONNECT $USER_PWD
SELECT fcq.status_code, length(fcq.logfile_name), length(fcq.outfile_name), fcq.logfile_name, fcq.outfile_name FROM fnd_concurrent_requests fcq WHERE fcq.request_id='${REQ_ID}';
end_stmt1`
else
echo "Fetching based on Output Request Id"
# -- -------------------------------------------
# -- Fetch OUT and LOG filename using Request ID
# -- -------------------------------------------
QUERY_OUTPUT=`sqlplus -s /nolog <<end_stmt1
set heading off
set feedback off
set verify off
set termout off
set pages 0

CONNECT $USER_PWD
SELECT fcq.status_code, length(fcq.logfile_name), length(fcro.file_name), fcq.logfile_name, fcro.file_name FROM fnd_concurrent_requests fcq, fnd_conc_req_outputs fcro WHERE fcq.request_id=fcro.concurrent_request_id AND fcq.request_id='${OUT_REQ_ID}';
end_stmt1`
fi

# -------------------------------------------------------------------
# -- Above query will return the value as
# -- 1. Connected. (If connected to DB)
# -- 2. Program Status (C or E)
# -- 3. Length of Log File Path and Name
# -- 4. Length of Output File Path and Name
# -- 5. Log File Path and Name
# -- 6. Output File Path and Name
# -------------------------------------------------------------------

# --------------------------------------
# -- Using cut command taking the values
# --------------------------------------
IS_CONNECTED_TO_DB=`echo $QUERY_OUTPUT|cut -d" " -f1`

if [ "$IS_CONNECTED_TO_DB" == "Connected." ]; then
#-- Getting the Program Status (C or E)
PROG_STATUS=`echo $QUERY_OUTPUT|cut -d" " -f2`
echo "PROGRAM Status: "$PROG_STATUS
else
echo "Error: Connecting to DB: "$QUERY_OUTPUT
exit 1
fi

# -------------------------------------------------
# -- Sending email
# -- LOG_FILE => Attaching the log file
# -- OUT_FILE => Attaching the output file
# -- EMAIL => Passing EMail id
# -- EMAIL_SUB => Subject of Email
# ------------------------------------------------
if [ "$ATTACHMENT_TYPE" == "OUT" ]; then
# -- Getting the output file (with path)
LEN_OUTPUT_FILE=`echo $QUERY_OUTPUT|cut -d" " -f4`
echo "Length of OUTPUT FILE: "$LEN_OUTPUT_FILE

OUTPUT_FILE=`echo $QUERY_OUTPUT|cut -d" " -f6`
echo "OUTPUT FILE: "$OUTPUT_FILE

if [ $LEN_OUTPUT_FILE -gt 80 ]; then
OUTPUT_FILE1=`echo $QUERY_OUTPUT|cut -d" " -f7`
echo "OUTPUT FILE1: "$OUTPUT_FILE1
OUTPUT_FILE=$OUTPUT_FILE$OUTPUT_FILE1
fi

echo "OUTPUT FILE: "$OUTPUT_FILE

# ---------------------------------------------------------------
# -- Sending EMail with output file attachment
# -- Using -e in echo command to print the file name in new line
# ---------------------------------------------------------------
#(echo -e "$EMAIL_BODY"; uuencode $OUTPUT_FILE OUTPUT_FILE_$REQ_ID.txt) | mail "$EMAIL_ID" -s "$EMAIL_SUB"

echo "$EMAIL_SUB"| mutt -a $OUTPUT_FILE "$EMAIL_ID" -s "$EMAIL_SUB"

echo "EMAIL has been sent with output file to $EMAIL_ID"

elif [ "$ATTACHMENT_TYPE" == "LOG" ]; then
# -- Getting the Log File (with Path)
LOG_FILE=`echo $QUERY_OUTPUT|cut -d" " -f5`

echo "LOG FILE: "$LOG_FILE

# ---------------------------------------------------------------
# -- Sending EMail with log file attachment
# -- Using -e in echo command to print the file name in new line
# ---------------------------------------------------------------
#(echo -e "$EMAIL_BODY"; uuencode $LOG_FILE LOG_FILE_$REQ_ID.txt) | mail "$EMAIL_ID" -s "$EMAIL_SUB"
#uuencode -m $LOG_FILE LOG_FILE_$REQ_ID.txt | mail "$EMAIL_ID" -s "$EMAIL_SUB"

echo "$EMAIL_SUB"| mutt -a $LOG_FILE "$EMAIL_ID" -s "$EMAIL_SUB"

echo "EMAIL has been sent with log file to $EMAIL_ID"
fi

User Hook Implementation – A Sample Example

$
0
0

Business Requirement:

Business wants to ensure that whenever an employee tries to overbook leaves the system should not allow him to do so. In case of exceptional situations the user will contact the Local HR who will then enter his/her leaves in the system.

In 11i Oracle Absence Management user/employee only gets a warning message stating that after you apply this leave your balance will be negative , but allows the user to ignore and proceed. The approver too does not gets any such message so the approver is completely in dark and so he unknowingly approves it.

In order to achieve this there are two options :

a) Upgrade your Application to R12

b) Write custom logic within user hook.

Now, it is not always possible to move to a higher version just for achieving some functionality although that would be best considering the added features you get with next upgrade, but as a stop gap solution we would try to see how we can get this done via user hook.

On investigation it was found that there is a particular out parameter p_exceeds_pto_entit_warning which gives the message on self-service screen. Since it is a out parameter we have to choose the API Hook of process type 'BP' and after insert.

Now I have written a package which takes p_exceeds_pto_entit_warning as input and displays the error message. I have also used a custom profile option XXC_LOA_RESTRICT_OVERBOOKING to ensure I have the option of switching on/off the functionality.

-- Profile Option Details—

Hook Imp 1

 

Name : XXC_LOA_RESTRICT_OVERBOOKING

User Profile Name : XXC: LOA Restrict Overbooking

Hierarchy Type Access Level : Responsibility and user ( visible and updatable)

User Access : Visible

SQL Validation: SQL="select meaning \"Yes or No\", lookup_code into :visible_option_value, :profile_option_value from fnd_lookups where lookup_type = 'YES_NO'" COLUMN="\"Yes or No\"(*)"

N.B: We have define this profile option value to ensure that the error will be thrown only when employees try to overbook using Self Service Responsibility but when the changes are to be incorporated from Absence Details screen it would allow HR to add details ( with seeded warning message).

In case you want to switch on this functionality just set the value of profile at Responsibility level to ‘Yes’ to switch off set the same to ‘No’.

This gives the flexibility that from Employee Self Service error will be displayed but not from core Absence Details form

 

---------- Create a Custom Message ----------------------------------------------

 

Message Name : XXC_HR_LOA_EMP_NOT_ENTITLED

Message : You have exceeded the maximum limit for this absence type. Please resubmit based on the local policy for this leave type.

Hook Imp 2

 

-------- Custom Package ----------------------------------------------------------------------------------------------------

Hook Imp 3          Hook Imp 4

 

-- Query to find API HOOK ID and MODULE ID

select hah.api_hook_id,ham.api_module_id

from apps.hr_api_hooks hah,

     apps.hr_api_modules ham

where hah.api_module_id = ham.api_module_id

and hah.hook_package = 'HR_PERSON_ABSENCE_BK1'

and hah.hook_procedure = 'CREATE_PERSON_ABSENCE_A'

 

 

-- api_hook_id = 3840, api_module_id = 1731

 

-- Register User HOOK by CALLING hr_api_hook_call_api.create_api_hook_call

 

DECLARE

P_VALIDATE BOOLEAN;

P_EFFECTIVE_DATE DATE;

P_API_HOOK_ID NUMBER;

P_API_HOOK_CALL_TYPE VARCHAR2(200);

P_SEQUENCE NUMBER;

P_ENABLED_FLAG VARCHAR2(200);

P_CALL_PACKAGE VARCHAR2(200);

P_CALL_PROCEDURE VARCHAR2(200);

P_API_HOOK_CALL_ID NUMBER;

P_OBJECT_VERSION_NUMBER NUMBER;

 

 

BEGIN

P_VALIDATE := TRUE;

P_EFFECTIVE_DATE := 01-JAN-1951;

P_API_HOOK_ID := 3840;-- derived from SQL1

P_API_HOOK_CALL_TYPE := 'PP';

P_SEQUENCE := 3000; -- any value greater than 2000, 1-2000 reserved for Oracle Use

P_ENABLED_FLAG := 'Y';

P_CALL_PACKAGE := 'XXC_HR_USER_HOOK_PKG'; -- custom package

P_CALL_PROCEDURE := 'XXC_LOA_RESTRICT_OVERBOOKING'; -- custom procedure

P_API_HOOK_CALL_ID := NULL; P_OBJECT_VERSION_NUMBER := NULL;

 

APPS.HR_API_HOOK_CALL_API.CREATE_API_HOOK_CALL ( P_VALIDATE, P_EFFECTIVE_DATE, P_API_HOOK_ID, P_API_HOOK_CALL_TYPE, P_SEQUENCE, P_ENABLED_FLAG, P_CALL_PACKAGE, P_CALL_PROCEDURE, P_API_HOOK_CALL_ID, P_OBJECT_VERSION_NUMBER );

     COMMIT;

dbms_output.put_line('API Hook ID: '|| P_API_HOOK_ID);

dbms_output.put_line('API OVN: '|| P_OBJECT_VERSION_NUMBER);

EXCEPTION

WHEN OTHERS THEN

               dbms_output.put_line('Error: '|| SQLCODE||SQLERRM);

END;

-- Output of above query

-- API Hook Call ID: 864

-- API OVN: 1

------Query to execute Pre-processor---------------------------------

Login to your unix enviornment and connect sqlplus

go to $PER_TOP/admin/sql execute hrahkone.sql

it will ask for module id derived from sql1

After completing the desired steps and setting the profile value of your Responsibility to ‘Yes’ /’ No’ the application will work as per business requirement.

How-to Create a Custom ESS Job in Fusion Applications

$
0
0

How-to Create a Custom ESS Job in Fusion Applications

Creation of Custom Data Loader Summary Report  

Create a Data Model :  

SQL query to be used :

 

SELECT hdbo.bus_obj_file_discriminator EntityName,fr.key_source_owner SourceSystemOwner, fr.key_source_id SourceSystemId, l.msg_text ErrorMessage,bo.data_file_name,bo.imported_status,bo.validated_status, bo.skipped_status,bo.loaded_status,'Error' DataLoadStatus,'N' DataLoadFlag   FROM   fusion.hrc_dl_message_lines l   ,      

fusion.hrc_dl_data_set_bus_objs  bo   ,      

fusion.hrc_dl_data_sets          ds   ,      

fusion.hrc_dl_physical_lines pl   ,      

fusion.hrc_dl_file_rows     fr   ,      

fusion.hrc_dl_file_lines    fl   ,      

fusion.hrc_dl_business_objects hdbo    

WHERE  l.message_source_table_name = 'HRC_DL_PHYSICAL_LINES'  

AND    bo.data_set_bus_obj_id      = l.data_set_bus_obj_id  

AND    ds.data_set_id              = bo.data_set_id  

AND    pl.physical_line_id   = l.message_source_line_id                              

AND    fr.row_id             = pl.row_id  

AND    fl.line_id            = fr.line_id  

AND    hdbo.business_object_id = bo.business_object_id  

And    ds.ucm_content_id = :p_ucm_content_id  

union    

SELECT hdbo.bus_obj_file_discriminator EntityName,fr.key_source_owner SourceSystemOwner, fr.key_source_id SourceSystemId, l.msg_text ErrorMessage,bo.data_file_name,bo.imported_status,bo.validated_status,bo.skipped_status,bo.loaded_status,'Error' dataloadstatus,'N' dataloadflag  

FROM   fusion.hrc_dl_message_lines l

, fusion.hrc_dl_data_set_bus_objs bo

, fusion.hrc_dl_data_sets ds

, fusion.hrc_dl_logical_lines ll

, fusion.hrc_dl_file_rows fr

, fusion.hrc_dl_file_lines fl

, fusion.hrc_dl_business_objects hdbo

WHERE l.message_source_table_name = 'HRC_DL_LOGICAL_LINES'

AND bo.data_set_bus_obj_id = l.data_set_bus_obj_id

AND ds.data_set_id = bo.data_set_id AND ll.logical_line_id = l.message_source_line_id

AND fr.logical_line_id = ll.logical_line_id AND fl.line_id = fr.line_id

AND hdbo.business_object_id = bo.business_object_id

And ds.ucm_content_id = :p_ucm_content_id

Screenshot :

CustESS1

Create a Report :

CustESS2

Create a Scheduled Process :

Navigation : Setup and Maintainenance -> Name ( Enter : Manage Custom Enterprise Scheduler Jobs for HCM Core Processes)

CustESS3

Select : Go to Task

You will see the following screen

CustESS4

Click Create and this navigates you to the following screen :

CustESS5

Schedule Jobs Details :

CustESS6

CustESS7

CustESS8

Parameter Details :

CustESS9

CustESS11

Running the Newly Created Custom Scheduled Job :

Navigation : Scheduled Processes -> Schedule New Process -> ( Search for ‘HCM Data Loader Summary Report’)

CustESS12

CustESS13

CustESS14

Sample Output Screenshot : 

CustESS15

 

Sample Output Screenshot :

Sending Output of Concurrent Programs as Email Attachment

$
0
0

Sending Output Of Concurrent Programs Via Email  

While working on Oracle Applications E- Business Suite it is a very common requirement that we want to send the output of a concurrent program as an email attachment to specific email id.  

This requirement can be easily achieved by creating a shell script which will take the output file and send email to the subscribers.  

For this you have to follow the below mentioned steps:

a) Create a Executable with execution file type as Host.

b) Create a Concurrent program which will have parameters as Request ID(for normal request whose output is stored in fnd_concurrent requests) , Output Request ID ( for XML based concurrent requests where otput is stored in fnd_conc_request_outputs), Attachment type( ‘LOG’/’OUT’ for Log file and output file respectively, Email Id ( email id to whom request needs to be send, Email Subject (Email Subject)          

Now whenever you will call this concurrent program passing the correct parameters you will be able to send the output to email id.  

Moreover, in order to have the control you can have flexibility to control which concurrent programs output you want to send via email and the corresponding email id create a lookup  

Lookup Type : XXC_GET_SUBSCRIBERS  

Code : 10,20,30 ..etc

Meaning : 10,20,30...etc

Description : Concurrent program Name whose output needs to be send  

Tag : Email ID to which the concurrent program output will be send.  

Attaching the shell script program for ready reference.  

SendEmail

Please save the above file in desktop and open with textpad ,  wordpad, notepad.

#!/bin/sh
# *************************************************************************************************
# Filename: ebs2fusion_send_email.sh
# Author: Sandip
# Date Created: 14-OCT-2010
# Description: Send output/log File as an attachment
# Parameters: 1. Request ID
# 2. Output Request ID
# 2. Attachment Type: LOG / OUT
# 3. Email Ids
# 4. Email Subject
# History:
# Name Date Version Description
# --------------- ------------ ------- -----------------------
# Ashish 14-OCT-2010 1.0 Original Creation
# *************************************************************************************************

# -- ------------------------
# -- Extract input parameters
# -- ------------------------
USER_PWD=`echo $1|cut -d '"' -f2` # -- Database User/Pwd
USERNAME=`echo $1|cut -d '"' -f4` # -- UserName

REQ_ID=`echo $1|cut -d '"' -f8` # -- Request Id
OUT_REQ_ID=`echo $1|cut -d '"' -f10` # -- Output Request Id
ATTACHMENT_TYPE=`echo $1|cut -d '"' -f12` # -- Attachment Type
EMAIL_ID=`echo $1|cut -d '"' -f14` # -- Email Id
EMAIL_SUB=`echo $1|cut -d '"' -f16` # -- Email Subject

# -- ----------------------
# -- Print input parameters
# -- ----------------------
echo " "
echo "User Name: "$USERNAME
echo "Request Id: "$REQ_ID
echo "Output Request Id: "$OUT_REQ_ID
echo "Attachment Type: "$ATTACHMENT_TYPE
echo "Email Id: "$EMAIL_ID
echo "Subject: "$EMAIL_SUB
echo "---------------------------------------------------------------------------------------------"

# -- ----------------
# -- Email Validation
# -- ----------------
case $EMAIL_ID in
*@?*.?*) echo "Email Address Validated.";;
*) echo "Invalid Email Address. Please enter the correct format of email address and re-run the program";
exit 1;;
esac

if [ "$OUT_REQ_ID" == "" ]; then
echo "Fetching based on Request Id"
# -- -------------------------------------------
# -- Fetch OUT and LOG filename using Request ID
# -- -------------------------------------------
QUERY_OUTPUT=`sqlplus -s /nolog <<end_stmt1
set heading off
set feedback off
set verify off
set termout off
set pages 0

CONNECT $USER_PWD
SELECT fcq.status_code, length(fcq.logfile_name), length(fcq.outfile_name), fcq.logfile_name, fcq.outfile_name FROM fnd_concurrent_requests fcq WHERE fcq.request_id='${REQ_ID}';
end_stmt1`
else
echo "Fetching based on Output Request Id"
# -- -------------------------------------------
# -- Fetch OUT and LOG filename using Request ID
# -- -------------------------------------------
QUERY_OUTPUT=`sqlplus -s /nolog <<end_stmt1
set heading off
set feedback off
set verify off
set termout off
set pages 0

CONNECT $USER_PWD
SELECT fcq.status_code, length(fcq.logfile_name), length(fcro.file_name), fcq.logfile_name, fcro.file_name FROM fnd_concurrent_requests fcq, fnd_conc_req_outputs fcro WHERE fcq.request_id=fcro.concurrent_request_id AND fcq.request_id='${OUT_REQ_ID}';
end_stmt1`
fi

# -------------------------------------------------------------------
# -- Above query will return the value as
# -- 1. Connected. (If connected to DB)
# -- 2. Program Status (C or E)
# -- 3. Length of Log File Path and Name
# -- 4. Length of Output File Path and Name
# -- 5. Log File Path and Name
# -- 6. Output File Path and Name
# -------------------------------------------------------------------

# --------------------------------------
# -- Using cut command taking the values
# --------------------------------------
IS_CONNECTED_TO_DB=`echo $QUERY_OUTPUT|cut -d" " -f1`

if [ "$IS_CONNECTED_TO_DB" == "Connected." ]; then
#-- Getting the Program Status (C or E)
PROG_STATUS=`echo $QUERY_OUTPUT|cut -d" " -f2`
echo "PROGRAM Status: "$PROG_STATUS
else
echo "Error: Connecting to DB: "$QUERY_OUTPUT
exit 1
fi

# -------------------------------------------------
# -- Sending email
# -- LOG_FILE => Attaching the log file
# -- OUT_FILE => Attaching the output file
# -- EMAIL => Passing EMail id
# -- EMAIL_SUB => Subject of Email
# ------------------------------------------------
if [ "$ATTACHMENT_TYPE" == "OUT" ]; then
# -- Getting the output file (with path)
LEN_OUTPUT_FILE=`echo $QUERY_OUTPUT|cut -d" " -f4`
echo "Length of OUTPUT FILE: "$LEN_OUTPUT_FILE

OUTPUT_FILE=`echo $QUERY_OUTPUT|cut -d" " -f6`
echo "OUTPUT FILE: "$OUTPUT_FILE

if [ $LEN_OUTPUT_FILE -gt 80 ]; then
OUTPUT_FILE1=`echo $QUERY_OUTPUT|cut -d" " -f7`
echo "OUTPUT FILE1: "$OUTPUT_FILE1
OUTPUT_FILE=$OUTPUT_FILE$OUTPUT_FILE1
fi

echo "OUTPUT FILE: "$OUTPUT_FILE

# ---------------------------------------------------------------
# -- Sending EMail with output file attachment
# -- Using -e in echo command to print the file name in new line
# ---------------------------------------------------------------
#(echo -e "$EMAIL_BODY"; uuencode $OUTPUT_FILE OUTPUT_FILE_$REQ_ID.txt) | mail "$EMAIL_ID" -s "$EMAIL_SUB"

echo "$EMAIL_SUB"| mutt -a $OUTPUT_FILE "$EMAIL_ID" -s "$EMAIL_SUB"

echo "EMAIL has been sent with output file to $EMAIL_ID"

elif [ "$ATTACHMENT_TYPE" == "LOG" ]; then
# -- Getting the Log File (with Path)
LOG_FILE=`echo $QUERY_OUTPUT|cut -d" " -f5`

echo "LOG FILE: "$LOG_FILE

# ---------------------------------------------------------------
# -- Sending EMail with log file attachment
# -- Using -e in echo command to print the file name in new line
# ---------------------------------------------------------------
#(echo -e "$EMAIL_BODY"; uuencode $LOG_FILE LOG_FILE_$REQ_ID.txt) | mail "$EMAIL_ID" -s "$EMAIL_SUB"
#uuencode -m $LOG_FILE LOG_FILE_$REQ_ID.txt | mail "$EMAIL_ID" -s "$EMAIL_SUB"

echo "$EMAIL_SUB"| mutt -a $LOG_FILE "$EMAIL_ID" -s "$EMAIL_SUB"

echo "EMAIL has been sent with log file to $EMAIL_ID"
fi

User Hook Implementation – A Sample Example

$
0
0

Business Requirement:

Business wants to ensure that whenever an employee tries to overbook leaves the system should not allow him to do so. In case of exceptional situations the user will contact the Local HR who will then enter his/her leaves in the system.

In 11i Oracle Absence Management user/employee only gets a warning message stating that after you apply this leave your balance will be negative , but allows the user to ignore and proceed. The approver too does not gets any such message so the approver is completely in dark and so he unknowingly approves it.

In order to achieve this there are two options :

a) Upgrade your Application to R12

b) Write custom logic within user hook.

Now, it is not always possible to move to a higher version just for achieving some functionality although that would be best considering the added features you get with next upgrade, but as a stop gap solution we would try to see how we can get this done via user hook.

On investigation it was found that there is a particular out parameter p_exceeds_pto_entit_warning which gives the message on self-service screen. Since it is a out parameter we have to choose the API Hook of process type 'BP' and after insert.

Now I have written a package which takes p_exceeds_pto_entit_warning as input and displays the error message. I have also used a custom profile option XXC_LOA_RESTRICT_OVERBOOKING to ensure I have the option of switching on/off the functionality.

-- Profile Option Details—

Hook Imp 1

Name : XXC_LOA_RESTRICT_OVERBOOKING

User Profile Name : XXC: LOA Restrict Overbooking

Hierarchy Type Access Level : Responsibility and user ( visible and updatable)

User Access : Visible

SQL Validation: SQL="select meaning \"Yes or No\", lookup_code into :visible_option_value, :profile_option_value from fnd_lookups where lookup_type = 'YES_NO'" COLUMN="\"Yes or No\"(*)"

N.B: We have define this profile option value to ensure that the error will be thrown only when employees try to overbook using Self Service Responsibility but when the changes are to be incorporated from Absence Details screen it would allow HR to add details ( with seeded warning message).

In case you want to switch on this functionality just set the value of profile at Responsibility level to ‘Yes’ to switch off set the same to ‘No’.

This gives the flexibility that from Employee Self Service error will be displayed but not from core Absence Details form

---------- Create a Custom Message ----------------------------------------------

Message Name : XXC_HR_LOA_EMP_NOT_ENTITLED

Message : You have exceeded the maximum limit for this absence type. Please resubmit based on the local policy for this leave type.

Hook Imp 2

-------- Custom Package ----------------------------------------------------------------------------------------------------

Hook Imp 3          Hook Imp 4

-- Query to find API HOOK ID and MODULE ID

select hah.api_hook_id,ham.api_module_id

from apps.hr_api_hooks hah,

     apps.hr_api_modules ham

where hah.api_module_id = ham.api_module_id

and hah.hook_package = 'HR_PERSON_ABSENCE_BK1'

and hah.hook_procedure = 'CREATE_PERSON_ABSENCE_A'

-- api_hook_id = 3840, api_module_id = 1731

-- Register User HOOK by CALLING hr_api_hook_call_api.create_api_hook_call

DECLARE

P_VALIDATE BOOLEAN;

P_EFFECTIVE_DATE DATE;

P_API_HOOK_ID NUMBER;

P_API_HOOK_CALL_TYPE VARCHAR2(200);

P_SEQUENCE NUMBER;

P_ENABLED_FLAG VARCHAR2(200);

P_CALL_PACKAGE VARCHAR2(200);

P_CALL_PROCEDURE VARCHAR2(200);

P_API_HOOK_CALL_ID NUMBER;

P_OBJECT_VERSION_NUMBER NUMBER;

BEGIN

P_VALIDATE := TRUE;

P_EFFECTIVE_DATE := 01-JAN-1951;

P_API_HOOK_ID := 3840;-- derived from SQL1

P_API_HOOK_CALL_TYPE := 'PP';

P_SEQUENCE := 3000; -- any value greater than 2000, 1-2000 reserved for Oracle Use

P_ENABLED_FLAG := 'Y';

P_CALL_PACKAGE := 'XXC_HR_USER_HOOK_PKG'; -- custom package

P_CALL_PROCEDURE := 'XXC_LOA_RESTRICT_OVERBOOKING'; -- custom procedure

P_API_HOOK_CALL_ID := NULL; P_OBJECT_VERSION_NUMBER := NULL;

APPS.HR_API_HOOK_CALL_API.CREATE_API_HOOK_CALL ( P_VALIDATE, P_EFFECTIVE_DATE, P_API_HOOK_ID, P_API_HOOK_CALL_TYPE, P_SEQUENCE, P_ENABLED_FLAG, P_CALL_PACKAGE, P_CALL_PROCEDURE, P_API_HOOK_CALL_ID, P_OBJECT_VERSION_NUMBER );

     COMMIT;

dbms_output.put_line('API Hook ID: '|| P_API_HOOK_ID);

dbms_output.put_line('API OVN: '|| P_OBJECT_VERSION_NUMBER);

EXCEPTION

WHEN OTHERS THEN

               dbms_output.put_line('Error: '|| SQLCODE||SQLERRM);

END;

-- Output of above query

-- API Hook Call ID: 864

-- API OVN: 1

------Query to execute Pre-processor---------------------------------

Login to your unix enviornment and connect sqlplus

go to $PER_TOP/admin/sql execute hrahkone.sql

it will ask for module id derived from sql1

After completing the desired steps and setting the profile value of your Responsibility to ‘Yes’ /’ No’ the application will work as per business requirement.

-------------    pkgbody.Pkb-------------------------------

CREATE OR REPLACE PACKAGE BODY send_email
IS

/* ******************************************************************************************
* Package Name: send_email *
* Purpose: Send Email *
* *
* Procedures: *
* ----------- *
* send_email Invoke "XXC_SEND_EMAIL" Program *
* *
* Functions: *
* ---------- *
* get_subscribers: Get list of subscribers *
* *
* Change History: *
* --------------- *
* *
* Version Date Author Description *
* ------- ----------- ------------ ----------------------------------------------- *
* 1.0 02-Jul-2011 Ashish Send Email *
******************************************************************************************** */

/***********************************************************************************************
* Procedure: send_email *
* Description: Procedure to notify program run history *
* *
* Parameters: *
* ----------- *
* Name Description *
* ---------------------- ------------------------------------------------------------- *
* pn_request_id Request ID *
* pn_out_request_id Out Request ID *
* pc_subscribers Subscribers *
* pc_mail_subject Mail Subject *
* *
* Change History: *
* --------------- *
* *
* Version Date Author Description *
* ------- ----------- ------------ ------------------------------------- *
* 1.0 26-DEC-2011 Ashish Harbhajanka Initial Version *
************************************************************************************************/
PROCEDURE send_email
( pn_request_id IN NUMBER DEFAULT NULL,
pc_subscribers IN VARCHAR2,
pc_mail_subject IN VARCHAR2,
pb_sub_request IN BOOLEAN DEFAULT FALSE
)
IS

lc_proc_name VARCHAR2(100) := 'send_email.send_email';
lc_location VARCHAR2(50) := 'FLOW TRACE-1.100';
lc_errbuf VARCHAR2(2000) := NULL;
--lt_tokens error_handler.token_tbl_type DEFAULT error_handler.g_miss_token_tbl;

ln_request_id NUMBER := 0;

BEGIN
send_email.debug ( 'Start of ' || lc_proc_name || ' @ ' || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS'));
send_email.debug ( ' ');

-- Print input parameters
-- ----------------------
send_email.debug ('Input Parameters: ');
send_email.debug ('----------------- ');
send_email.debug (' Request ID: ' || pn_request_id);
send_email.debug (' Subscribers: ' || pc_subscribers);
send_email.debug (' Mail Subject: ' || pc_mail_subject);
send_email.debug (' ');

-- Submitting Mailing Program
-- --------------------------
send_email.debug ( ' Submitting mailer program: ' || send_email.gc_notify_prog_name );
lc_location := 'FLOW TRACE-1.110';

ln_request_id := APPS.FND_REQUEST.SUBMIT_REQUEST
( application => send_email.gc_appl_name,
program => send_email.gc_notify_prog_code,
sub_request => pb_sub_request,
argument1 => pn_request_id,
argument2 => 'OUT',
argument3 => pc_subscribers,
argument4 => pc_mail_subject
);
COMMIT;

IF ( ln_request_id = 0 )
THEN
-- Get Error Message
-- -----------------
lc_errbuf := SQLCODE || SQLERRM;

send_email.debug (lc_errbuf);

RAISE_APPLICATION_ERROR(-20003, lc_errbuf);
END IF;

send_email.debug ( ' Successfully submitted: ' || send_email.gc_notify_prog_name || ' - request id: ' || ln_request_id );

send_email.debug ( 'End of ' || lc_proc_name || ' @ ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS') );
EXCEPTION
WHEN OTHERS THEN
-- Get Error Message
-- -----------------
lc_errbuf := SQLCODE || SQLERRM;

RAISE_APPLICATION_ERROR(-20003, lc_errbuf);
END send_email;

/* ***************************************************************************************
* Function: get_subscribers *
* Description: Get list of subscribers *
* *
* Parameters: *
* ----------- *
* Name Description *
* ------------- ----------------------------------------------------------- *
* pc_all_errors All error flag *
* pc_by_error_category Error category (amc_error_log.error_category) *
* pc_by_source_stream Source stream (amc_error_log.source_stream) *
* pc_by_source_object Source Object (amc_error_log.source_object) *
* pc_by_source_identifier1 Source Identifier1 - Source system Name *
* pc_by_source_identifier2 Source Identifier2 - Source system Type *
* pc_by_source_identifier3 Source Identifier3 - Any other identifier *
* *
* Change History: *
* --------------- *
* *
* Version Date Author Description *
* ------- ----------- ------------ -------------------------------------- *
* 1.0 26-DEC-2011 Ashish Harbhajanka Initial Version *
**************************************************************************************** */
FUNCTION get_subscribers(pc_source_object IN VARCHAR2 DEFAULT NULL)
RETURN VARCHAR2
IS

CURSOR subscribers_cur
IS
SELECT flvv.tag
FROM apps.fnd_lookup_values_vl flvv
WHERE flvv.lookup_type = gc_subscribers_lookup
AND flvv.description = pc_source_object
AND flvv.enabled_flag = gc_yes
AND SYSDATE BETWEEN flvv.start_date_active AND NVL(flvv.end_date_active,SYSDATE);

lc_proc_name CONSTANT VARCHAR2(70) := 'send_email.get_subscribers';
lc_subscribers VARCHAR2(4000) := NULL;

BEGIN
send_email.debug( 'Start of ' || lc_proc_name || ' @ ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS') );
send_email.debug( ' ' );

-- Print input parameters
-- ----------------------
send_email.debug( 'Input Parameters: ' );
send_email.debug( '----------------- ' );
send_email.debug( ' By Source Object: ' || pc_source_object );

-- Concatinate all subscribers into a string
-- -----------------------------------------
FOR subscribers_rec IN subscribers_cur
LOOP
lc_subscribers := lc_subscribers || subscribers_rec.tag || '; ';
END LOOP;

send_email.debug(' Subscribers: ' || lc_subscribers);

send_email.debug( 'End of ' || lc_proc_name || ' @ ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS') );
send_email.debug( ' ' );

RETURN (lc_subscribers);

EXCEPTION
WHEN OTHERS THEN
RAISE;

END get_subscribers;

END send_email;
/

 

-------------------------------- pkgspec.pks  ------------------------------------

CREATE OR REPLACE PACKAGE send_email AUTHID CURRENT_USER
IS

/* ******************************************************************************************
* Package Name: send_email *
* Purpose: Send Email *
* *
* Procedures: *
* ----------- *
* send_email Invoke "XXC_SEND_EMAIL" Program *
* *
* Functions: *
* ---------- *
* get_subscribers: Get list of subscribers *
* *
* Change History: *
* --------------- *
* *
* Version Date Author Description *
* ------- ----------- ------------ ----------------------------------------------- *
* 1.0 02-Jul-2011 Ashish Send Email *
******************************************************************************************** */

gc_notify_prog_code CONSTANT VARCHAR2(30) := 'XXC_SEND_EMAIL';
gc_subscribers_lookup CONSTANT VARCHAR2(30) := 'XXC_GET_SUBSCRIBERS';


/*****************************************************************************************
* Procedure: send_email *
* Description: Procedure to notify program run history *
* *
* Parameters: *
* ----------- *
* Name Description *
* ---------------------- -------------------------------------------------------------*
* pn_request_id Request ID *
* pn_out_request_id Out Request ID *
* pc_subscribers Subscribers *
* pc_mail_subject Mail Subject *
* pb_sub_request Sub Request *
* *
* Change History: *
* --------------- *
* *
* Version Date Author Description *
* ------- ----------- ------------------ --------------------------------- *
* 1.0 26-DEC-2011 Ashish Harbhajanka Draft Version *
**************************************************************************************** */
PROCEDURE send_email
( pn_request_id IN NUMBER DEFAULT NULL,
pc_subscribers IN VARCHAR2,
pc_mail_subject IN VARCHAR2,
pb_sub_request IN BOOLEAN DEFAULT FALSE
);


/* ***************************************************************************************
* Function: get_subscribers *
* Description: Get list of subscribers *
* *
* Parameters: *
* ----------- *
* Name Description *
* ------------- ----------------------------------------------------------- *
* pc_all_errors All error flag *
* pc_by_error_category Error category (amc_error_log.error_category) *
* pc_by_source_stream Source stream (amc_error_log.source_stream) *
* pc_by_source_object Source Object (amc_error_log.source_object) *
* pc_by_source_identifier1 Source Identifier1 - Source system Name *
* pc_by_source_identifier2 Source Identifier2 - Source system Type *
* pc_by_source_identifier3 Source Identifier3 - Any other identifier *
* *
* Change History: *
* --------------- *
* *
* Version Date Author Description *
* ------- ----------- ------------------ --------------------------------- *
* 1.0 26-DEC-2011 Ashish Harbhajanka Draft Version *
**************************************************************************************** */
FUNCTION get_subscribers(pc_source_object IN VARCHAR2 DEFAULT NULL)
RETURN VARCHAR2;

END send_email;
/

 

WEBADI-A-Sample-Implementation

$
0
0

ADI Set Up Steps

The Basic Mandatory step before starting with the ADI Set Up is to enable Security settings in Internet Explorer, Word, Excel as follows:-

(a) Word:-

(i)Tools->Macro->Security->Security Level tab->check low button (ii)Tools->Macro->Security->Trusted Publishers tab->check Trust Access to Visual Basic Project checkbox also.

(b) Excel:- Same as above

(c) Internet Explorer:- (i) Tools->Internet Options-> Security-> Custom Level-> Initialize and script ActiveX controls not marked as safe-> Prompt (ii) Tools->Internet Options-> Security-> Custom Level-> Automatic prompting for file downloads-> enable (iii) Tools->Internet Options-> Security-> Custom Level-> Use Pop-up Blocker-> Disable

Requirement:

1. Need to download all the applicant details who does not have SIT values using Oracle WEBADI for specific business group

2. Need to insert SIT values for the applicants data which is downloaded

3. Need to upload the applicant’s data to which changes have been done.

4. Need to check weather the data is updated or not from the front end.

1) Create a new view to retrieve data for the applicants

Who does not contain SIT VALUES?

CREATE OR REPLACE VIEW XXGENAPPSITDETAILS_V

AS

SELECT DISTINCT papf.first_name Applicant_First_Name,

papf.last_name Applicant_Last_Name,

papf.applicant_number,

pav.name vacnacy_name,

NULL person_analysis_id,

NULL CEDS_Attended,

NULL CEDS_Writing_Score,

NULL CEDS_Reading_Score,

NULL CEDS_Listening_Score,

NULL CEDS_Free_Speach_Score,

NULL HAWK_Attended,

NULL object_version_number

FROM per_all_people_f papf,

per_all_assignments_f paaf,

per_all_vacancies pav,

APPS.per_person_types ppt,

PER_PERSON_TYPE_USAGES_F pptuf

WHERE papf.business_group_id = ppt.business_group_id

and papf.business_group_id = paaf.business_group_id

and papf.person_id = paaf.person_id

and paaf.vacancy_id = pav.vacancy_id

and pav.business_group_id = paaf.business_group_id

AND papf.business_group_id IN

(SELECT business_group_id

FROM per_business_groups

WHERE name = 'Genpact Guatemala'

)

AND pptuf.person_id = papf.person_id

and pptuf.person_type_id = ppt.person_type_id

AND upper(PPT.USER_PERSON_TYPE) IN ('APPLICANT')

AND sysdate BETWEEN papf.effective_start_date

AND papf.effective_end_date

AND (papf.person_id,pav.name)

NOT in

(SELECT papf.person_id,

pac.SEGMENT1 Vacancy_Number

FROM

apps.per_person_analyses ppa,

apps.per_analysis_criteria pac,

per_all_people_f papf,

APPS.per_person_types PPT ,

per_person_type_usages_f pptuf,

fnd_id_flex_structures FIFS,

per_business_groups bg

WHERE ppa.business_group_id= bg.business_group_id

AND bg.NAME = 'Genpact Guatemala'

AND pptuf.person_id = papf.person_id \

AND ppt.person_type_id = pptuf.person_type_id

AND fifs.id_flex_num = PPA.ID_FLEX_NUM

AND FIFS.id_flex_structure_code = 'XX_CEDS_GUATEMALA'

AND upper(PPT.USER_PERSON_TYPE) IN ('APPLICANT')

and papf.person_id=ppa.person_id

and ppa.analysis_criteria_id=pac.analysis_criteria_id

and sysdate BETWEEN papf.effective_start_date

and papf.effective_end_date

AND TRUNC(sysdate) BETWEEN pptuf.EFFECTIVE_START_DATE AND pptuf.EFFECTIVE_END_DATE )

minus

SELECT DISTINCT

papf.first_name Applicant_First_Name,

papf.last_name Applicant_Last_Name,

papf.applicant_number,

pav.name vacnacy_name,

NULL person_analysis_id,

NULL CEDS_Attended,

NULL CEDS_Writing_Score,

NULL CEDS_Reading_Score,

NULL CEDS_Listening_Score,

NULL CEDS_Free_Speach_Score,

NULL HAWK_Attended,

NULL object_version_number

FROM per_all_people_f papf,

per_all_assignments_f paaf,

per_all_vacancies pav,

APPS.per_person_types ppt,

PER_PERSON_TYPE_USAGES_F pptuf

WHERE papf.business_group_id = ppt.business_group_id

and papf.business_group_id = paaf.business_group_id

and papf.person_id = paaf.person_id

and paaf.vacancy_id = pav.vacancy_id

and pav.business_group_id = paaf.business_group_id

AND papf.business_group_id IN

(SELECT business_group_id

FROM per_business_groups

WHERE name = 'Genpact Guatemala'

)

AND pptuf.person_id = papf.person_id

and pptuf.person_type_id = ppt.person_type_id

AND upper(PPT.USER_PERSON_TYPE) IN ('APPLICANT')

AND sysdate BETWEEN papf.effective_start_date

AND papf.effective_end_date

AND (papf.person_id,pav.name)

in

(SELECT papf.person_id,

pac.SEGMENT1 Vacancy_Number

FROM

apps.per_person_analyses ppa,

apps.per_analysis_criteria pac,

per_all_people_f papf,

APPS.per_person_types PPT ,

per_person_type_usages_f pptuf,

fnd_id_flex_structures FIFS,

per_business_groups bg

WHERE

ppa.business_group_id= bg.business_group_id

AND bg.NAME = 'Genpact Guatemala'

AND pptuf.person_id = papf.person_id

AND ppt.person_type_id = pptuf.person_type_id

AND fifs.id_flex_num = PPA.ID_FLEX_NUM

AND FIFS.id_flex_structure_code = 'XX_CEDS_GUATEMALA'

AND upper(PPT.USER_PERSON_TYPE) IN ('APPLICANT')

and papf.person_id=ppa.person_id

and ppa.analysis_criteria_id=pac.analysis_criteria_id

and sysdate BETWEEN papf.effective_start_date

and papf.effective_end_date

AND TRUNC(sysdate) BETWEEN pptuf.EFFECTIVE_START_DATE AND pptuf.EFFECTIVE_END_DATE

)

Concepts

Integrator – This is the definition that stores the information about the action the user wishes to perform. For example, downloading specific data to a spreadsheet for viewing or to modify and upload back to the database. For ADE users, this equated to the Style.

API – Application Programming Interface. This is the pl/sql interface by which data is validated and uploaded into Oracle HRMS. You would associate an api with an integrator if it was intended to either create new data in the application or update data that had been previously downloaded. See Oracle HRMS Configuring,Reporting and System Administration manual for a list of supported apis.

View – A view is an object by which you can query data on a table or tables. If the action you are intending to perform involves downloading data, you must associate a view with the integrator. If you are using Create style APIs, you do not require a view. You can elect to use a seeded view, for example, PER_PEOPLE_V, to use with your integrator. However, if the integrator is for updating data, then it is recommended that you create your own views and remember to include the OBJECT_VERSION_NUMBER, and any other In/Out parameters used by your chosen API.

One thing to beware of is the use of Aliases in views if you are downloading from a form. For example,if you use an alias for Applicant_Name called Starter, and then use a restrictive query in the form on Applicant Name before running the integrator in Web ADI, you will get the following error in the BNE log.

BneBaseSQL.executeBneQuery: Exception while running query. Error Code: 904, Message: ORA-00904: "APPLICANT_NAME": invalid identifier

The column APPLICANT_NAME has been overwritten by the alias in the definition loaded into the BNE tables.

Layout – This is where the user selects the columns to be displayed in the spreadsheet or Word document from the API and/or View used by the integrator. An integrator can have more than one layout defined for it. You can choose which one to use when you create your document.

Mapping – the mapping definition links the data source to the api columns. If no view is specified against the integrator or no text file used to load data, then no mapping is needed. When the data source is a view, the mapping is created automatically, however if a text file is being used then a mapping needs to be manually defined to associate each column in the file (source) to the relevant api parameter (target). See example c) in section, A Step by Step Guide to Creating HRMS Integrators.

--> Login to Oracle Apps 

-- >Select Oracle WEB ADI Responsibility

webadi1

 

-->Click on Create Document

--> Select Excel 2003 option from the viewer

webadi2

 

--> Click on Next button

webadi3

 

Select Integrator “HR Integrator Setup”

 

Click on Next button

webadi4

 

Select Layout as “Integrator Setup”

Click on Next button

webadi5

 

Select Content as „None”

Click on Next button

webadi6

 

Click on create document button

webadi7

 

click on open

webadi8

 

Detail information for column heading in the above Template

1. Upl - ignore

2. Metadata Type - select List of Values from Oracle menu

3. or right click on mouse.Choose UPDATE

4. Application Short Name- Choose your Application Short Name

5. (see Getting Started)

6. Integrator User Name - Enter a name for your integrator

7. (eg Update Asg Details)

8. View Name - Create your own view, but must include

9. object_version_number from

10. per_all_assignments_f. See Getting

11. Started.

12. Form Name - GENERAL

13. API Package Name - HR_ASSIGNMENT_API

14. API Procedure Name - UPDATE_EMP_ASG_CRITERIA

15. Interface User Name - Enter a unique name

16. Interface Param List - Enter a unique name

17. API Type - select List of Values from Oracle menu

18. or right click on mouse.Choose PROCEDURE

19. API Return Type - ignore

Metadata Type : UPDATE

Application Short name : PER

Intergrator User name : XXTEST_SITAPP

View name : XXGENAPPSITDETAILS_V

Form Name : GENERAL

API Package Name : XX_GENGUATAPPLSIT_PKG

API Procedure Name : XX_GENGUATAPPLSIT_PRC

Interface User Name : XXTEST_SITAPP

Interface Parameter List Name : XXTEST_SITAPP

API Type : PROCEDURE

Note : Interface User Name and Interface Parameter List Name should be same as Integrator name

webadi9

-->goto menu Oracle-->upload

webadi10

 

If upload is successful it will show in green colour which as shown below

webadi11

 

--> Goto home page of Oracle Webadi responsibility

webadi12

 

Click on Create Documnet

webadi13

 

Select excel 2003 option

webadi14

 

Select HR Maintain Integrator Form Function Association

Click on Next button

webadi15

 

Select Form Function Associations option

Click on Next button

webadi16

 

Select Form Function Associations option

Click on Next button

webadi17

 

Give Application Short name (#App_short_name)

Give Integrator Short name (#integrator_name)

Click on Next continue

webadi18

 

Click on Create document button

Form Function Template

webadi19

(3) Define a Form Function like

webadi2o

Function : XXTEST_SITAPP_WEBADI

User Function name : XXTEST_SITAPP_WEBADI

webadi21

Properties : SSWA Servlet Function

Web HTML: oracle.apps.bne.webui.BneApplicationService

Note: SELECT Integrator_code

FROM BNE_INTEGRATORS_TL

WHERE user_name LIKE „XXTEST_SITAPP‟ (< Integrator Name >)

Parameters: bne: page=BneCreateDoc&bne: integrator=800 :< Integrator_code>

Parameters: bne: page=BneCreateDoc&bne: integrator=800:GENERAL_1420_INTG

System Administrator--> Requests-->Define

--> Query Oracle Web Adi responsibility

Copy Menu Name

Query Menu Name Add the defined function name (#function_name) to menu

Goback to Form Function template (#Form_Function)

Integrator Application Shot name: PER

Integrator User name: XXTEST_SITAPP

Form Function: XXTEST_SITAPP_WEBADI

Goto menu Oracleà Upload

Goto Oracle Web Adi Responsibility home page

Select Define Layout

Select the Defined Integrator Name

Click go

Provide suitable layout name and unique layout key

Click Continue

Select all the fields which need to populate in the layout.

Select the fields which are defined in the Procedure parameters.

Goto Oracle Web Adi Responsibility home page

Select Define Mapping

Click go

Define Mapping

Provide mapping name and number of fields to be mapped

Here mapping is done for defined view columns and procedure parameters

Click on Lookup and Click on apply button

Goto --> System Administration --> Requests --> Responsibility

--> Query the responsibility to which webadi template to be attached

--> Query genpact Guatemala irec hiring team

-->copy the menu name.

--> Add the function to menu

-->Goto Genpact Guatemala Irec Hiring Team Responsibility

-->Click Genpact Guatemala Web Adi

--> Select Excel 2003

--> Click Next

--> Select the mapping name which we have defined

--> Click Continue

--> Click Create Document

--> Click Open

-->Here it displays all the applicant details who does not have SIT values

--> Before inserting SIT values for a specific applicant

--> Applicant does not contain SIT values

--> Insert SIT values to the applicant “Sambit Swain”

CEDSATTENDED1 = „Y‟

CEDSWRITINGSCORE1 = 2

CEDSREADINGSCORE1 = 2

CEDSLISTININGSCORE = 4

CEDSFREESPEACHSCORE = 5

HAWKATTENDED = „Y‟

goto menu à OracleàUpload

--> Select Flagged rows option

--> click close

--> Check after uploading SIT values

--> Here SIT values for the applicant is updated.

Fusion Payables- How to Generate Trial Balance Report

$
0
0

Purpose of this article is to provide information regarding generating Payables Trial Balance Report and different parameters needed in Fusion Payable Application.

Purpose of Payable Trial Balance Report

Payables Trial Balance Report lists and subtotals by supplier and liability account all unpaid and partially paid invoices that Payables transferred to the general ledger. Accounts Payable Trial Balance Report helps to verify that total accounts payable liabilities in Payables equal to those in the Fusion General Ledger. Before closing a period, we can compare the cumulative total liability provided by this report with the total liability listed in General Ledger to reconcile these balances. The Trial Balance Report lists and subtotals by supplier all unpaid and partially paid invoices for which Payables created journal entries. Payables lists and subtotals the invoices by the Accounts Payable Liability account. These invoices represent organization's outstanding accounts payable liability. Therefore, to obtain the most up-to-date trial balance, we should create journal entries for payment and invoice activity before submitting this report. Since this report presents outstanding accounts payable liability information, it is only valid for an accrual set of book.

Run this report from the Reports and Analytics work area or the Manage Scheduled Processes page.

S 1

This process flow diagram is taken from Oracle

Prerequisites

When defining natural account values, assign the financial category of Payables to all accounts to include in the Payables Trial Balance. To report invoices that are paid with bills payable as outstanding as long as the bills payable status has not changed to Negotiable, assign the financial category of Payables to the bills payable account and post invoice and payment activity to the General Ledger.

Supplier Model & Supplier Site Assignments

$
0
0

Objective:

In this training article we will learn about the Supplier Model and Supplier Site assignments.

Supplier Model:

Supplier model are modeled as a global entity and are not created within a business unit or in any other Organizational context. A procurement business unit establishes a relationship with a supplier through the creation of a site which maintains internal controls for how procure to pay transactions are executed with the supplier. The other entities of the supplier profile capture mostly external information that is provided by the supplier, such as tax identifiers, addresses, contact information, and so on.

Supplier Site and Supplier Site Assignments:

The site represents a business relationship between a procurement business unit and the supplier. Supplier sites are associated with a procurement business unit. It represents the relation between a procurement business unit and a supplier. A procurement business unit represents a specific purchasing or sourcing organization that is responsible for establishing and maintaining supplier relationships. It set terms, controls and policies which govern how procure to pay transactions are executed between its client business units and the supplier. The site has following information:

 

  • Procurement business unit
  • Site Name
  • Site Address
  • Site Purposes- whether its Procurement, Pay, Purchase, etc.

 

The following snap shot would give an insight of Supplier Site Setup.

Navigation >> Suppliers work area > Search for Supplier > Site tab

SS1

Supplier Site assignments directs which client business units can transact with the site. It also defines the sold-to business unit associated with the client business unit. In this case sold-to business unit represents the organisation that assumes the liability for the purchases made on behalf of the client business unit. It is to be noted that in most cases, the client business unit and sold-to business unit are the same. The following snap shot would give an insight of Supplier Site Setup.

Navigation >> Suppliers work area > Supplier > Site tab > Site link > Site Assignments tab    

SS2

Collections in Java

$
0
0

Objective:

In the previous article Exception in Java, we have learned how exceptions and exception handling in java works. In this article we will learn about the Collections in Java.

 

Collections:

Collections in java is a framework that provides an architecture to store and manipulate the group of objects. All the operations that you perform on a data such as searching, sorting, insertion, manipulation, deletion etc. can be performed by Java Collections. Java Collection simply means a single unit of objects. Java Collection framework provides many interfaces (Set, List, Queue, Deque etc.) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet etc).

Collection represents a single unit of objects i.e. a group.

 

What is collections in Framework?

A collections framework is a unified architecture for representing and manipulating collections. All collections frameworks contain the following:

  1. Interfaces: These are abstract data types that represent collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages, interfaces generally form a hierarchy.

  2. Implementations: These are the concrete implementations of the collection interfaces. In essence, they are reusable data structures.

  3. Algorithms: These are the methods that perform useful computations, such as searching and sorting, on objects that implement collection interfaces. The algorithms are said to be polymorphic: that is, the same method can be used on many different implementations of the appropriate collection interface. In essence, algorithms are reusable functionality.

Apart from the Java Collections Framework, the best-known examples of collections frameworks are the C++ Standard Template Library (STL) and Small talk's collection hierarchy. Historically, collections frameworks have been quite complex, which gave them a reputation for having a steep learning curve. We believe that the Java Collections Framework breaks with this tradition, as you will learn for yourself in this chapter.

Benefits of the Java Collections Framework:

The Java Collections Framework provides the following benefits:

Reduces programming effort: By providing useful data structures and algorithms, the Collections Framework frees you to concentrate on the important parts of your program rather than on the low-level "plumbing" required to make it work. By facilitating interoperability among unrelated APIs, the Java Collections Framework frees you from writing adapter objects or conversion code to connect APIs.

Increases program speed and quality: This Collections Framework provides high-performance, high-quality implementations of useful data structures and algorithms. The various implementations of each interface are interchangeable, so programs can be easily tuned by switching collection implementations. Because you're freed from the drudgery of writing your own data structures, you'll have more time to devote to improving programs' quality and performance.

Allows interoperability among unrelated APIs: The collection interfaces are the vernacular by which APIs pass collections back and forth. If my network administration API furnishes a collection of node names and if your GUI toolkit expects a collection of column headings, our APIs will interoperate seamlessly, even though they were written independently.

Reduces effort to learn and to use new APIs: Many APIs naturally take collections on input and furnish them as output. In the past, each such API had a small sub-API devoted to manipulating its collections. There was little consistency among these ad hoc collections sub-APIs, so you had to learn each one from scratch, and it was easy to make mistakes when using them. With the advent of standard collection interfaces, the problem went away.

Reduces effort to design new APIs: This is the flip side of the previous advantage. Designers and implementers don't have to reinvent the wheel each time they create an API that relies on collections; instead, they can use standard collection interfaces.

Fosters software reuse: New data structures that conform to the standard collection interfaces are by nature reusable. The same goes for new algorithms that operate on objects that implement these interfaces.

The root of the collection hierarchy. A collection represents a group of objects known as its elements. The Collection interface is the least common denominator that all collections implement and is used to pass collections around and to manipulate them when maximum generality is desired. Some types of collections allow duplicate elements, and others do not. Some are ordered and others are unordered. The Java platform doesn't provide any direct implementations of this interface but provides implementations of more specific subinterfaces, such as Set and List. Also see The Collection Interface section.

 

Example 1:

package com.java2novice.iterator;

import java.util.ArrayList;

import java.util.Iterator;

import java.util.List;

public class MyCollectionIterator {

   public static void main(String a[]){

        

       List<String> myList = new ArrayList<String>();

       myList.add("Java");

       myList.add("Unix");

       myList.add("Oracle");

       myList.add("C++");

       myList.add("Perl");

       Iterator<String> itr = myList.iterator();

       while(itr.hasNext()){

           System.out.println(itr.next());

       }

   }

}

//Output:

Java

Unix

Oracle

C++

Perl

 

Methods of Iterator interface

There are only three methods in the Iterator interface. They are:

  1. public boolean hasNext() it returns true if iterator has more elements.

  2. public object next() it returns the element and moves the cursor pointer to the next element.

  3. public void remove() it removes the last elements returned by the iterator. It is rarely used.
Example 2:

package com.myjava.listiterator;

import java.util.ArrayList;

import java.util.List;

import java.util.ListIterator;

public class MyListIterator {

   public static void main(String a[]){

       List<Integer> li = new ArrayList<Integer>();

       ListIterator<Integer> litr = null;

       li.add(23);

       li.add(98);

       li.add(29);

       li.add(71);

       li.add(5);

       litr=li.listIterator();

       System.out.println("Elements in forward directiton");

       while(litr.hasNext()){

           System.out.println(litr.next());

       }

       System.out.println("Elements in backward directiton");

       while(litr.hasPrevious()){

           System.out.println(litr.previous());

       }

   }

}

Example Output

Elements in forward directiton
23
98
29
71
5
Elements in backward directiton
5
71
29
98
23

How-to Migrate Custom HCM Extract

$
0
0

Business Requirement

At times we have multiple instances and we intend to move one HCM Extract ( created in Development) environment to another instance ( UAT ) or even in Production.

We can use the Export Import feature then.

Export

Login to Fusion Applications, Navigate to ‘Data Exchange’ and then search for the custom worker extract you wish to export.

Click on the Export symbol and xml file gets downloaded as displayed:

 

IMPORT

Navigate to ‘Data Exchange’ as displayed:

Under Tasks -> HCM Extracts -> Manage Extract Definitions

Click on Import Extract Option

A new popup window opens which asks for the File Path as displayed:

Give a new name if you wish to

Once the import Process is complete you would be able to search for the Extract:

 

{jcomments off}


FUSION APPLICATIONS – USER ROLE DETAIL REPORT

$
0
0

BUSINESS REQUIREMENT:

It is a very common requirement in almost all implementation where in the Stakeholders are interested to know how many user accounts are there is the system along with the corresponding roles attached to them. While oracle has delivered some seeded Reports which could be run from ‘Application Diagnostic Framework, screenshot below (Troubleshooting -> Run Diagnostic Tests)

ORACLE DELIVERED REPORTS

1) User Roles Display

2) User and Role : Role Details

3) User and Role : User Details

NAVIGATION TO RUN DELIVERED REPORTS

Login to Application -> Run Diagnostic Tests

UR1

After Running Reports :

UR2

DELIVERED REPORT 1 -> USER ROLES DISPLAY

User Roles Display: (Displays the Roles attached to procurement user)

ur3

Input Value : Sachin.Satpute

UR5

Output Screenshot :

ur30

DELIVERED REPORT 2 -> USER AND ROLE : ROLE DETAILS

User and Role : Role Details

Takes Role Name as input and displays all users who have the role attached to their user account. ( Secured i.e if the individual who is running the Report has access to a specific Data Set individuals belonging to that Data Set would only be displayed).

ur31

 

Input Value : Employee

ur8

 

Output Screenshot :

ur33

DELIVERED REPORT 3 -> USER AND ROLE : USER DETAILS

User and Role : User Details

Takes User Name as input and displays all roles attached to the user. (Secured i.e if the individual who is running the Report has access to a User Account being passed as input data would be displayed else no.)

ur7

Input value : Sachin.Satpute

ur34

Output Screenshot :

ur35

NEED FOR A CUSTOM CONSOLIDATED REPORT 

But if we need a consolidated report which will list all the users along with all the roles they have neither of the delivered ones help.

So we need a Custom Report (Preferred O/P Format could be RTF, Interactive, Excel,PPT. )

Since we are planning to display a colorful report with Different colour Code Combination ( using Conditional Formatting feature we choose PPT Format for this example)

CUSTOM REPORT NAME -> USER AND ROLE DETAILS REPORT

SQL USED FOR USER AND ROLE DETAILS REPORT

select papf.person_number "PersonNumber",

    ppnf_emp.full_name "PersonName",

           pu_emp.user_start_date "UserAccountStartDate",

           pu_emp.user_end_date "UserAccountEndDate",

           pu_emp.is_user_account_active "UserAccountStatus",

           pu_emp.username "UserAccountName",

           pu_emp.is_user_account_suspended "IsUserAccountSuspended",

           pu_emp.user_distinguished_name "UserAccountInternalName",

           pur_emp.method_code "RoleProvisioningMethod",

           pur_emp.is_user_role_active "IsUserRoleActive",

           pur_emp.is_user_role_terminated "IsUserRoleTerminated",

Case

When (pur_emp.is_user_role_active = 'Yes' AND pur_emp.is_user_role_terminated = 'No' ) Then 'Active'

When (pur_emp.is_user_role_active = 'No' AND pur_emp.is_user_role_terminated = 'No') Then 'NeitherActiveNorTerminated'

When (pur_emp.is_user_role_active = 'Yes' AND pur_emp.is_user_role_terminated = 'Yes') Then 'ActiveAndTerminated'

When (pur_emp.is_user_role_active = 'No' AND pur_emp.is_user_role_terminated = 'Yes' ) Then 'InactiveAndNotTerminated'

End as "UserRoleStatus",

pur_emp.role_start_date "UserRoleStartDate",

pur_emp.role_end_date "UserRoleEndDate",

prd_emp.abstract_role "IsRoleAAbstractRole",

prd_emp.job_role "IsRoleAJobRole",

prd_emp.data_role "IsRoleADataRole",

prd_emp.is_role_active "IsRoleActive",

Case

When (prd_emp.abstract_role = 'Y' AND prd_emp.job_role = 'N' AND prd_emp.data_role = 'N' ) Then 'Abstract Role'

When (prd_emp.abstract_role = 'N' AND prd_emp.job_role = 'Y' AND prd_emp.data_role = 'N' ) Then 'Job Role'

When (prd_emp.abstract_role = 'N' AND prd_emp.job_role = 'N' AND prd_emp.data_role = 'Y' ) Then 'Data Role'

When (prd_emp.abstract_role is NULL AND prd_emp.job_role is NULL AND prd_emp.data_role is NULL ) Then '--NA--'

End as "UserRoleType",

prd_emp.role_common_name "RoleCommonName",

prd_emp.multitenancy_common_name "MultitenancyCommonName",

prd_emp.role_distinguished_name "IsRoleDistinguishedName",

prdt_emp.role_name "UserRoleName",

prdt_emp.RoleDescription

FROM per_all_people_f papf

JOIN

(

SELECT ppnf.full_name,

ppnf.person_id

FROM per_person_names_f ppnf

WHERE ppnf.name_type = 'GLOBAL'

AND TRUNC(SYSDATE) BETWEEN ppnf.effective_start_date AND ppnf.effective_end_date

) ppnf_emp

ON (

ppnf_emp.person_id = papf.person_id

AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date

)

LEFT OUTER JOIN

(

SELECT pu.person_id,

pu.user_id,

pu.username,

to_char(pu.start_date,'DD-MM-RRRR') user_start_date,

to_char(pu.end_date,'DD-MM-RRRR') user_end_date,

DECODE(pu.active_flag,'N','Inactive','Y','Active') is_user_account_active,

DECODE(pu.suspended,'N','No','Y','Yes') is_user_account_suspended,

pu.user_distinguished_name

FROM per_users pu

) pu_emp

ON(pu_emp.person_id = papf.person_id AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND

papf.effective_end_date)

LEFT OUTER JOIN

(

SELECT pur.user_id,

pur.role_id,

        pur.role_guid,

DECODE(pur.method_code,'A','Automatic','M','Manually','E','Externally Provisioned') method_code,

DECODE(pur.active_flag,'N','No','Y','Yes') is_user_role_active,

DECODE(pur.terminated_flag,'N','No','Y','Yes') is_user_role_terminated,

to_char(pur.start_date,'DD-MM-RRRR') role_start_date,

to_char(pur.end_date,'DD-MM-RRRR') role_end_date

FROM per_user_roles pur

) pur_emp

ON (pu_emp.user_id = pur_emp.user_id)

JOIN

(

SELECT        prd.role_id,

prd.role_guid,  

                     prd.abstract_role,

                     prd.job_role,

                     prd.data_role,

DECODE(prd.active_flag,'N','No','Y','Yes') is_role_active,

prd.role_common_name,

prd.multitenancy_common_name,

prd.role_distinguished_name

FROM per_roles_dn prd

) prd_emp

ON (pur_emp.role_id = prd_emp.role_id AND pur_emp.role_guid = prd_emp.role_guid)

JOIN

(

SELECT prdt.role_id, prdt.role_name,

              prdt.description RoleDescription,

              prdt.source_lang

FROM per_roles_dn_tl prdt

) prdt_emp

ON (prd_emp.role_id = prdt_emp.role_id AND pur_emp.role_id = prdt_emp.role_id AND prdt_emp.source_lang = 'US' )

WHERE papf.person_number = nvl(:pn_person_number, papf.person_number)

AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date

CONDITIONAL FORMATTING

The different colour code feature can be added using the Conditional Formatting fields

( Highlight and Manage Formats )

ur13

ur14

REPORT OUTPUT

ur15

SCHEDULING THE REPORT

Scheduling the Report :

ur16

 

ur17

SCHEDULED OUTPUT (PPT FORMAT)

ur18

ESS JOB CREATION

ur20

PARAMETER DEFINITION

ur21

RUNNING SCHEDULED JOB

ur22

ur23

ur24

RUNNING SCHEDULED JOB FOR ONE PERSON

Person Number : 10

ur25

ur26

ur27

ur28

ur29

           

Set and File Handling in Java

$
0
0

Objective:
In the previous article Collection in Java we learned about the collection method used in Java. In this article we will learn about the Set in Collection and File Handling in Java.

 

Set:

The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are prohibited. Set also adds a stronger contract on the behavior of the equals and hashCode operations, allowing Set instances to be compared meaningfully even if their implementation types differ.

Set have its implementation in various classes like

  1. HashSet

  2. LinkedHashSet.

  3. TreeSet

Methods with description:

add( )

Adds an object to the collection

clear( )

Removes all objects from the collection

contains( )

Returns true if a specified object is an element within the collection

isEmpty( )

Returns true if the collection has no elements

iterator( )

Returns an Iterator object for the collection which may be used to retrieve an object

size( )

Returns the number of elements in the collection

 

Example 1:

Following is the example to explain Set functionality:

import java.util.*;

public class SetDemo {

 public static void main(String args[ ]) {
    int count[ ] = {34, 22,10,60,30,22};
    Set<Integer> set = new HashSet<Integer>();
    try{
       for(int i = 0; i<5; i++){
          set.add(count[i]);
       }
       System.out.println(set);
 
       TreeSet sortedSet = new TreeSet<Integer>(set);
       System.out.println("The sorted list is:");
       System.out.println(sortedSet);

       System.out.println("The First element of the set is: "+
                         (Integer)sortedSet.first());
       System.out.println("The last element of the set is: "+
                       (Integer)sortedSet.last());
    }
    catch(Exception e){}
 }
}

//Output:

[amrood]$ java SetDemo
[34, 30, 60, 10, 22]
The sorted list is:
[10, 22, 30, 34, 60]
The First element of the set is: 10
The last element of the set is: 60

 

File Handling in java:

Java FileInputStream and OutputStream

In Java, FileInputStream and FileOutputStream classes are used to read and write data in file. In another words, they are used for file handling in java.

 

Java FileOutputStream:

Java FileOutputStream is an output stream for writing data to a file.

If you have to write primitive values then use FileOutputStream.Instead, for character-oriented data, prefer FileWriter.But you can write byte-oriented as well as character-oriented data.

Example:

import java.io.*;  

class Test{  

public static void main(String args[]){  

try{  

    FileOutputstream fout=new FileOutputStream("abc.txt");  

    String s="Sachin Tendulkar is my favourite player";  

    byte b[]=s.getBytes();//converting string into byte array  

    fout.write(b);  

    fout.close();  

    System.out.println("success...");  

   }catch(Exception e){system.out.println(e);}  

 }  

}  

//Output:

success...

 

Java FileInputStream:

Java FileInputStream class obtains input bytes from a file.It is used for reading streams of raw bytes such as image data. For reading streams of characters, consider using FileReader.

It should be used to read byte-oriented data for example to read image, audio, video etc.

 

Example:

import java.io.*;  

class SimpleRead{  

public static void main(String args[]){  

 try{  

   FileInputStream fin=new FileInputStream("abc.txt");  

   int i=0;  

   while((i=fin.read())!=-1){  

    System.out.println((char)i);  

   }  

   fin.close();  

 }catch(Exception e){system.out.println(e);}  

}  

}

//Output

Sachin is my favourite player.

Fusion Applications - Creating Custom HCM Extract

$
0
0

    Business Requirement

    HCM Extracts and BI / OTBI / OBIA (currently enabled in on premise) are the most commonly used modes via which data can be transferred from Fusion Applications to 3rd Party System.

    While BI Publisher even OTBI and OBIA in same cases allows you to get the specific data set which is being desired by the third party system, we still need a robust outbound tool / mechanism to cater to all business needs. Some important features being:

      a) Dynamic File Name

      b) Dynamic File Location

      c) Capability to capture ‘Changed Data’ only feature

      d) Capability to provide data into different formats like E-Text, XML, PDF, RTF

    While it is agreed all this can be done using BI Publisher ( Using advanced Features like Bursting which allows dynamic file name generation and also allows encryption too) still for large Data Set and for more coherent integration the preferred and most commonly used mechanism( as of today) is HCM Extract.

    The literal meaning of HCM Extract as the name suggests is HR Output. ‘HR’ for HCM and Output for ‘Extract’ so HCM Extract means HR Output in simple terms i.e. when you get HR Data as Output from Fusion Applications it is called HCM Extract.

    Custom HCM Extract Creation: Available Options

    There are three available options while creating Custom HCM Extract in a Fusion POD (Application Environment):

      A) Import Custom HCM Extract from another Fusion Instance

      B) Make a copy of existing delivered extracts. Add/Edit/Delete/Modify/Extend the same and make a Custom HCM Extract

      C) Create a Custom HCM Extract from scratch

    To make things simpler we would try to publish all three categories in three different articles which would be posted soon. The article names (proposed) are:

      A) How-to Migrate Custom HCM Extract

      B) How-to Make a Copy of Existing Delivered HCM Extracts

      C) How-to Create a Custom HCM Extract from scratch.

Global Absence Accrual Fast Formula In Fusion Absence Management: An Introduction

$
0
0

{jcomments off}

Introduction

In this article we would try to understand what a fast formula is. Why is it named such way. Is it about some formula ( what kind of formula) and why is it called Fast ( is it something which is being tracked against time).

The answers to both the above question is ‘I don’t Know’.

Not sure why it is called fast formula it should be rather named as ‘Custom Code on Application UI’ or may be ‘Application Custom Code’.

So basically a Fast Formula or  Application Custom Code ( if you may like to call it that way) is a way which allows you to customize a delivered / seeded solution to meet specific business needs.

Types of Fast Formulas

Most of the times Fast Formulas are used for HCM related modules ( no comments on whether they can be used for other modules that would be a separate topic and would be discussed later) some of the primary ones being :

Functional Areas

  1. Payroll

  2. Absence Management

Technical Areas

  1. Inbound Integration ( Typical Example being Custom Logic to generate Person Number )

  2. Outbound Integration ( HCM Extracts)

In this article we would discuss primarily about Fast Formulas used associated with Fusion Applications Absence Management.

While there are multiple types of Fast Formulas in Absence Management some of the ones we are trying to discuss here being:

  1. Global Absence Accrual

  2. Global Absence Accrual Matrix

  3. Global Absence Entry Validation

  4. Global Absence Partial Period Accrual Rate

  5. Global Absence Type Duration

  6. Global Absence Vesting Period

  7. Participation and Rate Eligibility Formula

  8. Compensation Hierarchy Determination

Global Absence Accrual

Lets start with describing what do we mean by Global Absence Accrual. Truly speaking the name could very well have been Absence Accrual. For now lets say its Global Absence Accrual and not Absence Accrual ( for reasons not known to me ).

Absence means lack of presence and Accrual means method of accumulating. So Absence Accrual becomes ‘Method of Accumulating Lack of Presence’ or in simpler words ‘Method of Accumulating Absences’.

Each organization may have different ways of accumulating absences like:

  1. a) Allocate All Leaves on the First Day of the Year ( Frontloaded Accruals)

  2. b) Allocate Leaves on regular intervals , say first day of month (Incremental Accrual).

Within the above two categories there could be different variation like do some specific calculation when the employee is having say ‘X’ years of service, Grade is ‘G1’, Position is ‘P1’ and so on.

So in these cases the delivered UI Screen would not help and we would need some specific custom codes to be written, hence Fast Formula.

A Sample Example

In this example the customer has a requirement where-in the customer wants to have accrual for Absence of  ‘Extended Child Care Leave’ Type of  2 if the employee has joined the organization within the first 6 months of the calendar year and 1 if the employee has joined the organization after 6 months of the same.

/******************************************************************************

FORMULA NAME: XX_ANC_ACCRUAL_XX_ExtendedChildCare

FORMULA TYPE: Global Absence Accrual

DESCRIPTION: This formula returns the accrual for employees enrolled in Extended Child Care

Change History:

Name Date Comments

-----------------------------------------------

Ashish Harbhajanka 10-Apr-2015 Initial Version

*******************************************************************************/

DEFAULT FOR PER_ASG_FTE IS 1

DEFAULT FOR PER_REL_ORIGINAL_DATE_OF_HIRE IS '4712/12/31 00:00:00' (date)

DEFAULT FOR PER_REL_ACTUAL_TERMINATION_DATE IS '4712/12/31 00:00:00' (date)

ln_accrual = 0

ld_effective_date=PER_REL_ORIGINAL_DATE_OF_HIRE

ld_emp_term_date =PER_REL_ACTUAL_TERMINATION_DATE

ld_current_date = GET_CONTEXT (EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))

ld_term_start_date = TO_DATE ('01-01-'||TO_CHAR (ld_effective_date, 'rrrr'),'dd-mm-rrrr')

ld_term_end_date = TO_DATE ('31-12-'||TO_CHAR (ld_effective_date, 'rrrr'),'dd-mm-rrrr')

ld_term_duration = DAYS_BETWEEN (ld_term_end_date, ld_term_start_date)

ld_hire_year = TO_NUMBER (TO_CHAR (ld_effective_date,'rrrr'))

ld_curr_year = TO_NUMBER (TO_CHAR (ld_current_date,'rrrr'))

Accrual = 0

IF (ld_curr_year = ld_hire_year)

THEN

(

IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) < 7)

THEN

(

accrual = 2

)

IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) >= 7 AND TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) <= 12)

THEN

(

accrual = 1

)

)

IF (ld_curr_year > ld_hire_year)

THEN

(accrual = 2)

ceiling = 2

carryover=0

vestingUnits=3

vestingUOM='M'

RETURN accrual,ceiling,carryover,vestingUnits,vestingUOM

We would discuss more in detail about the other Absence Fast Formula in other article.

Till then bye, do try this out.

Global Absence Accrual Matrix Fast Formula In Fusion Absence Management: An Introduction

$
0
0

{jcomments off}

Introduction

In this article we would try to understand what a fast formula is. Why is it named such way. Is it about some formula ( what kind of formula) and why is it called Fast ( is it something which is being tracked against time).

The answers to all the above question is ‘I don’t Know’.

Not sure why it is called fast formula it should be rather named as ‘Custom Code on Application UI’ or may be ‘Application Custom Code’.

So basically a Fast Formula or  Application Custom Code ( if you may like to call it that way) is a way which allows you to customize a delivered / seeded solution to meet specific business needs.

Types of Fast Formulas

Most of the times Fast Formulas are used for HCM related modules ( no comments on whether they can be used for other modules that would be a separate topic and would be discussed later) some of the primary ones being :

Functional Areas

  1. Payroll

  2. Absence Management

Technical Areas

  1. Inbound Integration ( Typical Example being Custom Logic to generate Person Number )

  2. Outbound Integration ( HCM Extracts)

In this article we would discuss primarily about Fast Formulas associated with Fusion Applications Absence Management.

While there are multiple types of Fast Formulas in Absence Management some of the ones we are trying to discuss here being:

  1. Global Absence Accrual

  2. Global Absence Accrual Matrix

  3. Global Absence Entry Validation

  4. Global Absence Partial Period Accrual Rate

  5. Global Absence Type Duration

  6. Global Absence Vesting Period

  7. Participation and Rate Eligibility Formula

Global Absence Accrual Matrix

Lets start with describing what do we mean by Global Absence Accrual Matrix. Truly speaking the name could very well have been Absence Accrual Matrix. For now lets say its Global Absence Accrual Matrix and not Absence Accrual Matrix ( for reasons not known to me ).

Absence means lack of presence and Accrual means method of accumulating. So Absence Accrual becomes ‘Method of Accumulating Lack of Presence’ or in simpler words ‘Method of Accumulating Absences’.

Matrix in simpler terms means ‘Multiple Categories / Bands ’.

Hence Global Absence Accrual Matrix will stand for Method of Accumulating Absences for Multiple Combinations / Categories / Bands. So when we have different Accrual Rules for Different Bands we need to use Accrual Matrix Formula.

Each organization may have different ways of accumulating absences like:

  1. Allocate All Leaves on the First Day of the Year ( Frontloaded Accruals)

  2. Allocate Leaves on regular intervals, say first day of month (Incremental Accrual).

A Sample Example

In this example the customer has a requirement where-in the customer wants to have Annual Absence Accrual based on different Bands (categories). The different Accrual Bands are classified based upon the length of Service ( SYSDATE – DATE_OF_HIRE) in Years . So the First Accrual band is for 3 years of LOS (length of Service) and corresponding Accrual Value is 15. Second band is for 6 years of LOS (lengths of Service) with accrual value of 18 and lastly Band 3 for all Individuals having LOS greater than 6, the accrual value is 21.

/*******************************************************************

FORMULA NAME: XX_ANC_XX_ACCMAT_Annual

FORMULA TYPE: Global Absence Accrual Matrix

DESCRIPTION: This sample formula will find the weighted average of the Accrual value based on the number of the days the employee was eligible in a particular band. For example, I an employee has changed from Band 1 to Band 2 on 03-Mar-2014 and accrual value for Band 1 and Band 2 is 100 and 200 respectively. The formula will return:

accrual =

(100*(number of days employee in Band1) + 200*(number of days Employee in Band 2))/365

Change History:

Name Date Comments

--------------------------------------------------------------------------------------------------------------------

Ashish Harbhajanka 12-May-2015 Initial Version

--------------------------------------------------------------------------------------------------------------------

***********************************************************************/

/*=========== DATABASE ITEM DEFAULTS BEGIN =====================*/

DEFAULT for PER_ASG_REL_ORIGINAL_DATE_OF_HIRE is '4712/12/31 00:00:00' (date)

Default for IV_BAND_CHG_DT1 is '1951/01/01 00:00' (date)

Default for IV_BAND_CHG_DT2 is '1951/01/01 00:00' (date)

DEFAULT for IV_ACCRUALPERIODSTARTDATE is '4712/12/31 00:00:00' (date)

DEFAULT for IV_ACCRUALPERIODENDDATE is '4712/12/31 00:00:00' (date)

Default for IV_BAND_CHG_BEFVAL1 is 15

Default for IV_BAND_CHG_AFTVAL1 is 18

Default for IV_BAND_CHG_AFTVAL2 is 21

DEFAULT FOR PER_ASG_PERSON_NUMBER IS 'X'

Default for IV_CEILING is 0

Default for IV_CARRYOVER is 0

Inputs are IV_ACCRUAL,IV_BAND_CHG_DT1,IV_BAND_CHG_DT2,IV_BAND_CHG_BEFVAL1,IV_BAND_CHG_AFTVAL1,IV_BAND_CHG_BEFVAL2,IV_BAND_CHG_AFTVAL2,IV_CARRYOVER,IV_CEILING,IV_ACCRUALPERIODSTARTDATE,IV_ACCRUALPERIODENDDATE

/*=========== DATABASE ITEM DEFAULTS ENDS======================*/

/*================ FORMULA SECTION BEGIN =======================*/

ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))

ld_term_start_date = TO_DATE('01-01-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr')

ld_term_end_date = TO_DATE('31-12-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr')

ld_band1_end_date = ADD_YEARS(PER_ASG_REL_ORIGINAL_DATE_OF_HIRE,3)

ld_band2_end_date = ADD_YEARS(PER_ASG_REL_ORIGINAL_DATE_OF_HIRE,6)

accrual = IV_ACCRUAL

l_log = ess_log_write('***********************START********************************')

l_log = ess_log_write('PERSON_NUMBER : '|| PER_ASG_PERSON_NUMBER)

l_log = ess_log_write('ld_effective_date : '|| TO_CHAR(ld_effective_date,'DD-MM-YYYY'))

l_log = ess_log_write('ld_band1_end_date : '|| TO_CHAR(ld_band1_end_date,'DD-MM-YYYY'))

l_log = ess_log_write('ld_band2_end_date : '|| TO_CHAR(ld_band2_end_date,'DD-MM-YYYY'))

l_log = ess_log_write('IV_BAND_CHG_BEFVAL1 : '|| TO_CHAR(IV_BAND_CHG_BEFVAL1))

l_log = ess_log_write('IV_BAND_CHG_AFTVAL1 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL1))

l_log = ess_log_write('IV_BAND_CHG_AFTVAL2 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL2))

l_log = ess_log_write('Initial Accrual : '|| TO_CHAR(IV_ACCRUAL))

l_log = ess_log_write('Accrual Period Start Date : '|| TO_CHAR(IV_ACCRUALPERIODSTARTDATE,'DD-MON-RRRR'))

l_log = ess_log_write('Accrual Period End Date : '|| TO_CHAR(IV_ACCRUALPERIODENDDATE,'DD-MON-RRRR'))

l_log = ess_log_write('***********************END********************************')

IF (TO_CHAR(ld_effective_date,'YYYY') = TO_CHAR(ld_band1_end_date,'YYYY')) /* (TO_CHAR(ld_effective_date,'YYYY') = TO_CHAR(IV_BAND_CHG_DT1,'YYYY')) */

THEN

(

l_log = ess_log_write('Within Band 1')

l_no_of_ds1 = DAYS_BETWEEN(ld_band1_end_date,ld_term_start_date) + 1

l_log = ess_log_write('l_no_of_ds1 : '|| TO_CHAR(l_no_of_ds1))

l_no_of_ds2 = DAYS_BETWEEN(ld_term_end_date,ld_band1_end_date) + 1

l_log = ess_log_write('l_no_of_ds2 : '|| TO_CHAR(l_no_of_ds2))

l_no_of_ds3 = 0

l_log = ess_log_write('IV_BAND_CHG_BEFVAL1 : '|| TO_CHAR(IV_BAND_CHG_BEFVAL1))

l_log = ess_log_write('IV_BAND_CHG_AFTVAL1 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL1))

l_log = ess_log_write('IV_BAND_CHG_AFTVAL2 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL2))

accrual=(l_no_of_ds1*IV_BAND_CHG_BEFVAL1 + l_no_of_ds2 * IV_BAND_CHG_AFTVAL1 + l_no_of_ds3*IV_BAND_CHG_AFTVAL2)/ 365

l_log = ess_log_write('Accrual : '|| TO_CHAR(accrual))

)

IF (TO_CHAR(ld_effective_date,'YYYY') = TO_CHAR(ld_band2_end_date,'YYYY')) /*(TO_CHAR(ld_effective_date,'YYYY') = TO_CHAR(IV_BAND_CHG_DT2,'YYYY'))*/

THEN

(

l_log = ess_log_write('Within Band 2')

l_no_of_ds1 = 0

l_no_of_ds2 = DAYS_BETWEEN(ld_band2_end_date,ld_term_start_date) + 1

l_log = ess_log_write('l_no_of_ds2 : '|| TO_CHAR(l_no_of_ds2))

l_no_of_ds3 = DAYS_BETWEEN(ld_term_end_date,ld_band2_end_date) + 1

l_log = ess_log_write('l_no_of_ds3 : '|| TO_CHAR(l_no_of_ds3))

l_log = ess_log_write('IV_BAND_CHG_BEFVAL1 : '|| TO_CHAR(IV_BAND_CHG_BEFVAL1))

l_log = ess_log_write('IV_BAND_CHG_AFTVAL1 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL1))

l_log = ess_log_write('IV_BAND_CHG_AFTVAL2 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL2))

accrual=(l_no_of_ds1*IV_BAND_CHG_BEFVAL1 + l_no_of_ds2 * IV_BAND_CHG_AFTVAL1 + l_no_of_ds3*IV_BAND_CHG_AFTVAL2)/ 365

l_log = ess_log_write('Accrual : '|| TO_CHAR(accrual))

)

l_log = ess_log_write(' Prorated Accrual considered : '|| TO_CHAR(accrual))

floored_accrual = FLOOR(accrual)

decimal_accrual = accrual - floored_accrual

IF (decimal_accrual < 0.5 )

THEN

accrual = floored_accrual

IF (decimal_accrual >= 0.5)

THEN

accrual = floored_accrual + 1

l_log = ess_log_write(' Final Accrual considered : '|| TO_CHAR(accrual))

carryover = IV_CARRYOVER

ceiling = IV_CEILING

l_log = ess_log_write(' Carryover : '|| TO_CHAR(IV_CARRYOVER))

l_log = ess_log_write(' Ceiling : '|| TO_CHAR(IV_CEILING))

return accrual,ceiling,carryover

We would discuss more in details about the other Absence Fast Formula in other article.

Till then bye, do try this out.

Viewing all 103 articles
Browse latest View live