Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

HRMS Miscellaneous
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

If you wish to set your SQL Session in to restrict records as per HR Security, then you have couple of options


Option 1
Use this technique to restrict your SQL Access to a specific HR Security Profile.
Firstly find the security profile Id of your interest.
In this case, I will use an arbitrary id of 211. To know what 211 stands for, run the below query
select SECURITY_PROFILE_NAME from PER_SECURITY_PROFILES where SECURITY_PROFILE_ID =211 ;
begin
fnd_profile.put ( 'PER_SECURITY_PROFILE_ID' , '211' ) ;
hr_signon.initialize_hr_security;
end ;
/

Running above SQL will restrict data as per security profile id 211



Option 2
In case your SQL Session wants to display all the records regardless of security profile, then set this package variable to Y
This is particularly useful if you want to switch your context from a specific security profile to None [show all]
begin
hr_signon.g_hr_security_profile.view_all_flag := 'Y' ;
end ;
/

 

 

 

To create a default Date-Track Session Entry for your SQL*Plus session, simply run this SQL

set serveroutput on size 100000 ;
DECLARE
CURSOR c_session IS
SELECT *
FROM fnd_sessions
WHERE session_id = userenv('sessionid');
p_session c_session%ROWTYPE;
BEGIN
dbms_output.enable(100000);
OPEN c_session;
FETCH c_session
INTO p_session;
IF p_session.session_id IS NULL
THEN
dbms_output.put_line(' FND_SESSIONS IS NOT POPULATED...');
INSERT INTO fnd_sessions
(session_id
,effective_date)
VALUES
(userenv('sessionid')
,SYSDATE);
dbms_output.put_line(' POPULATED FND_SESSIONS WITH SYSDATE...');
ELSE
dbms_output.put_line('Effective Date Already Exists. Its value is ====> ' ||
p_session.effective_date);
END IF;
FETCH c_session
INTO p_session;
IF c_session%FOUND
THEN
dbms_output.put_line('Oops multiple session entries ');
END IF;
CLOSE c_session;
COMMIT;

hr_signon.initialize_hr_security;
COMMIT;
END;
/

 

Please note that hr_signon.initialize_hr_security might reset  hr_signon.g_hr_security_profile.view_all_flag to N


Anil Passi

Comments   

0 #1 Vijayakumar 2008-06-19 06:16
Dear Anil,

Thank you very much & greatly appreciate all your efforts for providing valuable information .Simply Superb...

Rega rds,

Kasi, Vijayakumar
Quote
0 #2 Sheena 2008-11-06 13:48
Hi,
I have a value set on the Org DFF what has this where clause:
where p.business_grou p_id +0 = :$PROFILES$.PER _BUSINESS_GROUP _ID
and fs.effective_da te between p.effective_sta rt_Date and p.effective_end _date
and p.current_emplo yee_flag = 'Y'
and fs.session_id = USERENV('SESSIO NID')
and p.person_id = a.person_id
and fs.effective_da te between a.effective_sta rt_Date and a.effective_end _date
and a.assignment_ty pe = 'E'
and a.primary_flag = 'Y'

Somehow the usernev part is giving a problem and when I try to use OA Framework to display the entire DFF, the segment that the Value set is associated to, does not get data and give an error saying that the person_id was not found in the value set.
if I take the fnd_session table and the userenv clause out, it works fine.
How can I make it work? Any help will be greatly appreciated!

T hanks
Sheena
Quote
0 #3 Anil Passi- 2008-11-06 15:53
There is a package named oracle.apps.per .common.CommonU tils

This has a class named CommonUtils
You need to invoke this as CommonUtils.set EffectiveDate

CommonUtils.set EffectiveDate(o adbtransaction, date);
Quote
0 #4 Sheena 2008-11-06 19:39
Anil , Thanks so much for your response. One more question, from your response and my investigation it seems like SS does not store the session id in the database table. Do you know why this is different from what forms does? Cause forms saves the info.
Is there never a requirement to get the session id from the system for SS?
Also, what is the best web site for all of Oracle java classes please? Sun Java has a good documentation, but I could not find anything similar for Oracle..

Thank s
Sheena
Quote
0 #5 Anil Passi- 2008-11-06 19:51
Forms uses pessimistic locking, hence a forms session clings to a Database Connection.
Hen ce locking can be immediate in Oracle Forms

OAF however follows optimistic locking, hence OAF requests a session as and when needed.
Please see the details in this forum thread
apps2fusion.com/forums/viewtopic.php?f=3&t=466&p=1467#p1467

Thanks
Anil Passi
Quote
0 #6 Amr Sokkar 2009-02-25 05:36
Hello Folks,
Am trying to get the Assignment_id from the self service.
Am customizing the payslip as am using the global legislation, so each employee should see his payslip, so am doing this by catching the assignment_id from the concurrent program definition , making the default value is profile and passing PER_ASSIGNMENT_ ID , that one didn't work, I used the fnd_profile.value('PER_ASSIGNMENT_ ID') as a sql default value but it did not work as well.
As a workaround I have used the USERNAME profile to get the assignment_id , however , this soultion worked in PUI and not in Self Service.
My Question is , did anyone try to populate the assignment_id in any DFF or any value set and succeed to do so ? Please help me Guys :)
Thanks,
Amr Sokkar
Quote
0 #7 Brent Lowe 2010-04-28 07:04
As far as creating a default Date-Track Session Entry, do you have to then delete your entry from fnd_sessions when you are done? What handles that cleanup?

Thank s
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Apr 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
  1  2  3  4  5  6  7
  8  91011121314
15161718192021
22232425262728
2930     

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner