Create LOV from Backend in webadi
How to Set
the LOV from backend Scrip or API in Webadi:-
--====================================================
CREATE TABLE APPS.XXSD_WEB_ADI_TL
(
EMPLOYEE_NUMBER VARCHAR2(100 BYTE),
FIRST_NAME VARCHAR2(100 BYTE),
LAST_NAME VARCHAR2(100 BYTE),
DATE_OF_BIRTH DATE,
GRADE VARCHAR2(10 BYTE),
REMARKS VARCHAR2(100 BYTE),
ATTRIBUTE1 VARCHAR2(100 BYTE),
ATTRIBUTE2 VARCHAR2(100 BYTE),
ATTRIBUTE3 VARCHAR2(100 BYTE),
ATTRIBUTE4 VARCHAR2(100 BYTE),
ATTRIBUTE5 VARCHAR2(100 BYTE),
ATTRIBUTE6 VARCHAR2(100 BYTE),
ATTRIBUTE7 VARCHAR2(100 BYTE),
ATTRIBUTE8 VARCHAR2(100 BYTE),
ATTRIBUTE9 VARCHAR2(100 BYTE),
ATTRIBUTE10 VARCHAR2(100 BYTE)
)
--====================================================
select * from XXSD_WEB_ADI_TL
--====================================================
CREATE OR REPLACE PACKAGE APPS.XXSD_WEB_ADI_PROC AS
PROCEDURE INSERT_XXSD_WEB_ADI_TL (
P_EMPLOYEE_NUMBER VARCHAR2
,P_FIRST_NAME VARCHAR2
,P_LAST_NAME VARCHAR2
,P_DATE_OF_BIRTH DATE
,P_GRADE VARCHAR2
,P_REMARKS VARCHAR2
,P_ATTRIBUTE1 VARCHAR2
,P_ATTRIBUTE2 VARCHAR2
,P_ATTRIBUTE3 VARCHAR2
,P_ATTRIBUTE4 VARCHAR2
,P_ATTRIBUTE5 VARCHAR2
,P_ATTRIBUTE6 VARCHAR2
,P_ATTRIBUTE7 VARCHAR2
,P_ATTRIBUTE8 VARCHAR2
,P_ATTRIBUTE9 VARCHAR2
,P_ATTRIBUTE10 VARCHAR2
);
END;
--====================================================
CREATE OR REPLACE PACKAGE BODY APPS.XXSD_WEB_ADI_PROC AS
PROCEDURE INSERT_XXSD_WEB_ADI_TL (
P_EMPLOYEE_NUMBER VARCHAR2
,P_FIRST_NAME VARCHAR2
,P_LAST_NAME VARCHAR2
,P_DATE_OF_BIRTH DATE
,P_GRADE VARCHAR2
,P_REMARKS VARCHAR2
,P_ATTRIBUTE1 VARCHAR2
,P_ATTRIBUTE2 VARCHAR2
,P_ATTRIBUTE3 VARCHAR2
,P_ATTRIBUTE4 VARCHAR2
,P_ATTRIBUTE5 VARCHAR2
,P_ATTRIBUTE6 VARCHAR2
,P_ATTRIBUTE7 VARCHAR2
,P_ATTRIBUTE8 VARCHAR2
,P_ATTRIBUTE9 VARCHAR2
,P_ATTRIBUTE10 VARCHAR2
) IS
lc_sqlerrm VARCHAR2 (2000);
lc_error_msg VARCHAR2 (2000);
l_responsibility_id NUMBER := apps.fnd_global.resp_id;
l_resp_application_id NUMBER := apps.fnd_global.resp_appl_id;
l_org_id NUMBER := apps.fnd_global.org_id;
l_user_id NUMBER := apps.fnd_global.user_id;
BEGIN
INSERT INTO XXSD_WEB_ADI_TL (
EMPLOYEE_NUMBER
,FIRST_NAME
,LAST_NAME
,DATE_OF_BIRTH
,GRADE
,REMARKS
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
)
VALUES (
P_EMPLOYEE_NUMBER
,P_FIRST_NAME
,P_LAST_NAME
,P_DATE_OF_BIRTH
,P_GRADE
,P_REMARKS
,P_ATTRIBUTE1
,P_ATTRIBUTE2
,P_ATTRIBUTE3
,P_ATTRIBUTE4
,P_ATTRIBUTE5
,P_ATTRIBUTE6
,P_ATTRIBUTE7
,P_ATTRIBUTE8
,P_ATTRIBUTE9
,P_ATTRIBUTE10
);
COMMIT;
EXCEPTION WHEN OTHERS THEN
lc_sqlerrm := SUBSTR(SQLERRM,1,1999);
raise_application_error (-20001, 'MAIN_OTHER_EXCEPTION - ' || lc_sqlerrm);
END;
END;
--====================================================
select FULL_NAME,
EMPLOYEE_NUMBER
from PER_ALL_PEOPLE_F
WHERE
first_name not like '%.%' and last_name
not like '%.%'
--==================================================================
API Example 1:-
(ID = EMPLOYEE_NAME and Meaning = FULL_NAME )
select * from
BNE_INTERFACES_B
where INTERFACE_CODE like 'XXSD_TEST5%'
select * from
BNE_INTERFACE_COLS_B
where 1=1
AND INTERFACE_COL_NAME = 'P_ATTRIBUTE1'
and INTERFACE_CODE = 'XXSD_TEST4_XINTG_INTF1'
--====================================================
BEGIN
BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV
(p_application_id => 20003, /* */
p_interface_code => 'XXSD_TEST5_XINTG_INTF1', /* */
P_INTERFACE_COL_NAME => 'P_ATTRIBUTE1', --Interface
Column Name from where the user double clicks to open the LOV and P_ID_COL is
also passed to this spreadsheet column.
P_ID_COL => 'EMPLOYEE_NUMBER', /* this
value save into the table */
P_MEAN_COL => 'FULL_NAME', /* this is visible when you click on adi
lov */
P_DESC_COL => 'FIRST_NAME, LAST_NAME ', /* Description for recognizining the correct
value */
P_TABLE => 'PER_ALL_PEOPLE_F', /*
TABLE */
P_ADDL_W_C => '1=1', /* where Condition */
P_WINDOW_CAPTION => '*ATT1', --LOV window caption
P_WINDOW_WIDTH => 400, --Window Width. Optional.
P_WINDOW_HEIGHT => 300, --Window Height. Optional
P_TABLE_BLOCK_SIZE => 10, --Number
of records to be displayed in the LOV
P_TABLE_SORT_ORDER => 'ascending', --Order
to be displayed in LOV
P_USER_ID => 1111
);
EXCEPTION
when NO_DATA_FOUND then
dbms_output.put_line('error no data ' ||sqlerrm);
when others then
dbms_output.put_line('error ' ||sqlerrm);
BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV
(p_application_id => 20003, /* */
p_interface_code => 'XXSD_TEST5_XINTG_INTF1', /* */
P_INTERFACE_COL_NAME => 'P_ATTRIBUTE2', --Interface
Column Name from where the user double clicks to open the LOV and P_ID_COL is
also passed to this spreadsheet column.
P_ID_COL => 'FULL_NAME', /* this
value save into the table */
P_MEAN_COL => 'FULL_NAME', /* this is visible when you click on adi
lov */
P_DESC_COL => 'FIRST_NAME, LAST_NAME ', /* Description for recognizining the correct
value */
P_TABLE => 'PER_ALL_PEOPLE_F', /* */
P_ADDL_W_C => '1=1', /* where Condition */
P_WINDOW_CAPTION => 'Select * Value', --LOV window caption
P_WINDOW_WIDTH => 400, --Window Width. Optional.
P_WINDOW_HEIGHT => 300, --Window Height. Optional
P_TABLE_BLOCK_SIZE => 11, --Number
of records to be displayed in the LOV
P_TABLE_SORT_ORDER => 'ascending', --Order
to be displayed in LOV
P_USER_ID => 1111
);
EXCEPTION
when NO_DATA_FOUND then
dbms_output.put_line('error no data ' ||sqlerrm);
when others then
dbms_output.put_line('error ' ||sqlerrm);
end;
Database Impact:-
Comments
Post a Comment