Category Archives: Functional

Jumping Employee Number Sequence in Oracle apps

Now we observe we have wrongly created a employee(005736) and we delete and purge the data.

 

Now we have to maintain the correct sequence so what we do is

Go to Work Structures -> Organization -> Description

Query the organization and go to Additional Organization Information and change the employee Number generation to Manual

 

Now change the sequence by  creating the person as in the below screenshot

So update the sequence as below

update PER_NUMBER_GENERATION_CONTROLS

set next_value = 5735   –Current Sequence Number

where type = ‘EMP’ — Assuming you are updating the employee number generation to automatic.

and business_group_id = “Your BG ID”;

Now we have to change the next sequence to 005736

After updating the script Now we have to run a concurrent Program

After running the program test it by creating a Employee

Advertisements

Sales order got stuck in Workflow as Deferred

We got a Issue that the Sales order was stuck in Deferred status. We get this Issue sometimes as shown in the below screenshot.

What we used to do is we will submit a Concurrent Program called Workflow Background Process with below parameters

Process Deferred  = Yes

Process Timeout = Yes

Process Stuck = Yes.

But After running the process still we were having the Same Problem.

So we just checked the Workflow manager as below

Workflow Administrator Web Applications –> Oracle Applications Manager –> Workflow Manager and I was able to see all was up.

So I raised a SR with Oracle and they started to Analyze and then we came to know that

To Close the order header as soon as the line is closed one needs to customize workflow . This will affect only new orders that uses this newly modified Flow. For the existing orders, one needs to wait till the end of the month – the month in which the Sales Order was created. Please note that this happens only for the month the Sales order is created.
Use Workflow Builder to change the Node Attribute of Wait Mode to a value of
Relative Time and then set Relative Time to a constant.

Below is the note

How to Change the Wait Mode in WorkFlow to Process Order Headers with Closed Lines to Close Before the End of the Month ( Doc ID 145011.1 )

So below are the steps that has been provided by Oracle

Please perform the following steps in test instance:

1. Connect to the database using the Work flow Builder.
2. Go to OM order header work flow.
3. In work flow builder , this needs to be done from to enable the customization,
Help — About Oracle Work flow Builder, Check to allow customization.
4. Open Work-flow Process – Order Flow – Generic, Close – Order
5. Copy ‘Order Flow – Generic’ and ‘Close – Order’ and rename them, for example, ‘XX Order Flow – Generic’ and ‘XX Close – Order’, respectively.
6. Right click activity ‘Wait’ (labeled WAIT-1) that is just before activity ‘Close – Wait For Line’ in process ‘XX Close – Order’. In the Properties, choose Node Attributes tab and place cursor on the “Day of the month” and remove the Value that is currently set as “Last”.
7. Change the following appropriate values as below

Changing the Relative Time parameter of activity WAIT-1 to calculated time as mentioned below
Wait Mode = “Relative Time”
Day of Month = none
Click apply button
Save the work flow activity

Relative time can be calculated by following method
To Close immediately – 0
After one hour- 1/24 – 0.0416
After two hour – 2/24 – 0.0833
One day – 1
Two day – 2

Please note that setting Relative Time to 0 will cause an order that is booked with no lines at the time of booking to close almost immediately. This is usually not desired.

8. Replace the process ‘Close Order’ in ‘XX Order Flow – Generic’ with ‘XX Close – Order’ .
9. Save the Workflow process
10. Navigate to Setup -> Transaction Type
Query the Order Type ‘XX Standard’.
Attach the new process to the transaction type ‘XX Standard’.
Order Workflow = ‘XX Order Flow – Generic’
Retest the issue as below:

1. Create an order and one line for any item for transaction type XX Standard. Book the order.
2. Go to line information
3. Cancel the line
5. Re query the order
5. Check whether the line is canceled
6. Run the “Workflow Background Process” concurrent program with the following parameters.
Parameters –> Item type — OM Order Line,
Process deferred – Yes
Time out – No
7. Check whether the request ends successfully.
8. Run the “Workflow Background Process” concurrent program with the following parameters.
Parameters –> Item type — OM Order Header
Process deferred – Yes
Process Time out – No
9. Check whether the request ends successfully.
10. Query the order.

Now the line will be closed as per the calculated time set at relative time values.

Thank you.

 

 

 

Download IRecruitment Resumes in Server and in client(TOAD)

