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

Date calculation

Hello,

I want to calculate a new date (p.e. today + 3 months = 90 days)? I've tried to do this with the convert date and convert inverted-date, but the result was, that I ended with a date that was wrong (p.e. 43.04.2004).

Can someone help me?

Kind Regards,

S. Thomas

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 03, 2004 at 05:43 PM

    Hi Sylvie.

    If you want to add 90 days.

    Just do t1 = sy-datum + 90.

    The system will automatically take care of the addition.

    But if you want to add 3 months, then I would say you put in your piece of code.

    a. Fetch the month component

    b. add 3 to month component

    c. if month component greater than 12 then month = month -12.

    d. year = year + 1.

    Pavan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 04, 2004 at 01:33 PM

    Check fm RP_CALC_DATE_IN_INTERVAL

    I find it very useful.

    Cheers.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 05, 2004 at 04:19 AM

    Hi,

    You can even check this function modules, it works fine.

    Function Module Name:: ADD_TIME_TO_DATE

    Short Description :: Adds months/days/years to date.

    Entering a negative value will subtract from the date.

    Parameters ::

    Exporting:

    I_IDATE : Initial date

    I_TIME : Quantity to add

    I_IPRKZ : Unit of time(D:day, M:month, W:week, Y:year)

    Importing:

    O_IDATE : OUTPUT DATE.

    Message was edited by: Bharath Kumar B

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 05, 2004 at 10:01 PM

    To solve the problem use function module

    DATE_CONV_EXT_TO_INT

    Hope it works.

    let me know if it´s the case.

    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.