‎2008 Jul 22 11:47 AM
Hi,
I need to calculate the difference between the original hire date and system date and also diffrence between rehire date and system date from 0041 and I need the output in the form of months. Please help me with this.
Regards,
Srik
‎2008 Jul 22 11:49 AM
get your dates from PA0041 ..
use FM HR_HK_DIFF_BT_2_DATES to get the difference in
months .. enter 04 for parameter OUTPUT_FORMAT
‎2008 Jul 22 12:01 PM
Hi,
Thank you for ur response. Please help me how to retrieve the dates as they vary from dar01 to dar12 and corresponding dates from dat01 to dat12.
Regards,
Srik
‎2008 Jul 22 12:02 PM
Hi,
Use FM 'HR_ECM_GET_DATETYP_FROM_IT0041' to get the date's for your respective date types (hire or rehire).
Regards,
Shrinivas
‎2008 Jul 22 12:07 PM
write the coding as :
loop at it_pa0041.
do 12 times varying w_DARXX from it_pa0041-DAR01
next it_pa0041-DAR02
varying w_DATXX from it_pa0041-DAT01
next it_pa0041-DAT02.
case w_DARXX .
when 'XX'. " XX <-- U need to give the original hire date
v_hiredate = w_DATXX.
when 'YY'. " YY <-- U need to give the rehire date
v_rehiredate = w_DATXX.
endcase.
enddo.
calculate the difference between the dates using
v_hiredate , v_rehiredate with the system date ...
endloop.
‎2008 Jul 22 12:08 PM
Hi SRIK,
This depends on the field DATE TYPE (DAR01).
For Hire the value is U1--->Hire Date.
Depending on the date type you need to select the value.
Best regards,
raam
‎2008 Jul 22 11:56 AM
hi,
You can use this FM.
FIMA_DAYS_BETWEEN_TWO_DATES_2
Regards
Sumit Agarwal
‎2008 Jul 22 12:04 PM
hi,
You have to choose one of the date using DO VARYING loop.
DO VARYING W_DTYPE FROM WA_P0041-DAR01 NEXT WA_P0041-DAR02.
IF W_DTYPE EQ P_DATE.
<Your Code >.
EXIT.
ENDIF.
ENDDO.
Regards
Sumit Agarwal
‎2008 Jul 22 2:22 PM
HI
Check these FM's:
HR_99S_INTERVAL_BETWEEN_DATES
HR_99S_MONTHS_BETWEEN_DATES
Or check this code:
data: begin of e_0041,
darxx like p0041-dar01,
datxx like p0041-dat01,
end of e_0041.
do 12 times varying e_0041 from p0041-dar01 next p0041-dar02.
if e_0041-darxx eq '01'.
endif.
enddo.
Regards
Gregory