We had a requirement from user that to download and process all the resume.

So When checked with the Doc ID 1578603.1 it tells that we can Download Resume as there is no Inbuild Tool but we can write Queries If Any. The uploaded resumes can be found in table IRC_DOCUMENTS via the column CHARACTER_DOC which is of type CLOB.

On Toad We can See below as Save to File Option by which we can download and give the same name as FILE_NAME Column to the Document.

 

Now we are going to download the same on server in bulk and Implementing for many records below is the script.

Steps to download in Server

Step: 1

CREATE DIRECTORY datadump AS ‘E:\datadump\test’;

Create a Directory with Server path by SYS user in database. As the above command is for windows server. In case your Environment is Linux use the correct path accordingly.

Step: 2

grant read, write on directory DATADUMP to apps

Grant Read, Write access to the Directory

Step: 3 Verify

select directory_path from all_directories where directory_name = ‘DATADUMP’;

SELECT * FROM all_tab_privs WHERE table_name = ‘DATADUMP’;

Check whether the directory has been created correctly  and access has been given correctly.

Step: 4 Query to retrive the records.

SELECT PPF.FULL_NAME AS PERSON_NAME,
PPF.EMAIL_ADDRESS,
PPF.DATE_OF_BIRTH,
PAV.NAME AS VACANCY_NAME,
DOC.DOCUMENT_ID,
DOC.BINARY_DOC,
DOC.FILE_NAME
FROM PER_ALL_PEOPLE_F PPF,
PER_ALL_ASSIGNMENTS_F PAF,
PER_ALL_VACANCIES PAV,
IRC_ASSIGNMENT_STATUSES IAS,
PER_ASSIGNMENT_STATUS_TYPES_V AST,
IRC_DOCUMENTS DOC,
IRC_NOTIFICATION_PREFERENCES INP
WHERE sysdate BETWEEN PPF.EFFECTIVE_START_DATE
AND PPF.EFFECTIVE_END_DATE
AND PPF.PERSON_ID = PAF.PERSON_ID
AND PAF.VACANCY_ID = PAV.VACANCY_ID
AND PAF.ASSIGNMENT_ID = IAS.ASSIGNMENT_ID
AND pav.name = p_vac_name
AND ias.ASSIGNMENT_STATUS_TYPE_ID = ‘4’ –Active Application
AND irc_utilities_pkg.GET_RECRUITMENT_PERSON_ID (PPF.PERSON_ID) =
INP.person_id(+)
AND INP.PERSON_ID = DOC.PERSON_ID(+)
AND IAS.ASSIGNMENT_STATUS_TYPE_ID = AST.ASSIGNMENT_STATUS_TYPE_ID(+)
AND doc.TYPE(+) LIKE ‘%RESUME’
AND doc.end_date(+) IS NULL;

Step: 5 Execute the Below Script

DECLARE
l_file UTL_FILE.FILE_TYPE;
l_buffer RAW (32767);
l_amount BINARY_INTEGER := 32767;
l_pos number := 1;
l_blob BLOB;
l_blobname VARCHAR2 (50);
l_blob_len number;
ctrl number;
— p_vac_name varchar2(100):=’IRC110′;

cursor c_irc_doc(p_vac_name in varchar) is SELECT PPF.FULL_NAME AS PERSON_NAME,
PPF.EMAIL_ADDRESS,
PPF.DATE_OF_BIRTH,
PAV.NAME AS VACANCY_NAME,
DOC.DOCUMENT_ID,
DOC.BINARY_DOC,
DOC.FILE_NAME
FROM PER_ALL_PEOPLE_F PPF,
PER_ALL_ASSIGNMENTS_F PAF,
PER_ALL_VACANCIES PAV,
IRC_ASSIGNMENT_STATUSES IAS,
PER_ASSIGNMENT_STATUS_TYPES_V AST,
IRC_DOCUMENTS DOC,
IRC_NOTIFICATION_PREFERENCES INP
WHERE sysdate BETWEEN PPF.EFFECTIVE_START_DATE
AND PPF.EFFECTIVE_END_DATE
AND PPF.PERSON_ID = PAF.PERSON_ID
AND PAF.VACANCY_ID = PAV.VACANCY_ID
AND PAF.ASSIGNMENT_ID = IAS.ASSIGNMENT_ID
AND pav.name = p_vac_name
AND ias.ASSIGNMENT_STATUS_TYPE_ID = ‘4’ –Active Application
AND irc_utilities_pkg.GET_RECRUITMENT_PERSON_ID (PPF.PERSON_ID) =
INP.person_id(+)
AND INP.PERSON_ID = DOC.PERSON_ID(+)
AND IAS.ASSIGNMENT_STATUS_TYPE_ID = AST.ASSIGNMENT_STATUS_TYPE_ID(+)
AND doc.TYPE(+) LIKE ‘%RESUME’
AND doc.end_date(+) IS NULL;

