Who's Online
1 registered (spiro), 3 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Recent Posts
Pension Schemes Setup
by kp_rapolu
Today at 03:09 PM
RBAC and Security Profiles
by CT
Today at 02:05 PM
Q: multiple assignments absence processing
by CT
Today at 12:34 PM
How managers initiates SSHR request of employees
by Saqib Rahat
Today at 09:00 AM
French Localizations
by bcooper
Yesterday at 07:11 AM
Setting up budgets in HRMS
by MarinaH
Yesterday at 06:06 AM
Attach documents in the SIT/EIT
by MarinaH
Yesterday at 03:09 AM
Talent management function in self service menu
by EBS_USER
06/09/10 11:23 PM
Basic Setup for CORE HR without Payroll
by EBS_USER
06/09/10 11:17 PM
FYI: P60s to be available in Self Service
by kp_rapolu
01/09/10 03:42 PM
Top Posters (30 Days)
SBi 31
CT 16
bcooper 15
Saqib Rahat 11
PeterP 10
EBS_USER 9
kp_rapolu 8
Geoff Dixon 8
delboy 5
MarinaH 5
(Views)Popular Topics
Family Pack K issues thread 8849
CREATE_GRADE api returns:PLS-00306: wrong number o 6175
Still trying to locate... 4660
Creating hr jobs ORA-20001: HR_289477_JOB_GROUP_ID 4444
Review of my Release 12 laptop 4226
Log-on problems for existing users 3538
Viewing Output of another user 3261
Family Pack K 3128
October UK-OUG? 3090
HR_PF.K RUP4 2908
Topic Options
Rate This Topic
#5134 - 04/02/10 10:17 PM session_id
MarinaH Online   content
hacker

Registered: 21/08/05
Posts: 75
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: 820
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 Online   content
hacker

Registered: 21/08/05
Posts: 75
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 Online   content
hacker

Registered: 21/08/05
Posts: 75
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 Online   content
hacker

Registered: 21/08/05
Posts: 75
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
494 Members
48 Forums
1213 Topics
5734 Posts

Max Online: 51 @ 12/08/10 02:30 AM
Today's Birthdays
No Birthdays
Recent vacancies
Top Posters
bcooper 945
CT 820
Geoff Dixon 354
SBi 291
delboy 291
vkumar 223
kp_rapolu 211
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