Professional Documents
Culture Documents
In this document I am creating custom WebADI for Assets Retirement (Using PL/SQL API).
First of all create custom PL/SQL package and using Oracle built-in API “FA_RETIREMENT_PUB.do_retirement”
Package Specification
Package Body
l_return_status VARCHAR2(1);
l_mesg_count number;
l_mesg varchar2(4000);
le_cust_exp exception;
begin
/*fnd_global.apps_initialize(1508,50803,140);
mo_global.init('OFA');
mo_global.set_policy_context('S','104');*/
BEGIN
SELECT ASSET_ID
INTO l_asset_hdr_rec.asset_iD
FROM FA_ADDITIONS
WHERE ASSET_NUMBER = P_ASSET_NUMBER;
EXCEPTION
WHEN NO_DATA_FOUND THEN
l_mesg := 'ASSET DOES NOT EXIST';
raise_application_error(-20001, l_mesg);
END;
dbms_output.enable(1000000);
FA_SRVR_MSG.Init_Server_Message;
--dump messages
if (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
for i in 1 .. l_mesg_count loop
l_mesg := l_mesg || CHR(10) ||fnd_msg_pub.Get_Detail(p_msg_index => i,
p_encoded => fnd_api.G_TRUE);
dbms_output.put_line(l_mesg);
end loop;
--fnd_msg_pub.delete_msg();
raise le_cust_exp;
end if;
commit;
exception
when le_cust_exp then
fnd_message.set_name('OFA', 'XXHDC_ASSET_ERROR');
fnd_message.set_token('XXHDC_ASSET_ERROR', l_mesg);
l_mesg := fnd_message.get();
-- fnd_message.raise_error;
raise_application_error(-20001, l_mesg);
when others then
l_mesg := sqlerrm;
fnd_message.set_name('OFA', 'XXHDC_ASSET_ERROR');
fnd_message.set_token('XXHDC_ASSET_ERROR', l_mesg);
l_mesg := fnd_message.get();
-- fnd_message.raise_error;
raise_application_error(-20001, l_mesg);
end;
end;
Note: Please make sure the above package is compiled and perform transactions successfully.
Responsibility
Here you can define which field Placement (Appears in Header or Line).
For Example : I selected line level for all field in placement except BOOK_TYPE_CODE. In the WebADI Document
Insert value for BOOK_TYPE_CODE one time on header level.
Protect Sheet = No
Style Sheet = Default
Apply Filter = Yes
Header Level
Title = XX_Retirement
Line Level
Now on the below you can arrange all field sequences (As per your requirement).
For example : which field appears first, second or last.
Click Close.