Who's Online
0 registered (), 1 Guest and 0 Spiders online.
Key: Admin, Global Mod, Mod
Recent Posts
Irecruitment
by spiro
18/03/10 03:21 PM
Appraisal Session Timeout
by spiro
17/03/10 07:48 PM
Heres a simple question on Workflow then ..
by bcooper
17/03/10 09:54 AM
Defaulting PO Information on assignment screen
by bcooper
17/03/10 09:52 AM
Creating an Attachment Table or Attachment Link
by Sahir
16/03/10 02:35 PM
OLM - Custom Role based on the 'Data Security'
by Geoff_Dixon
15/03/10 03:28 PM
E-Bus Configuration and Management
by PeterP
11/03/10 01:28 PM
UMX : Oracle User Management Application
by natkins
11/03/10 12:58 PM
HRMS organization structures
by Geoff_Dixon
11/03/10 11:53 AM
HR_PF.K RUP4
by bcooper
10/03/10 06:50 PM
Top Posters (30 Days)
CT 19
bcooper 18
natkins 16
delboy 16
MarinaH 12
SBi 10
gaztorres 8
Geoff_Dixon 8
kp_rapolu 4
Gus 4
(Views)Popular Topics
Family Pack K issues thread 5207
Review of my Release 12 laptop 3134
CREATE_GRADE api returns:PLS-00306: wrong number o 3123
Log-on problems for existing users 3014
Creating hr jobs ORA-20001: HR_289477_JOB_GROUP_ID 2392
October UK-OUG? 1998
Viewing Output of another user 1924
uploading bank branches to PAYROLL 1877
Still trying to locate... 1855
Family Pack K 1841
Topic Options
Rate This Topic
#5134 - 04/02/10 10:17 PM session_id
MarinaH Offline
enthusiast

Registered: 21/08/05
Posts: 49
Loc: Away with the fairies
I have written some code ( shocked ) which I'm hoping will bring in the payroll details of the employee who is logged in... It all works when I hard code in the employee_number, but my problem at the moment is I'm not entirely sure who to link the person logged in to the rest of the code... I hope that makes sense!


select decode(ptp.period_type, 'Week',
decode(to_char(ptp.start_date,'Dy'),
'Mon', 'Weekly - Starts Monday',
'Thu','Weekly - Starts Thursday',
'Wed','Weekly - Starts Wednesday',
'Sun','Weekly - Starts Sunday'
,'Invalid'),
'Weekly - Starts Monday') Period_Name
from per_all_people_f papf,
per_all_assignments_f paaf,
pay_all_payrolls_f ppf,
per_time_periods ptp,
fnd_user fu
where papf.person_id = paaf.person_id
and paaf.payroll_id = ppf.payroll_id
and fu.employee_id = papf.person_id
and ptp.payroll_id = paaf.payroll_id
and trunc(sysdate) between fu.start_date and nvl(fu.end_date,sysdate)
and trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
and trunc(sysdate) between ptp.start_date and ptp.end_date

Top
#5135 - 05/02/10 10:52 AM Re: session_id [Re: MarinaH]
CT Offline
veteran
*****

Registered: 11/03/05
Posts: 752
Loc: Back at Fort Apache, Gosport!
Lubble! Step away from the SQL prompt!

You need to add something along the lines of

AND FU.user_id = FND_GLOBAL.user_id

This assumes that you have somehow done an FND_GLOBAL.apps_initialize in your sql session prior to running the query. If you are running this from within the app, that initialisation takes place automatically when you log in.

Oh and by the way, you missed a trunc on one of your sysdate references! Bad consultant... bad, bad consultant! cool

Fled x
_________________________
L&K
CT

Top
#5137 - 07/02/10 10:16 PM Re: session_id [Re: CT]
MarinaH Offline
enthusiast

Registered: 21/08/05
Posts: 49
Loc: Away with the fairies
Thanks for the code. Works a dream...

Added the trunc around the missed sysdate. I assumed it was the one in the nvl statement blush

Barn x

Top
#5138 - 08/02/10 12:04 AM Re: session_id [Re: MarinaH]
MarinaH Offline
enthusiast

Registered: 21/08/05
Posts: 49
Loc: Away with the fairies
...now stepping away from the SQL prompt!!

Top
#5158 - 18/02/10 01:59 PM Re: session_id [Re: MarinaH]
delboy Offline

claiming squatters rights

Registered: 15/03/05
Posts: 255
Loc: Somewhere in Berkshire
Yeah, I spotted that too!!!!

Delboy

Top
#5164 - 19/02/10 05:10 AM Re: session_id [Re: delboy]
MarinaH Offline
enthusiast

Registered: 21/08/05
Posts: 49
Loc: Away with the fairies
ok, ok.....

Top


Moderator:  bcooper, CT 
March
Su M Tu W Th F Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Forum Stats
422 Members
48 Forums
1129 Topics
5248 Posts

Max Online: 15 @ 20/10/09 02:30 PM
Today's Birthdays
No Birthdays
Recent vacancies
Oracle HRMS Consultants needed! Perm £70k!
by Shaylan
18/03/10 11:33 AM
Developer - Permanent - based in Bracknell
by Geoff_Dixon
11/03/10 11:59 AM
Perm Positions 1 x HR and 1 x Payroll
by bfrost
10/03/10 05:35 PM
Top Posters
bcooper 890
CT 752
Geoff_Dixon 343
delboy 255
SBi 249
vkumar 223
kp_rapolu 203
cbrookes 197
Gavin Harris 101
jhatten 95