BEGIN

FOR i in c_irc_doc loop(‘IRC110’)–Position Name for taking the Resume

l_blob_len := DBMS_LOB.getlength(i.binary_doc);
l_file := UTL_FILE.fopen(‘APPS_DATA_FILE_DIR’,i.file_name,’WB’, 32767);
— Read chunks of the BLOB and write them to the file created in directory until complete.
WHILE l_pos < l_blob_len LOOP
DBMS_LOB.read(i.binary_doc, l_amount, l_pos, l_buffer);
UTL_FILE.put_raw(l_file, l_buffer, TRUE);
l_pos := l_pos + l_amount;
END LOOP; — This will end the While loop when condition met.
l_blob_len :=0;
l_pos :=1;
— Close the file.
UTL_FILE.fclose(l_file);
end loop; — This will end the FOR loop when all BLOB files in the table have been downloaded.
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(‘Exception’||SQLERRM||SQLCODE);
— Close the file if something goes wrong.
IF UTL_FILE.is_open(l_file) THEN
UTL_FILE.fclose(l_file);
END IF;
–RAISE;
END;
/

 

Steps to download in TOAD

Execute the Query in the Step : 4

Now click on Binary Doc Column and right click Single Column Export

 

Now give the path and Column of the Value to be renamed for File

 

Then Export will be downloaded.

Now the Resumes will be downloaded in the mentioned path.

TOAD 12 is faster for Exporting Blob than in Server.

If you have an older version of Toad, it’s called “Export BLOBs (long,raw)” instead.

Happy resume Exporting….

Transaction visible in GL Interface table but not Imported in Journal

I faced a problem that the transaction was in GL Interface table which is visible but not imported.

select * from gl_interface where trunc(ACCOUNTING_DATE) = :gl_date;

However I tried to import and then I tried to see whether there is any error while Importing

General Ledger Super User –> Journal –> Import –> Correct.

But still I was not able to find the transaction.

Then I just check the log of the Concurrent which tells to check Group ID. So I took group Id from below Query and then I submitted.

select group_id from gl_interface where trunc(ACCOUNTING_DATE) = :gl_date;

Hurrah Now the Journal got Imported.

 

 

Making a responsibility as Read Only in Oracle Applications

We have to set two Profile options in Responsibility to make as read only and it is applicable for only HR responsibilities.

Login user with System Administrator responsibility and navigate to Profile-> System menu as shown below in the picture

HR: User type

HR:Query Only Mode

 

 

DFF dynamically vary using a Reference Field

Overview of Requirement

I had a requirement to enable a field in DFF to capture a field called POS Machine. The Field should automatically read from the table value and should be enabled dynamically without user response.

Step 1 : Find the DFF

To check what is the DFF find it by table information. Our data will sit in AR_CASH_RECEIPTS_ALL.

So take the same and query in DFF screen

Navigation

Application Developer => Flexfield => Descriptive => Register

Query the same with AR_CASH_RECEIPTS_ALL and get the Title that is Receipt Information. This is the exact DFF that we are looking for.

select * from AR_RECEIPT_METHODS

In this the we are taking a RECEIPT_METHOD_ID which is linked to AR_CASH_RECEIPTS_ALL table.

Step : 2 Enter the Reference Field in DFF Register.

Navigation

Application Developer => Flexfield => Descriptive => Register

Query the Receipt Information in DFF and click on Reference Fields to enter the RECEIPT_METHOD_ID

Step : 3 Enter Reference Field Values

Now go to the DFF screen and enter RGW_FOLDER.RECEIPT_METHOD_ID as with this we will be choosing the value and enter the valid value in the Context Field Values.

So whenever the DFF looks for the value mentioned it will automatically set the DFF in the page.

Step : 4 Testing

Go to Receivables Manager => Receipts => Receipts

Now our requirement is fulfilled as seen in the above screenshot.

