2006 Feb 25 11:26 AM
Hi all,
how can we know the relation between an emplyee and his superior ? (hrp1000 ,hrp1001 )
can any one give me the reply with exaple(code)?
Thanks in advance
charan
2006 Feb 25 11:28 AM
The "reports to" relataion is maintained between the employee's position & supervisor's position.There are a couple of function modules to get the supervisor's info directly..
Regards,
Suresh Datti
2006 Feb 25 11:28 AM
The "reports to" relataion is maintained between the employee's position & supervisor's position.There are a couple of function modules to get the supervisor's info directly..
Regards,
Suresh Datti
2006 Feb 25 11:32 AM
Hi,
YOu can use combination of fields PLVAR ,OTYPE, OBJID for linking HRP1000 and HRP1001.
Thanks,
Ramakrishna
2006 Feb 25 11:33 AM
hi all,
can u give any example coe to checket plz
thanks
charan
2006 Feb 25 11:38 AM
Suppose you have the employee's position.. here is the code to get the supervisor's position..
data w_objid type hrobjid. "Employee's position
data w_sobid type sobid. "Supervisor's position
select sobid into w_sobid
from hrp1001 up to 1 rows
where otype = 'S'
and objid = w_objid
and plvar = '01'
and istat = 1
and begda le sy-datum
and endda ge sy-datum
and rsign = 'A'
and relat = '002'.
endselect.
if sy-subrc eq 0.
* w_sobid holds the Supervisor's position
endif.
Regards,
Suresh Datti
2006 Feb 25 11:38 AM
thanks suresh.
can u name the function modules which are usefull for me now?
charan
2006 Feb 25 11:40 AM
hi,
You can pass the employee's 0001 record to this function module RPAQ_GET_AF_0001 & get back thye Supervisors' info..
Regards,
Suresh Datti
2006 Feb 25 11:46 AM
Hi sureh, th fm is as follows.
CALL FUNCTION 'RPAQ_GET_AF_0001'
EXPORTING
C_IT0000 =
C_IT0001 =
BEGDA_IT = SY-DATUM
ENDDA_IT = SY-DATUM
BEGDA_SEL = SY-DATUM
ENDDA_SEL = SY-DATUM
TCLAS =
MOLGA =
C_OBJEC =
IMPORTING
AF_VALUES =
TABLES
AF_FIELDS =
IT0000 =
IT0001 =
Whic field shoud i uncomment. can u explain me?
thannks
charan
2006 Feb 25 11:55 AM
Hi Ravi,
Pl check the follwoing code..
data : rec_p0001 like p0001. "Org Info
data: rec_af_values like p0001_af. "Manager info
data: t_af_fields like rhtext_field occurs 0
with header line.
data: w_pernr type pernr_d,
w_supname like p0001-ename.
* assuming you have employee's 0001 record in p0001
read table p0001 index 1.
if sy-subrc <> 0.
clear p0001.
endif.
move p0001 to rec_p0001.
* retrieve the supervisor employee number and name.
t_af_fields-fieldname = 'OMNGR_NR'.
append t_af_fields.
t_af_fields-fieldname = 'OMNGR_NA'.
append t_af_fields.
call function 'RPAQ_GET_AF_0001'
exporting
c_it0001 = rec_p0001
begda_it = sy-datum
endda_it = sy-datum
begda_sel = sy-datum
endda_sel = sy-datum
tclas = 'A'
molga = '10'
importing
af_values = rec_af_values
tables
af_fields = t_af_fields.
w_pernr = rec_af_values-omngr_nr. "Supervisor's pernr
w_supname = rec_af_values-omngr_na. "Supervisor's Name
Regards,
Suresh Datti
2006 Feb 26 6:42 AM
Hi,
If i want to delete my queries form the posted list, how could is?
can u tell me the path.
Thanks
charan
2006 Feb 26 11:15 AM
HI,
You can close them by clicking on the radiobutton solved on my own..
regards,
Suresh Datti