Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

to find a function module to calculate 12 months from the current date

Former Member
0 Kudos
2,085

hi ,

Is there any function module which will calculate 12 months from the current date?

If not how to do so?

Points will be rewarded

Thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos
291

CALL FUNCTION 'MONTH_PLUS_DETERMINE'

EXPORTING

MONTHS = 11

OLDDATE = INDATE

IMPORTING

NEWDATE = OUTDATE.

indate todays date.

outdate you will get the out date.

regards

shiba dutta

10 REPLIES 10

Former Member
0 Kudos
291

Hello Jayashree,

Can you please explain in detail as to what your requirement is ?

Avisesh

0 Kudos
291

say for eg:

today's date : 05/01/2007 ( will be sy-datum )

required output date as 50/01/2008----->is need

0 Kudos
291
data: v_date like sy-datum,
      v_datenew like sy-datum.
 
 v_date = sy-datum.
 
 
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
  EXPORTING
    date            = v_date
    days            = 00
    months          = 12
   SIGNUM           = '+' "sum 
    years           = 00  "number of years
 IMPORTING  
   CALC_DATE       = v_datenew.
 
 
write:/'Current date',  v_date,
        'new date   ', v_datenew.

0 Kudos
291

hi check this ..this will give ur output.

Didnt u tried the options as listed above .

I think u need to execute them first of all and then mark appropriate points to them cause it was already over .

data: date like sy-datum,
      date1 like sy-datum.

date = sy-datum.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
  EXPORTING
    date            = date
    days            = 00
    months          = 12      "months added
   SIGNUM           = '+'
    years           = 00
 IMPORTING
   CALC_DATE       = date1. " new date


write:/ 'new date',  date1.

Please close the thread.

Okay seems my internet access is too fast before closing the thread.

vijay.

Former Member
0 Kudos
292

CALL FUNCTION 'MONTH_PLUS_DETERMINE'

EXPORTING

MONTHS = 11

OLDDATE = INDATE

IMPORTING

NEWDATE = OUTDATE.

indate todays date.

outdate you will get the out date.

regards

shiba dutta

Former Member
0 Kudos
291

RP_CALC_DATE_IN_INTERVAL. use this FM

Message was edited by:

sateesh kumar

Former Member
0 Kudos
291

use this FM MONTH_PLUS_DETERMINE

Former Member
0 Kudos
291

hi

use this function module

<b>RP_CALC_DATE_IN_INTERVAL</b>

thx

rams

Former Member
0 Kudos
291

Hi jayashree,

use fm <b>calculate_date</b>. it will work.

ex:CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

  • DAYS = '0'

MONTHS = '-12'

START_DATE = '20061231'

IMPORTING

RESULT_DATE = lv_date.

reward if helpful

Former Member
0 Kudos
291

hello Jayashree and the others!

data lv_date like sy-datlo.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

  • DAYS = '0'

MONTHS = '12'

START_DATE = '20070105'

IMPORTING

RESULT_DATE = lv_date.

write:/ lv_date.

output:

5.01.2008