Skip to Content
author's profile photo Former Member
Former Member

Number of days in a Month

Hi Experts,

Is there any function module to find by number of days in a month by passing month name or value.

Thanks in Advance,

Best Regards,

IFF

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Nov 23, 2007 at 03:22 AM

    Hi,

    FM "NUMBER_OF_DAYS_PER_MONTH_GET".

    Best regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2007 at 03:28 AM

    Hi,

    You can use this FM LAST_DAY_OF_MONTHS.

    data: last_day type sy-datum.
    data: num type i.
     
    call function 'LAST_DAY_OF_MONTHS'
         exporting
              day_in            = sy-datum
         importing
              last_day_of_month = last_day.
     
    num = last_day+6(2).
     
    write:/ num.
    

    Regards,

    Ferry Lianto

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2007 at 03:44 AM

    Hi IFF,

    The codes below are the sample codes to get number of days .

    If you're about to count the working days, consider to subtract number of public holidays from table THOC .

    • GET NUMBER OF DAYS IN SPECIFIED MONTH

    parameters :

    P_MONTH(2),

    P_YEAR(4) .

    tables T009B.

    data :

    DAYS like T009B-BUTAG,

    MONTH like T009B-BUMON,

    YEARS like T009B-BDATJ.

    start-of-selection.

    • Get number of days

    MONTH = P_MONTH.

    YEARS = P_YEAR.

    call function 'NUMBER_OF_DAYS_PER_MONTH_GET'

    exporting

    PAR_MONTH = MONTH

    PAR_YEAR = YEARS

    importing

    PAR_DAYS = DAYS.

    .

    write : /1(10) 'Month : ', (10) MONTH .

    write : /1(10) 'Year : ', (10) YEARS .

    write : /1(10) 'Days : ', (10) DAYS .

    • ----- END OF PROGRAM

    Rgds,

    TSW

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 30, 2008 at 02:13 PM

    You can try yo use Function Module K_ABC_WORKDAYS_FOR_PERIODS_GET and then count the records returned.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 02:19 PM

    hi,

    try: RP_LAST_DAY_OF_MONTHS

    plz reward if helpful..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.