2009 Jun 18 6:05 AM
hi
An employee in an org. can be in different units in different time.I want to extract the employees organization in which he is currently working with.
MANDT PERNR ENDDA BEGDA UNAME PERSK ORGEH PLANS STELL
200 3 31.12.9999 24.02.2009 122910 11 10100519 50001466 80000301
200 3 23.02.2009 01.11.2008 106953 11 10100519 50001466 80000301
200 3 31.10.2008 01.10.2008 106953 10 10100463 50000005 80000002
200 3 30.09.2008 04.09.2008 106953 10 10100008 50002108 80000404
I have to extract ORGEH corresponding to latest DATE i.e. ENDDA
How to sort the date ?
Sachin
2009 Jun 18 6:11 AM
2009 Jun 18 6:11 AM
2009 Jun 18 6:19 AM
hi
i am using the query
SELECT orgeh from pa0001 INTO lv_emp_org UP TO 1 rows
WHERE pernr = 00000003 and
????????????????
ENDSELECT.
I want sort the endda in descending order and than want to extract the first record,,,??
2009 Jun 18 6:49 AM
> SELECT orgeh from pa0001 INTO lv_emp_org UP TO 1 rows
> WHERE pernr = 00000003
> ORDER BY date_field DESCENDING.
> ENDSELECT.
Try like this.
Regards
Karthik D
2009 Jun 18 6:17 AM
Hi,
Sort itab by ENDDA in descending order and read the first record. You will get what you required.
Thanks,
Rakesh.
2009 Jun 18 6:20 AM
Hi,
After fectching the records from infotype 0001.
if not itab[] is initial.
Sort itab by pernr begda descending.
delete adjacent duplicates from itab comparing pernr.
endif.
So you will get latest record for each pernr.
Regards,
Kumar Bandanadham.