Note: We have changed the reference value from RECEIPT_METHOD_ID to RGW_FOLDER.RECEIPT_METHOD_ID as because we were facing the error while reversing the receipt.

 

 

 

 

Descriptive Flex-fields DFF in Oracle Apps

Descriptive flex-fields lets you add additional fields to the form in order to track additional information needed by the business that would not be captured by the standard form. Descriptive flex-fields can be context sensitive, where the information your application stores depends on other values your users enter in other parts of the form.

A descriptive flex-field appears on a form as a single–character, unnamed field enclosed in Square Brackets [ ]. Each field or segment in a descriptive flex-field has a prompt and can have a set of valid values.

Descriptive Flex-field Concepts:

Descriptive flex-fields have two different types of segments, global and context–sensitive.

A global segment is a segment that always appears in the descriptive flex-field pop–up window.

A context–sensitive segment is a segment that may or may not appear depending upon what other information is present in your form.

A descriptive flex-field can get context information from either a field somewhere on the form, or from a special field (a context field) inside the descriptive flex-field pop–up window. If the descriptive flex-field derives the context information from a form field (either displayed or hidden from users), that field is called a reference field for the descriptive flex-field.

For Example , Had Taken the Purchase order form and enabled the DFF Field.

Go to Purchasing —>Purchase order–> Purchase Order

       

To enable DFF Go to

Switch Responsibility to Application Developer.

Define Value Set:

Switch Responsibility to Application Developer–>Flexfield—>Descriptive–>Sets.

Value sets are defined to identify the valid values that are permissible for each segment of the Chart of Accounts.

Then Define the Descriptive FlexField Segments.

Go to Application developer-flexfield–>Descriptive–> Segments

Query with the Application as’ Purchasing’ and Title as ‘PO Headers’

Before Entering you have Uncheck the Freeze Flexfield Definition. Then check the Required context fields.

Then click on the Segments. Enter the Segments which will reflect in the Purchase Order DFF Field

Save it . Then Check the Freeze Descriptive Definition and compile it.

The DFF can be disable by Unfreeze the DFF segments first and Uncheck the Enabled check box of Descriptive Flexfield Segments .After Disabling the DFF Segments Check the Freeze Flexfield Definition and Compile the segment.

Then go to View–> Request–>find. Will see the Concurrent Program” Flexfield View Generator” running. After the Completion of the concurrent Program we can view the DFF in the purchase order form.

Switch resp to Purchasing–>purchase order—> Purchase Order

User Hooks in Oracle Apps for comments validation

I had a requirement to Validate the comments for certain leave types. So I first try to do the same in BG_ABSENCE_DURATION Fast formula. However I was facing some problem that is

  • Not able to capture comments or Absence Attendance Id in fast formula
  • While clicking on next only the record will get created and comments will be passed still it was complex to write logic in FF

So I went with User Hooks.

In simple words user hooks is functionality provided in Oracle HRMS for validating or extending our custom functionality based on business rules.

What we can do with user hooks is : Validate EIT, SIT, Absence and manipulate and maintain the data for Oracle to our tables

Attention: You should not manually edit the API source code files supplied by Oracle If you do modify these codes, Oracle Applications will be unable to support the product, and upgrades may not be possible. Oracle Applications only supports direct calls to the published APIs. Direct calls to any other server-side package procedures or functions that are written as part of the Oracle HRMS Applications suite are not supported.

Note: All Oracle HRMS forms does not use HRMS APIs, User hook can be implemented for only those forms which perform functions through API. The HR_API_HOOKS table holds all available API hooks for APIs in HR_API_MODULES table.

Implementation Steps For User Hooks

Four steps are required to implement API User Hooks:

Step 1 – Identifying the correct User Hook API

SELECT ahk.api_hook_id,
ahk.api_module_id,
ahk.hook_package,
ahk.hook_procedure
FROM hr_api_hooks ahk, hr_api_modules ahm
WHERE ahm.module_name like ‘%_PERSON_ABSENCE%’
AND ahm.api_module_type = ‘BP’
AND ahk.api_hook_type = ‘AP’
AND ahk.api_module_id = ahm.api_module_id

It will show all Person Absence relevant APIs.We need to select the correct API that matched with our requirement. For Example for above mentioned requirement, we shall select CREATE_PERSON_ABSENCE_A API. We shall note its API_HOOK_ID (3840) and API_MODULE_ID (1731) as API_HOOK_ID will be used at the time of registration of user hook mentioned in Step 3 ahead and API_MODULE_ID will be needed in running the processor in Step 4.

