01-16-2013 12:27 PM
Hi Experts,
I need to fetch the currently assigned PERNR(Personnel Number) for an external person ID irrespective of the PERNR status.
I have tried with FM 'CRIF_GET_EMPLOYEE_FOR_USER' and method 'CL_HRTMC_CP_BASIC_UTILITIES=>CONVERT_IDS' but both were not helpful.
these are helpful only when the PERNR is ACTIVE.
But if the CURRENT ASSIGNED PERNR is inactive/withdrawn, I need to fetch that PERNR.
Please help me here.
Many Thanks in Advance,
Maruthi
01-16-2013 12:52 PM
you are required to read infotype 0000 actions and with empoyment status you can fetch inactive / withdrawn pernr.
01-16-2013 1:28 PM
Infotype 0000 will return me the PERNR status if I know the PERNR. But in my case, I have an External ID with two PERNRs assigned. One with status Withdrawn and the other with Inactive.
Current status of the Person is Inactive meaning, PERNR 2 is assigned.
So how to read the PERNR 2 with External ID. I have only Person ID.
In general, How to fetch the currently assigned PERNR for an External Person ID.
01-17-2013 12:02 AM
Hi,
You can try using method GET_PERNR_TAB_FOR_PERSONID_EXT of class CL_HRCCE_PERSONID
Something along this line:
DATA:
lo_person_id TYPE REF TO cl_hrcce_personid,
lv_pernr TYPE pernr_d,
lv_perid TYPE personid_ext,
lv_personid TYPE personid,
lt_pernr TYPE pccet_pernr,
ls_pernr TYPE pcce_pernr.
lv_perid = iv_personid.
CREATE OBJECT lo_person_id.
TRY.
lo_person_id->get_pernr_tab_for_personid_ext(
EXPORTING personid_ext = lv_perid
IMPORTING pernr_tab = lt_pernr ).
CATCH cx_hrpa_violated_assertion.
RETURN.
ENDTRY.
lv_pernr = iv_pernr.
READ TABLE lt_pernr INTO ls_pernr WITH KEY table_line = lv_pernr.
....
Hope this helps.
Sougata.
01-17-2013 7:11 AM
Hi,
You could try in reverse approach as below:
For trial purpose, let's say you know the pernr for the external id.
Put that pernr in table HRP1001 by selecting OTYPE as P and OBJID as the pernr.
Out of many records, check the record with SCLAS as 'CP'.
Check the value in field SOBID with SCLAS value as 'CP'. Do let me know if the external
id's value is in SOBID. Thanks!
Regards,
Kumud