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

Add +1 to a date in any format ?????????

Hello All,

I want to add +1 to a date .

But it's working only when the format is ddmmyyyy.

I want to get the same output for all the date formats.

Is there any function Module for this ?

Regards,

Deepu.K

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jan 08, 2007 at 12:16 PM

    Try this FM.

    DATE_IN_FUTURE

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 12:16 PM

    FM:RP_CALC_DATE_IN_INTERVAL

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 12:19 PM
    Hi Deepu,
    
    
    call function 'RP_CALC_DATE_IN_INTERVAL'
           exporting
                date      = sy-datum
                days      = 01
                months    = 00
                signum    = '+'
                years     = 00
           importing
                calc_date = v_date.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 12:22 PM

    data: date like sy-datum,

    date1 like sy-datum.

    date = sy-datum.

    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

    EXPORTING

    date = date

    days = 01 day added

    months = 00

    SIGNUM = '+'

    years = 00

    IMPORTING

    CALC_DATE = date1. " new date

    write:/ 'new date', date1.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Deepu

      Are you saying you do not know the format of the input date, and you want a function to determine that from the value?

      If so, it cannot be done since 03/04 could be 3rd April or 4th March - there is no way of telling from the value.

      If the value depends on the User ID, you could use CONVERSION_EXIT_PDATE_INPUT to convert the display value to the internal format of YYYYMMDD.

      To manipulate any date value, if you have it in a field of type DATUM you can just add or deduct a number of days, and the value will be set correctly.

      Hope that helps

      Robin

  • Posted on Jan 08, 2007 at 12:58 PM

    Use DATE_STRING_CONVERT to convert your date to DATS format then add 1 and convert the result back

    regards

    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.