Step 2. Create PL/SQL procedure to execute your logic.

CREATE OR REPLACE PACKAGE APPS.XXHW_ABS_USERHOOK_PKG
AS
PROCEDURE XXHW_CREATE_ABS_VAL_P
(P_EFFECTIVE_DATE in DATE
,P_PERSON_ID in NUMBER
,P_BUSINESS_GROUP_ID in NUMBER
,P_ABSENCE_ATTENDANCE_TYPE_ID in NUMBER
,P_ABS_ATTENDANCE_REASON_ID in NUMBER
,P_COMMENTS in LONG
,P_DATE_NOTIFICATION in DATE
,P_DATE_PROJECTED_START in DATE
,P_TIME_PROJECTED_START in VARCHAR2
,P_DATE_PROJECTED_END in DATE
,P_TIME_PROJECTED_END in VARCHAR2
,P_DATE_START in DATE
,P_TIME_START in VARCHAR2
,P_DATE_END in DATE
,P_TIME_END in VARCHAR2
,P_ABSENCE_DAYS in NUMBER
,P_ABSENCE_HOURS in NUMBER
,P_AUTHORISING_PERSON_ID in NUMBER
,P_REPLACEMENT_PERSON_ID in NUMBER
,P_ATTRIBUTE_CATEGORY in VARCHAR2
,P_ATTRIBUTE1 in VARCHAR2
,P_ATTRIBUTE2 in VARCHAR2
,P_ATTRIBUTE3 in VARCHAR2
,P_ATTRIBUTE4 in VARCHAR2
,P_ATTRIBUTE5 in VARCHAR2
,P_ATTRIBUTE6 in VARCHAR2
,P_ATTRIBUTE7 in VARCHAR2
,P_ATTRIBUTE8 in VARCHAR2
,P_ATTRIBUTE9 in VARCHAR2
,P_ATTRIBUTE10 in VARCHAR2
,P_ATTRIBUTE11 in VARCHAR2
,P_ATTRIBUTE12 in VARCHAR2
,P_ATTRIBUTE13 in VARCHAR2
,P_ATTRIBUTE14 in VARCHAR2
,P_ATTRIBUTE15 in VARCHAR2
,P_ATTRIBUTE16 in VARCHAR2
,P_ATTRIBUTE17 in VARCHAR2
,P_ATTRIBUTE18 in VARCHAR2
,P_ATTRIBUTE19 in VARCHAR2
,P_ATTRIBUTE20 in VARCHAR2
,P_OCCURRENCE in NUMBER
,P_PERIOD_OF_INCAPACITY_ID in NUMBER
,P_SSP1_ISSUED in VARCHAR2
,P_MATERNITY_ID in NUMBER
,P_SICKNESS_START_DATE in DATE
,P_SICKNESS_END_DATE in DATE
,P_PREGNANCY_RELATED_ILLNESS in VARCHAR2
,P_REASON_FOR_NOTIFICATION_DELA in VARCHAR2
,P_ACCEPT_LATE_NOTIFICATION_FLA in VARCHAR2
,P_LINKED_ABSENCE_ID in NUMBER
,P_BATCH_ID in NUMBER
,P_CREATE_ELEMENT_ENTRY in BOOLEAN
,P_ABS_INFORMATION_CATEGORY in VARCHAR2
,P_ABS_INFORMATION1 in VARCHAR2
,P_ABS_INFORMATION2 in VARCHAR2
,P_ABS_INFORMATION3 in VARCHAR2
,P_ABS_INFORMATION4 in VARCHAR2
,P_ABS_INFORMATION5 in VARCHAR2
,P_ABS_INFORMATION6 in VARCHAR2
,P_ABS_INFORMATION7 in VARCHAR2
,P_ABS_INFORMATION8 in VARCHAR2
,P_ABS_INFORMATION9 in VARCHAR2
,P_ABS_INFORMATION10 in VARCHAR2
,P_ABS_INFORMATION11 in VARCHAR2
,P_ABS_INFORMATION12 in VARCHAR2
,P_ABS_INFORMATION13 in VARCHAR2
,P_ABS_INFORMATION14 in VARCHAR2
,P_ABS_INFORMATION15 in VARCHAR2
,P_ABS_INFORMATION16 in VARCHAR2
,P_ABS_INFORMATION17 in VARCHAR2
,P_ABS_INFORMATION18 in VARCHAR2
,P_ABS_INFORMATION19 in VARCHAR2
,P_ABS_INFORMATION20 in VARCHAR2
,P_ABS_INFORMATION21 in VARCHAR2
,P_ABS_INFORMATION22 in VARCHAR2
,P_ABS_INFORMATION23 in VARCHAR2
,P_ABS_INFORMATION24 in VARCHAR2
,P_ABS_INFORMATION25 in VARCHAR2
,P_ABS_INFORMATION26 in VARCHAR2
,P_ABS_INFORMATION27 in VARCHAR2
,P_ABS_INFORMATION28 in VARCHAR2
,P_ABS_INFORMATION29 in VARCHAR2
,P_ABS_INFORMATION30 in VARCHAR2
,P_ABSENCE_ATTENDANCE_ID in NUMBER
,P_OBJECT_VERSION_NUMBER in NUMBER
);
END XXHW_ABS_USERHOOK_PKG;

 

