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

Date function

Dear All

Please let me the function modules for the following

1. calculate the no. of day between two dates.

2. derive the last day of a month.

3. geting a new date by adding or substracting no of days to a date.

4. extract day, month, year from the date field.

thanks

ravi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 30, 2005 at 05:57 AM

    Hi,

    Please find those below

    1. calculate the no. of day between two dates.

    <b>DAYS_BETWEEN_TWO_DATES</b>

    2. derive the last day of a month.

    <b>RP_LAST_DAY_OF_MONTHS</b>

    3. geting a new date by adding or substracting no of

    days to a date.

    <b>MONTH_PLUS_DETERMINE</b>

    Note: For subtracting give <b>-ve</b> value for

    MONTHS parameter .

    4. extract day, month, year from the date field.

    Data :w_date like sy-datum,

    w_year(4) type c,

    w_day(2) type c,

    w_mon(2) type c.

    w_date = sy-datum.

    w_year = w_date+0(4).

    w_mon = w_date+4(2).

    w_day = w_date+6(2).

    The above holds respective values.

    Please reward points if this explanation useful.

    Regards,

    Siva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 30, 2005 at 05:49 AM

    hi,

    try with this FMs

    HR_SEN_CALE_DAYS_DATE ( for 1 & 3)

    LAST_DAY_OF_MONTHS (2)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 30, 2005 at 05:58 AM

    Hi Ravi,

    Here are some FMs:

    > 2. derive the last day of a month. NUMBER_OF_DAYS_PER_MONTH_GET

    > 4. extract day, month, year from the date field.

    You can do this as follows:

    If the date (p_date) is 20050905,

    p_year = p_date+0(4).

    p_month = p_date+4(2).

    p_day = p_date+6(2).

    Sudha

    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.