‎2008 Oct 23 8:06 AM
hii,
one personnel number has 2-3 joining date in table.
i want to select the first joining date.
‎2008 Oct 23 8:22 AM
SELECT min( date )
FROM...
INTO...
WHERE employee = employee_number.date is the name of the field in the table for the joining date
employee is the name of the field in the table for the employee
‎2008 Oct 23 8:07 AM
retrieve the joining dates in internal table, sort then use read table with index 1
‎2008 Oct 23 8:10 AM
Hi,
Do you want to take the earliest data?
If so do like:
select * from the tabe to an internal table where conditions.
sort itab by datefield.
read table itab into wa index 1.
Hope this helps.
Regards,
Renjith Michael.
‎2008 Oct 23 8:10 AM
hi,
after getting all the records into your internal table.
sort your internal table ascending.
then use this statement.
DELETE ADJACENT DUPLICATES FROM it_pa0001 COMPARING pernr.
‎2008 Oct 23 8:19 AM
‎2008 Oct 23 8:22 AM
SELECT min( date )
FROM...
INTO...
WHERE employee = employee_number.date is the name of the field in the table for the joining date
employee is the name of the field in the table for the employee
‎2008 Oct 23 8:24 AM
Hi,
You Can first take all dates in an internal and take the first by setting index
or you can use it by usin min statement in your select query.
Thanks & Regards
‎2008 Oct 23 8:57 AM
‎2008 Oct 23 9:01 AM
so you want to select the earlies joining dates for several employee at the same time? if yes, than you have to select all employee numners and dates into an internal table and:
SORT itab.
LOOP AT itab.
AT NEW date.
==> this will be the earliest date for the employee.
ENDAT.
ENDLOOP.
‎2008 Oct 23 9:03 AM
Might be correct... but this is not the way of doing such things in HR.
‎2008 Oct 23 9:16 AM
you are right... but in the original question it is never mentioned that it is about HR, it could be any Z... table
‎2008 Oct 23 9:37 AM
The original question and subject line is so vague, I wouldn't bother at all. I mean, everybody is guessing around just because the OP cannot or does not want to phrase a proper and detailed question.
Cheers
Thomas
‎2008 Oct 23 9:48 AM
Yupp, i'm always taking my way of doing things, and if the data is stored elswehere, i would never store them a seconf time...
Maybe the OP kann specify a little bit more e.g. if he's using LDB and taking hiring/firing from infotype zero. And: there are function modules to get the hire/fire dates out from there...
By the way... i need to take something out of my car, how can i do this?
‎2008 Oct 23 10:07 AM