CREATE OR REPLACE PACKAGE BODY APPS.XXHW_ABS_USERHOOK_PKG
IS
PROCEDURE XXHW_CREATE_ABS_VAL_P (
P_EFFECTIVE_DATE IN DATE,
P_PERSON_ID IN NUMBER,
P_BUSINESS_GROUP_ID IN NUMBER,
P_ABSENCE_ATTENDANCE_TYPE_ID IN NUMBER,
P_ABS_ATTENDANCE_REASON_ID IN NUMBER,
P_COMMENTS IN LONG,
P_DATE_NOTIFICATION IN DATE,
P_DATE_PROJECTED_START IN DATE,
P_TIME_PROJECTED_START IN VARCHAR2,
P_DATE_PROJECTED_END IN DATE,
P_TIME_PROJECTED_END IN VARCHAR2,
P_DATE_START IN DATE,
P_TIME_START IN VARCHAR2,
P_DATE_END IN DATE,
P_TIME_END IN VARCHAR2,
P_ABSENCE_DAYS IN NUMBER,
P_ABSENCE_HOURS IN NUMBER,
P_AUTHORISING_PERSON_ID IN NUMBER,
P_REPLACEMENT_PERSON_ID IN NUMBER,
P_ATTRIBUTE_CATEGORY IN VARCHAR2,
P_ATTRIBUTE1 IN VARCHAR2,
P_ATTRIBUTE2 IN VARCHAR2,
P_ATTRIBUTE3 IN VARCHAR2,
P_ATTRIBUTE4 IN VARCHAR2,
P_ATTRIBUTE5 IN VARCHAR2,
P_ATTRIBUTE6 IN VARCHAR2,
P_ATTRIBUTE7 IN VARCHAR2,
P_ATTRIBUTE8 IN VARCHAR2,
P_ATTRIBUTE9 IN VARCHAR2,
P_ATTRIBUTE10 IN VARCHAR2,
P_ATTRIBUTE11 IN VARCHAR2,
P_ATTRIBUTE12 IN VARCHAR2,
P_ATTRIBUTE13 IN VARCHAR2,
P_ATTRIBUTE14 IN VARCHAR2,
P_ATTRIBUTE15 IN VARCHAR2,
P_ATTRIBUTE16 IN VARCHAR2,
P_ATTRIBUTE17 IN VARCHAR2,
P_ATTRIBUTE18 IN VARCHAR2,
P_ATTRIBUTE19 IN VARCHAR2,
P_ATTRIBUTE20 IN VARCHAR2,
P_OCCURRENCE IN NUMBER,
P_PERIOD_OF_INCAPACITY_ID IN NUMBER,
P_SSP1_ISSUED IN VARCHAR2,
P_MATERNITY_ID IN NUMBER,
P_SICKNESS_START_DATE IN DATE,
P_SICKNESS_END_DATE IN DATE,
P_PREGNANCY_RELATED_ILLNESS IN VARCHAR2,
P_REASON_FOR_NOTIFICATION_DELA IN VARCHAR2,
P_ACCEPT_LATE_NOTIFICATION_FLA IN VARCHAR2,
P_LINKED_ABSENCE_ID IN NUMBER,
P_BATCH_ID IN NUMBER,
P_CREATE_ELEMENT_ENTRY IN BOOLEAN,
P_ABS_INFORMATION_CATEGORY IN VARCHAR2,
P_ABS_INFORMATION1 IN VARCHAR2,
P_ABS_INFORMATION2 IN VARCHAR2,
P_ABS_INFORMATION3 IN VARCHAR2,
P_ABS_INFORMATION4 IN VARCHAR2,
P_ABS_INFORMATION5 IN VARCHAR2,
P_ABS_INFORMATION6 IN VARCHAR2,
P_ABS_INFORMATION7 IN VARCHAR2,
P_ABS_INFORMATION8 IN VARCHAR2,
P_ABS_INFORMATION9 IN VARCHAR2,
P_ABS_INFORMATION10 IN VARCHAR2,
P_ABS_INFORMATION11 IN VARCHAR2,
P_ABS_INFORMATION12 IN VARCHAR2,
P_ABS_INFORMATION13 IN VARCHAR2,
P_ABS_INFORMATION14 IN VARCHAR2,
P_ABS_INFORMATION15 IN VARCHAR2,
P_ABS_INFORMATION16 IN VARCHAR2,
P_ABS_INFORMATION17 IN VARCHAR2,
P_ABS_INFORMATION18 IN VARCHAR2,
P_ABS_INFORMATION19 IN VARCHAR2,
P_ABS_INFORMATION20 IN VARCHAR2,
P_ABS_INFORMATION21 IN VARCHAR2,
P_ABS_INFORMATION22 IN VARCHAR2,
P_ABS_INFORMATION23 IN VARCHAR2,
P_ABS_INFORMATION24 IN VARCHAR2,
P_ABS_INFORMATION25 IN VARCHAR2,
P_ABS_INFORMATION26 IN VARCHAR2,
P_ABS_INFORMATION27 IN VARCHAR2,
P_ABS_INFORMATION28 IN VARCHAR2,
P_ABS_INFORMATION29 IN VARCHAR2,
P_ABS_INFORMATION30 IN VARCHAR2,
P_ABSENCE_ATTENDANCE_ID IN NUMBER,
P_OBJECT_VERSION_NUMBER IN NUMBER)
IS
L_ABSENCE_TYPE VARCHAR2 (500) := NULL;
L_ASSIGNMENT_ID NUMBER;
L_ABSENCE_START_DATE DATE
:= NVL (P_DATE_START, P_DATE_PROJECTED_START);
L_ABSENCE_END_DATE DATE := NVL (P_DATE_END, P_DATE_PROJECTED_END);
L_ABSENCE_FUTURE_ST_DATE DATE;
L_ABSENCE_FUTURE_END_DATE DATE;
LN_LENGTH NUMBER := 0;
LC_MSG VARCHAR2 (500);
BEGIN
IF P_ABSENCE_ATTENDANCE_TYPE_ID IN (4085, 4086, 4087, 4088)
THEN
LN_LENGTH := NVL (LENGTH (TO_CHAR (P_COMMENTS)), 0);

