‎2009 Jun 23 12:46 PM
Hi,
My requirement is to get the total number of weeks from finacial year(ie APRIL) to current date.
Is there any functional module?
‎2009 Jun 23 12:48 PM
Hi Janani,
Chk this FM once HR_IE_NUM_PRSI_WEEKS
Returns number of weeks between 2 periods.
Regards,
Lakshman.
‎2009 Jun 23 12:48 PM
Hi Janani,
Chk this FM once HR_IE_NUM_PRSI_WEEKS
Returns number of weeks between 2 periods.
Regards,
Lakshman.
‎2009 Jun 23 1:02 PM
Hello,
Are you looking for weeks as in Monday to Sunday or consecutive 7 days?
If you want to know like 7 days ( a week ) between two date. Say for fiscal year 04.01.2008 to 03.31.2009 then check the following code.
Data: date_from type sy-datum value '04012008',
date_to type sy-datum value '03312009',
days_difference type i,
weeks(4) type n.
days_difference = date_to - date_from.
weeks = days_difference / 7.Hope this helps.
Thanks & Regards,
Anand Patil
‎2009 Jun 23 1:15 PM
Search the SCN to get the difference between the dates..there ar lot many threads which are answerd.
‎2009 Jun 23 1:21 PM
Hi,
Check the following snippet
data: num like PC26W-WEEKS.
CALL FUNCTION 'HR_IE_NUM_PRSI_WEEKS'
EXPORTING
tax_year_begin = '20090101'
period_begin = '20090401'
period_end = sy-datum
IMPORTING
NUM_WEEKS = num
EXCEPTIONS
END_LT_START = 1
END_LT_YEAR_START = 2
START_LT_YEAR_START = 3
OTHERS = 4
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write: num.
‎2009 Jun 23 1:30 PM
Try this,it will helps...
DATA : NO_WEEKS TYPE PC26W-WEEKS,
YR_BEGIN TYPE SY-DATUM,
BEGIN_DT TYPE SY-DATUM,
END_DT TYPE SY-DATUM.
YR_BEGIN = '20090323'.
BEGIN_DT = '20090323'.
END_DT = '20090623'.
CALL FUNCTION 'HR_IE_NUM_PRSI_WEEKS'
EXPORTING
tax_year_begin = YR_BEGIN
period_begin = BEGIN_DT
period_end = END_DT
IMPORTING
NUM_WEEKS = NO_WEEKS
.
‎2009 Jun 23 1:33 PM
Hi,
You can also use function module HR_99S_INTERVAL_BETWEEN_DATES.
Regards,
Kumar Bandanadham