Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Oct 11, 2007 at 12:56 PM

    Hi,

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

    Reward points.....

    Regards,

    Ramakrishna kotha.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 12:59 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 01:01 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 01:24 PM

    HR_IE_NUM_PRSI_WEEKS try this FM.

    DATE_GET_WEEK ...also try this....

    Regards

    Vasu

    Add comment
    10|10000 characters needed characters exceeded