IF LN_LENGTH <= 1
THEN
LC_MSG := ‘Comments are Mandatory’;
HR_UTILITY.SET_MESSAGE (800, LC_MSG);
HR_UTILITY.RAISE_ERROR;
END IF;
ELSE
NULL;
END IF;
END XXHW_CREATE_ABS_VAL_P;
END XXHW_ABS_USERHOOK_PKG;

3. Register your procedure with one or more specific user hooks.

We shall use the API_HOOK_ID identified in Step 1 in the parameter p_api_hook_id. Through this API, custom logic will be registered against user hook.

DECLARE
L_API_HOOK_ID NUMBER := 3840;
L_API_HOOK_CALL_ID NUMBER;
L_OBJECT_VERSION_NUMBER NUMBER;
L_SEQUENCE NUMBER;
BEGIN
SELECT HR_API_HOOKS_S.NEXTVAL INTO L_SEQUENCE FROM DUAL;

HR_API_HOOK_CALL_API.CREATE_API_HOOK_CALL (
P_VALIDATE => FALSE,
P_EFFECTIVE_DATE => SYSDATE – 10,
P_API_HOOK_ID => L_API_HOOK_ID,
P_API_HOOK_CALL_TYPE => ‘PP’,
P_SEQUENCE => L_SEQUENCE,
P_ENABLED_FLAG => ‘Y’,
P_CALL_PACKAGE => ‘XXHW_ABS_USERHOOK_PKG’, –CUSTOM PACKAGE
P_CALL_PROCEDURE => ‘XXHW_CREATE_ABS_VAL_P’, — CUSTOM PROCEDURE
P_API_HOOK_CALL_ID => L_API_HOOK_CALL_ID,
P_OBJECT_VERSION_NUMBER => L_OBJECT_VERSION_NUMBER);
DBMS_OUTPUT.PUT_LINE (‘L_API_HOOK_CALL_ID ‘ || L_API_HOOK_CALL_ID);
END;

 

