Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select one

Former Member
0 Likes
1,289

hii,

one personnel number has 2-3 joining date in table.

i want to select the first joining date.

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,268
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

13 REPLIES 13
Read only

Former Member
0 Likes
1,268

retrieve the joining dates in internal table, sort then use read table with index 1

Read only

Former Member
0 Likes
1,268

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.

Read only

GauthamV
Active Contributor
0 Likes
1,268

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.

Read only

rainer_hbenthal
Active Contributor
0 Likes
1,268

To be HR compliant, use macro rp_provide_from_first

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,269
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

Read only

Former Member
0 Likes
1,268

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

Read only

Former Member
0 Likes
1,268

MIN( date ).

is not working with for all entries.

Read only

0 Likes
1,268

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.

Read only

0 Likes
1,268

Might be correct... but this is not the way of doing such things in HR.

Read only

0 Likes
1,268

you are right... but in the original question it is never mentioned that it is about HR, it could be any Z... table

Read only

0 Likes
1,268

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

Read only

0 Likes
1,268

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?

Read only

Former Member
0 Likes
1,268

thanks Eric..