09-04-2008 11:10 AM
hi all,
how to extract the hire date from infotype 0041
my requirement is extract the employee hire date
thanks & regards
Revathi Raj
Edited by: revathi raju on Sep 4, 2008 12:11 PM
09-04-2008 3:00 PM
Hi Raju,
The Date type for hire date is ' U1 '
Now you need to loop through all the dates in the infortype 41
and compare the date types for U1.
Once u get the date type in the variable
DAR0X ,Then particular DAT0X will be ur hire date...
ok lets see the example as how to do...
data: l_datar type datar,
l_dardt type dardt.
do 12 times
varying l_datar from pa0041-dar01 next pa0041-dar02
varying l_dardt from pa0041-dat01 next pa0041-dat02.
if l_datar eq U1.
v_hiredate = l_dardt.
endif.
enddo.
The above is just a sample code..Check if it is helpful
Thank you
09-04-2008 11:13 AM
If you want employee hire date goto infotype 41, using repetative structure (do varying) you can get the date.
09-04-2008 11:14 AM
HI,
Use FM HR_READ_INFOTYPE.
READ TABLE T_P0000 INTO WA_P0000 INDEX 1.
READ TABLE T_P0041 INTO WA_P0041 INDEX 1.
DO VARYING W_DTYPE FROM WA_P0041-DAR01 NEXT WA_P0041-DAR02
VARYING W_DTEXT FROM WA_P0041-DAT01 NEXT WA_P0041-DAT02.
IF W_DTYPE EQ P_DATE.
WRITE 😕 WA_P0000-PERNR,
WA_P0000-ENDDA,
WA_P0000-BEGDA,
W_DTYPE,
W_DTEXT.
EXIT.
ENDIF.
ENDDO.
Regards
Sumit Agarwal
09-04-2008 2:40 PM
09-04-2008 11:15 AM
hi,
in infotype 41 u can extract hire date details for data type 71.
09-04-2008 11:16 AM
Use macr to read Infotypes.:
rp-provide-from-last p0041 space pn-begda pn-endda.
09-04-2008 11:16 AM
09-04-2008 11:18 AM
HI revathi,
Use the FM HR_READ_INFOTYPE
Example:-
LOOP AT t_pa0000 INTO fs_pa0000.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = fs_pa0000-pernr
infty = '0041'
begda = fs_pa0000-begda
endda = fs_pa0000-endda
bypass_buffer = 'X'
TABLES
infty_tab = t_pa0041
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. " IF SY-SUBRC NE 0.
ENDLOOP. " LOOP AT T_PA0000...
Here t_pa0000 is a table which contains all active employees.
Best if Luck,
Bhumika
09-04-2008 11:18 AM
hii
try using FM
CALL FUNCTION 'RP_GET_HIRE_DATE'
EXPORTING
PERSNR = wa_out-pernr
CHECK_INFOTYPES = '0041'
DATUMSART = '01'
STATUS2 = '3'
P0016_OPTIONEN = ' '
IMPORTING
HIREDATE = wa_out-hiredat
regards
twinkal
09-04-2008 11:21 AM
Hi,
In infotype 41..there are fields from dar01 to dar12...check in pa30...in which dar field does the date of joining is captured...accordingly get the value of date from dat01 to dat12 respectively....
For eg..,Date of joining is in date type 'DAR01'..then the date of joining is 'DAT01'...
09-04-2008 3:00 PM
Hi Raju,
The Date type for hire date is ' U1 '
Now you need to loop through all the dates in the infortype 41
and compare the date types for U1.
Once u get the date type in the variable
DAR0X ,Then particular DAT0X will be ur hire date...
ok lets see the example as how to do...
data: l_datar type datar,
l_dardt type dardt.
do 12 times
varying l_datar from pa0041-dar01 next pa0041-dar02
varying l_dardt from pa0041-dat01 next pa0041-dat02.
if l_datar eq U1.
v_hiredate = l_dardt.
endif.
enddo.
The above is just a sample code..Check if it is helpful
Thank you