Introduction
When we work with extra information types EIT DFF in HRMS, we often need to update an EIT entry for a particular user. We can update an entry from the front end through the application. However, imagine that we have numerous employees, and we need to update an EIT entry for all of them in bulk. In this case, the HRMS API that Oracle provides takes its place to solve that issue.
This article will give an API code example to update EIT from the backend with explanation of each of the API parameters.
Goal
Update EIT using API in Oracle APPS.
Standard API name: “HR_PERSON_EXTRA_INFO_API.HR_PERSON_EXTRA_INFO_API“.
Forms Or Pages
API Prerequisite:
To successfully call this API to update an EIT entry we have to have the following points:
- EIT structure: In our case it will be a custom structure that we have created earlier called “OSK_PASSPORT_INFO“
- EIT entry: to update we need an EIT entry first in a particular business group, and here in our case is an entry for employee number (328)
API Post Success:
Person extra information is successfully created.
API Post Failure:
The API does not create the person extra information and raises an error.
API OUT Parameters :
Parameter Name | Type | Data Type |
---|---|---|
p_object_version_number | OUT | NUMBER |
API Parameters Clarifications:
- param: p_validate If true, then validation alone will be performed and the database will remain unchanged. If false and all validation checks pass, then the database will be modified.
- param: p_person_extra_info_id Identifies the person extra information record to be modified.
- param: p_pei_information_category This context value determines which flexfield structure to use with the developer descriptive flexfield segments.
- param: p_pei_information1 ~ p_pei_information30 Developer Descriptive flexfield segment..
- param: p_pei_attribute_category This context value determines which flexfield structure to use with the descriptive flexfield segments.
- param: p_pei_attribute1 Descriptive flexfield segment.
- param: p_pei_attribute2 Descriptive flexfield segment.
- param: p_pei_attribute3 Descriptive flexfield segment.
- param: p_pei_attribute4 Descriptive flexfield segment.
- param: p_pei_attribute5 Descriptive flexfield segment.
- param: p_pei_attribute6 Descriptive flexfield segment.
- param: p_pei_attribute7 Descriptive flexfield segment.
- param: p_pei_attribute8 Descriptive flexfield segment.
- param: p_pei_attribute9 Descriptive flexfield segment.
- param: p_pei_attribute10 Descriptive flexfield segment.
- param: p_pei_attribute11 Descriptive flexfield segment.
- param: p_pei_attribute12 Descriptive flexfield segment.
- param: p_pei_attribute13 Descriptive flexfield segment.
- param: p_pei_attribute14 Descriptive flexfield segment.
- param: p_pei_attribute15 Descriptive flexfield segment.
- param: p_pei_attribute16 Descriptive flexfield segment.
- param: p_pei_attribute17 Descriptive flexfield segment.
- param: p_pei_attribute18 Descriptive flexfield segment.
- param: p_pei_attribute19 Descriptive flexfield segment.
- param: p_pei_attribute20 Descriptive flexfield segment.
- param: p_object_version_number Pass in the current version number of the person extra information to be updated. When the API completes if p_validate is false, will be set to the new version number of the updated person extra information. If p_validate is true will be set to the same value which was passed in.
Note: This API could be exposed as a web service through SOA Gateway setup in Oracle application.
API Code Example
------------------------------------------
-- Description: API to define organization manager in oracle EBS R12
-- Created By: Hassan @ Oraask.com
-- Creation Date: 27-SEP-2022
------------------------------------------
DECLARE
--
L_INFORMATION_TYPE VARCHAR2 (50) := 'OSK_PASSPORT_INFO';
L_INFORMATION_CAT VARCHAR2 (50) := 'OSK_PASSPORT_INFO';
L_PERSON_ID PER_ALL_PEOPLE_F.PERSON_ID%TYPE;
L_PER_EXTRA_INFO_ID NUMBER;
L_OLD_OVN NUMBER;
L_NEW_OVN NUMBER;
L_EMPLOYEE_NUMBER VARCHAR2 (150) := '328';
L_PASSPORT_NUMBER VARCHAR2 (150) := '6321458964';
L_ERROR_MSG VARCHAR2 (4000);
--
BEGIN
DBMS_OUTPUT.PUT_LINE ('********************************');
-- Get Person Information
DBMS_OUTPUT.PUT_LINE ('Get Person Information');
BEGIN
SELECT PERSON_ID
INTO L_PERSON_ID
FROM PER_ALL_PEOPLE_F
WHERE EMPLOYEE_NUMBER = L_EMPLOYEE_NUMBER
AND PERSON_TYPE_ID = '668'
AND TRUNC (SYSDATE) BETWEEN TRUNC (EFFECTIVE_START_DATE) AND TRUNC (EFFECTIVE_END_DATE);
EXCEPTION
WHEN OTHERS THEN
FND_MESSAGE.SET_NAME ('FND', 'FND_GENERIC_MESSAGE');
FND_MESSAGE.SET_TOKEN ('MESSAGE', ' SEQ: 01' || ' - Cannot Get Person Information: ' || SQLERRM);
L_ERROR_MSG := SUBSTR (FND_MESSAGE.GET, 1, 4000);
RAISE FND_API.G_EXC_ERROR;
END;
-- Get Person Extra Information
DBMS_OUTPUT.PUT_LINE ('Get Person Extra Information');
BEGIN
SELECT PPEI.PERSON_EXTRA_INFO_ID, PPEI.OBJECT_VERSION_NUMBER, PPEI.OBJECT_VERSION_NUMBER
INTO L_PER_EXTRA_INFO_ID, L_OLD_OVN, L_NEW_OVN
FROM PER_PEOPLE_EXTRA_INFO PPEI
WHERE PPEI.PERSON_ID = L_PERSON_ID
AND PPEI.INFORMATION_TYPE = L_INFORMATION_TYPE
AND PPEI.PEI_INFORMATION_CATEGORY = L_INFORMATION_CAT;
EXCEPTION
WHEN OTHERS THEN
FND_MESSAGE.SET_NAME ('FND', 'FND_GENERIC_MESSAGE');
FND_MESSAGE.SET_TOKEN ('MESSAGE', ' SEQ: 02' || ' - Cannot Get Person Extra Information: ' || SQLERRM);
L_ERROR_MSG := SUBSTR (FND_MESSAGE.GET, 1, 4000);
RAISE FND_API.G_EXC_ERROR;
END;
-- Update Person_extra_info API
DBMS_OUTPUT.PUT_LINE ('Call Update Person_extra_info API');
HR_PERSON_EXTRA_INFO_API.UPDATE_PERSON_EXTRA_INFO (P_VALIDATE => FALSE
,P_PERSON_EXTRA_INFO_ID => L_PER_EXTRA_INFO_ID
-- In / Out
,P_OBJECT_VERSION_NUMBER => L_NEW_OVN
-- In
,P_PEI_INFORMATION1 => L_PASSPORT_NUMBER);
IF (L_OLD_OVN <> L_NEW_OVN) THEN
DBMS_OUTPUT.PUT_LINE ('EIT Entry Updated Successfully');
END IF;
DBMS_OUTPUT.PUT_LINE ('********************************');
--
EXCEPTION
WHEN FND_API.G_EXC_ERROR THEN
DBMS_OUTPUT.PUT_LINE (L_ERROR_MSG);
DBMS_OUTPUT.PUT_LINE ('********************************');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE ('Update Failed with Error: ' || SQLERRM);
DBMS_OUTPUT.PUT_LINE ('********************************');
ROLLBACK;
END
/
Output
Get Person Information
Get Person Extra Information
Call Update Person_extra_info API
EIT Entry Updated Successfully
Final Result
Conclusion
This article gives an example of updating person extra information types in Oracle EBS using API from the backend.
Please don’t use this code directly on production environment, instead test it on test environment first to make sure that API working correctly as per your requirements.
Hopefully, it was clear and concise. Share to Spread Knowledge.