After this step, you shall be able to see the reference of your custom package/ procedure in table HR_API_HOOK_CALLS. You can check it by using following query

SELECT *
FROM HR_API_HOOK_CALLS
WHERE api_hook_id = 3840;

4. Run the pre-processor program

Run pre-processor script hrahkone.sql with module name as parameter (PER_TOP/admin/sql/hrahkone.sql).It compile API hook. After running this your APIhook Package should have custom procedure call.

or

DECLARE
L_API_MODULE_ID NUMBER := 1731;
BEGIN
HR_API_USER_HOOKS_UTILITY.CREATE_HOOKS_ONE_MODULE (L_API_MODULE_ID);
DBMS_OUTPUT.PUT_LINE (‘Success’);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE (‘Exception : ‘ || SQLERRM);
END;

Alternately you can use the following API to run the pre-processor

At this level, your user hook is implemented and should work as per your requriement.
If you change your custom package body, you dont need to run the pre-processor again but if you change the procedure signature, you will need to run the pre-processory again,

 

Delete custom code from APIuser Hook

Get Hook Call ID and Object Version_number

SELECT api_hook_call_id,object_version_number
FROM HR_API_HOOK_CALLS
WHERE call_package = ‘LSG_USERHOOK_PKG’
AND call_procedure = UPPER(‘LSG_CREATE_ABS_VAL_P’)

DECLARE
L_API_MODULE_ID NUMBER := 1731;
BEGIN
HR_API_USER_HOOKS_UTILITY.CREATE_HOOKS_ONE_MODULE (L_API_MODULE_ID);
DBMS_OUTPUT.PUT_LINE (‘Success’);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE (‘Exception : ‘ || SQLERRM);
END;

Note : In case if you are facing any error cross check the same parameters are there in the seeded package.

Source learned from

Thank You.

Process for Reversal of Payroll when Journal is Posted

We had a Issue that HR was testing Payroll for a user but unfortunately Finance had done costing and they have posted to GL.

I had many things running in my mind that whether we will be able to roll back all the process or what can be done to resolve this as Finance has posted and it should be also reversed. After that with help of my collegue we have done this.

Reversal in HRMS allows to reverse the Entries in Costing which nullifies the amount.

Example :

Basic Salary Pay Value 01.00.00000.000.32110.000.0000.0000 Credit

In the above table the first one which will be as credit to Employee. So once we done reversal and costing we will get the record as below so Now the credit amount and debit amount gets nullified

Basic Salary Pay Value 01.00.00000.000.32110.000.0000.0000 Debit

Only reversal can be used after post payroll process and retry will not work after post payroll process. The steps are as follows.

Step 1: Reversal of the Payroll

Select the employee whom we have to rollback/reverse

Nav : Fastpath –> Reverse Payroll Run –> Select the Employee –
Check the Employee and the reversal as shown below

Step 2: Make sure the Reversal has applied.

Global HRMS Manager –> View –> Assignment Process Results

 

Step 3 : Check the Costing Detail Report whether there is a reflection

select * from pay_costing_details_v where effective_date between :p_frm_date and :p_to_date and EMPLOYEE_NUMBER = ‘005225’

Step 4 : Costing process.

As costing entries were not yet created not we have costing process.

So run the costing process

Step 5: Check the Costing Detail Report

Once Costing Process is done now check the reverse of the entry has been created.

Cross check the same using costing detail report or by the below query

select * from pay_costing_details_v where effective_date between :p_frm_date and :p_to_date and EMPLOYEE_NUMBER = ‘005225’

Step 6: Transfer to GL process

Once this is done run transfer to GL process

Step 7: Import the Journal

Go to General Ledger and Import the Journal

General Ledger –> Import  –> Run

Step 8: Validate the journal entries and post it.