今天在開發Oracle ERP的Report時,想以下列的PL/SQL來找出登入的員工姓名,
但是卻發現Report執行出來的結果都是空白。
begin
select replace(papf.full_name,',',null)
into x_ls_user
from fnd_user fu
,per_all_people_f papf
where fu.employee_id = papf.person_id
and fu.user_id = fnd_global.user_id;
exception
when others then
x_ls_user := null;
end;
從Goole找到原因,原來是必需先在Report Trigger的BeforeReport和AfterReport中加入下列程式:
begin
SRW.USER_EXIT('FND SRWINIT');
exception when srw.user_exit_failure then
srw.message(3001,'Error in SRWINIT');
raise;
end;
return (TRUE);
如果要使用fnd_profile.value,也是如此。