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

Addition of days in a date..

Hello,

Is want to add ceratin days in a date if certain condition is successful.

The date data in i_output-BLDAT is 20080428. If I do as follows, it does not work properly, is there any function module to add days to date.

For e.g.

i_out-ZFBDT = i_output-BLDAT + 220.

Regards,

Rajesh.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 02:22 PM

    Try FM CALCULATE_DATE

    Hope this helps!

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 13, 2008 at 02:24 PM

    Hi,

    Use FM:RP_CALC_DATE_IN_INTERVAL

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 13, 2008 at 02:25 PM

    You can use the Function

    RP_CALC_DATE_IN_INTERVAL

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 02:26 PM

    Hello,

    RP_CALC_DATE_IN_INTERVAL

    Add/subtract years/months/days from a date

    - Jayant Sahu.

    Add a comment
    10|10000 characters needed characters exceeded

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

    Use Function Module RP_CALC_DATE_IN_INTERVAL

    Other important FMs are :

    HR_JP_MONTH_BEGIN_END_DATE

    First Date and Last date of the month

    HR_IN_GET_DATE_COMPONENTS

    Gets the components of a date

    FIRST_AND_LAST_DAY_IN_YEAR_GET

    Get First Date and Last Date of a year

    HR_SGPBS_YRS_MTHS_DAYS

    Find the difference between two days

    DELTA_TIME_DAY_HOUR

    Time Difference

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 13, 2008 at 02:43 PM

    Hi,

    Check this FM,

    DATE_IN_FUTURE

    DATA:
    date1 LIKE rm06b-eeind VALUE '20080428',
    date2 TYPE sy-datum,
    date3 TYPE sy-datum.
    
    CALL FUNCTION 'DATE_IN_FUTURE'
      EXPORTING
        anzahl_tage             = 220
        import_datum            = date1
      IMPORTING
        export_datum_int_format = date2.
    
    WRITE:/ date1, date2.

    Regards

    Adil

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 13, 2008 at 02:46 PM

    Hi Rajesh,

    When You Pass 220 days to the Function module RP_CALC_DATE_IN_INTERVAL it is going to the dump.

    Because Days Parameter Length is 2.So it accepts upto 99 days.

    DATA:date TYPE sy-datum VALUE '20080428'.
    
    START-OF-SELECTION.
      CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
          date      = date
          days      = '220'    <-----Change to 99  then it works
          months    = '00'
          signum    = '+'
          years     = '00'
        IMPORTING
          calc_date = date.
      .
      WRITE:'New date' ,date.

    So,Use Function module BKK_ADD_WORKINGDAY

    DATA:date TYPE sy-datum VALUE '20080428'.
      START-OF-SELECTION.
       CALL FUNCTION 'BKK_ADD_WORKINGDAY'
         EXPORTING
           i_date            = Date
           i_days            = '220'
    *      I_CALENDAR1       =
    *      I_CALENDAR2       =
        IMPORTING
          E_DATE            = date
    *      E_RETURN          =
                 .
      WRITE:/ 'New Date is',date.

    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.