2009 Sep 15 6:08 AM
Hi ppl,
Is there any database table which stores the personnel number (employee number) and the work centers.
Actually, I want to find the work centers to which a personnel is allocated.
Please let me know if any table stores this relation or appropriate logic to achieve my requirement.
Thanks.
2009 Sep 15 6:14 AM
Welcome to SCN.
Use HRP1001 table.
Also you can try these FM.
RHPH_PICK_UP_PERSONS.
RH_STRUC_GET_MULTIPLE_ROOTS
2009 Sep 15 6:17 AM
Hi,
Use this table
HRP1001
Hope this is useful for you.
Regards,
Vijay
2009 Sep 15 6:37 AM
Hi,
Thanks for the quick reply.
But, which field in the table HRP1001 represents the work center?
Thanks.
2009 Sep 15 11:15 AM
Hi,
Try with the following code.
DATA:itb_hrp1001 TYPE STANDARD TABLE OF p1001.
DATA:wa_1001 TYPE p1001.
CALL FUNCTION 'RH_READ_INFTY'
EXPORTING
plvar = '01'
otype = 'P'
objid = '1024'
infty = '1001'
subty = 'B008'
begda = '19000101'
endda = '99991231'
TABLES
innnn = itb_hrp1001
EXCEPTIONS
all_infty_with_subty = 1
nothing_found = 2
no_objects = 3
wrong_condition = 4
wrong_parameters = 5
OTHERS = 6.
IF sy-subrc EQ 0.
LOOP AT itb_hrp1001 INTO wa_1001.
WRITE: / wa_1001-objid,
20 wa_1001-sobid.
ENDLOOP.
ENDIF.