Who's Online
0 registered (), 8 Guests and 1 Spider online.
Key: Admin, Global Mod, Mod
Recent Posts
French Localizations
by jmoyano
Today at 09:20 AM
How managers initiates SSHR request of employees
by Geoff Dixon
Today at 09:02 AM
FYI: P60s to be available in Self Service
by kp_rapolu
01/09/10 03:42 PM
SSHR Personalization requirement
by kp_rapolu
01/09/10 03:41 PM
Request for responsibility in ESS
by SBi
01/09/10 05:49 AM
Nominate for peers/subordinat for reward
by bcooper
31/08/10 07:46 PM
UK HCM Sig - 29th September
by andy.fisher
31/08/10 10:05 AM
Migration of terminated Employees
by SBi
31/08/10 10:02 AM
Worldwide Bank Details Validation
by SBi
27/08/10 02:33 PM
HTML pages popping up BEHIND Core Apps forms?
by Geoff Dixon
27/08/10 12:34 PM
Top Posters (30 Days)
SBi 28
bcooper 14
CT 12
PeterP 10
Geoff Dixon 8
Saqib Rahat 7
EBS_USER 6
kp_rapolu 5
delboy 5
MarinaH 3
(Views)Popular Topics
Family Pack K issues thread 8728
CREATE_GRADE api returns:PLS-00306: wrong number o 6046
Still trying to locate... 4588
Creating hr jobs ORA-20001: HR_289477_JOB_GROUP_ID 4356
Review of my Release 12 laptop 4212
Log-on problems for existing users 3526
Viewing Output of another user 3213
Family Pack K 3087
October UK-OUG? 3064
uploading bank branches to PAYROLL 2880
Topic Options
Rate This Topic
#5134 - 04/02/10 10:17 PM session_id
MarinaH Offline
hanger-on

Registered: 21/08/05
Posts: 73
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: 816
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
hanger-on

Registered: 21/08/05
Posts: 73
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
hanger-on

Registered: 21/08/05
Posts: 73
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: 291
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
hanger-on

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

Top


Moderator:  bcooper, CT 
Oracle R12.1.1 on your existing computer
Get up and running with Oracle on your existing computer in 5 minutes

Get up and running with Oracle on your existing computer in 5 minutes!

Alard Consulting Ltd are pleased to offer Oracle R12.1.1 on your existing computer.

Connect to Oracle R12 from your computer to do client demonstrations, your own development work, or test functional setup on a Vision environment without having to install and maintain Oracle.

Backup your work before making changes in case things go wrong. Just copy the files to a new directory before making the changes. If it doesn't work, copy the files back again, all from Windows. No other skills needed.

As everything is contained on a single external hard drive, you can take it with you to use wherever you need it.

For each sale from HCMAces a portion of the price will go to the running costs of this forum.

For more information see www.alard.net/products.html.

Forum Stats
492 Members
48 Forums
1207 Topics
5710 Posts

Max Online: 51 @ 12/08/10 02:30 AM
Today's Birthdays
No Birthdays
Recent vacancies
Top Posters
bcooper 944
CT 816
Geoff Dixon 354
delboy 291
SBi 288
vkumar 223
kp_rapolu 208
cbrookes 197
Gavin Harris 111
jmoyano 96
September
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