Search This Blog

Wednesday, November 14, 2018

Oracle Apps R12 api to upload PER_QUALIFICATION_TYPES in english and Arabic (Multi-Lingual)


1. Interface Table

CREATE TABLE XXFUJ_INT_QUAL_TYPES
(
ID NUMBER,
CODE VARCHAR2(240),
NAME_ENG VARCHAR2(240),
NAME_AR VARCHAR2(240),
CATEGORY VARCHAR2(240),
ATTRIBUTE1 VARCHAR2(240),
ATTRIBUTE2 VARCHAR2(240),
ATTRIBUTE3 VARCHAR2(240),
ATTRIBUTE4 VARCHAR2(240),
ATTRIBUTE5 VARCHAR2(240)
)

2. FOR ENGLISH

declare
l_qualification_type_id NUMBER;
l_object_version_number NUMBER;
CURSOR C1 IS
SELECT * FROM XXFUJ_INT_QUAL_TYPES
--WHERE CODE = 100
WHERE ID IS NULL
;
begin
FOR I IN C1 LOOP
HR_QUALIFICATION_TYPE_API.create_qualification_type(
P_EFFECTIVE_DATE => SYSDATE
,P_NAME => I.NAME_ENG
,P_CATEGORY => I.CATEGORY
--,p_language_code => 'AR'
,p_qualification_type_id => l_qualification_type_id
,p_object_version_number => l_object_version_number
);
UPDATE XXFUJ_INT_QUAL_TYPES
SET ID = l_qualification_type_id
WHERE CODE= I.CODE;
COMMIT;
END LOOP;
exception when others then
dbms_output.put_line(sqlerrm);
end;


--SELECT * FROM PER_QUALIFICATION_TYPES


3.FOR ARABIC-

declare
l_qualification_type_id NUMBER;
l_object_version_number NUMBER := 1;
l_language_code VARCHAR2(200) := 'AR';
--L_object_version_number NUMBER;
CURSOR C1 IS
SELECT OBJECT_VERSION_NUMBER,
ID, CODE, (select flv.meaning --flv.lookup_CODE,
from fnd_lookup_types hrl,fnd_lookup_values flv
where hrl.lookup_type  = flv.lookup_type
AND language = 'AR'
and hrl.lookup_type  = 'AE_EDUCATION_LEVEL'
AND XXFUJ.CODE = FLV.LOOKUP_CODE
)NAME_AR1 FROM XXFUJ_INT_QUAL_TYPES XXFUJ, PER_QUALIFICATION_TYPES PER
WHERE
PER.QUALIFICATION_TYPE_ID = XXFUJ.ID
--AND XXFUJ.ID NOT IN ( 1030,1010,1011,1012,1013,1014)
;
/*SELECT
ID, CODE, (select flv.meaning --flv.lookup_CODE,
from fnd_lookup_types hrl,fnd_lookup_values flv
where hrl.lookup_type  = flv.lookup_type
AND language = 'AR'
and hrl.lookup_type  = 'AE_EDUCATION_LEVEL'
AND XXFUJ.CODE = FLV.LOOKUP_CODE
)NAME_AR1 FROM XXFUJ_INT_QUAL_TYPES XXFUJ
WHERE ID NOT IN ( 1030,1010,1011,1012,1013)
;*/
begin
FOR  I IN C1 LOOP
--dbms_output.put_line('HI');
HR_QUALIFICATION_TYPE_API.update_qualification_type(
p_qualification_type_id => I.ID
,p_object_version_number => I.OBJECT_VERSION_NUMBER
,P_language_code => L_language_code
,P_EFFECTIVE_DATE => SYSDATE
,P_NAME => I.NAME_AR1
--,p_language_code => l_language_code
--,p_qualification_type_id => l_qualification_type_id
);
commit;
END LOOP;
dbms_output.put_line(sqlerrm);
exception when others then
dbms_output.put_line(sqlerrm);
end;

No comments:

Post a Comment