Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function Module for No.of weeks in a Given date range

Former Member
0 Kudos

Dear Experts,

Is there any Function module to find the Number of weeks

( one or two or three or four) in a given date range in a month

and which week(Ist or second or third or forth).

For example : if I give 01.05.2007 to 07.05.2007 ( here one week it is first week)

03.05.2007 to 12.05.2007

( here two and week ,first second like this I need)

with in a one month.

Thanks and Regards,

Praveen

4 REPLIES 4

Former Member
0 Kudos

Hi,

Please try with HR_99S_INTERVAL_BETWEEN_DATES. and let me know if any issues.

Reward points.....

Regards,

Ramakrishna kotha.

Former Member
0 Kudos

You can use function module HR_99S_INTERVAL_BETWEEN_DATES. The field C_WEEKS will return the number of complete weeks (as an integer) between two dates, and the field WEEKS will return total weeks (as a decimal number).

- April King

Former Member
0 Kudos

hi Pravenn,

I don't know about these functions, but u can try anything like this:

data:

strdate like sy-datum value '20070901',

enddate like sy-datum value '20070909',

date(10),

moddate(1).

date = enddate - strdate + 1.

moddate = date mod 7.

date = date div 7.

if moddate <> 0.

date = date + 1.

endif.

write: / date.

Regards

Allan Cristian

Message was edited by:

Allan Cristian

Former Member
0 Kudos

HR_IE_NUM_PRSI_WEEKS try this FM.

DATE_GET_WEEK ...also try this....

Regards

Vasu