2007 Dec 10 12:53 PM
When I call the function module CALCULATE_DATE with input MONTHS=1 and START_DATE=20080131, I get RESULT_DATE=00000000, where one would expect the last date of February to be returned.
Am I not using this function correctly?
2007 Dec 10 12:54 PM
Hi,
Use this function Module
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
months = '2'
olddate = lv_date
IMPORTING
newdate = lv_newdate.
Regards,
Prashant
Hi,
Use this function Module
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
months = '2'
olddate = lv_date
IMPORTING
newdate = lv_newdate.
Regards,
Prashant
2007 Dec 10 12:54 PM
Hi,
Use this function Module
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
months = '2'
olddate = lv_date
IMPORTING
newdate = lv_newdate.
Regards,
Prashant
2007 Dec 10 12:57 PM
Hi, Sir,
Please do reward if useful.
Thankx.
Please see the FM below :
data: wa_date like sy-datum.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = '20080229'
days = 0
months = 24
signum = '-'
years = 0
importing
calc_date = wa_date.
YOu could also use the function module 'CCM_GO_BACK_MONTHS'
*Func mod will return the date six months before current date
call function 'CCM_GO_BACK_MONTHS'
exporting
currdate = w_curr_date
backmonths = c_number_of_months
importing
newdate = w_six_months_old_date.
2007 Dec 10 1:02 PM
Hi,
You can use these function modules too for calculating the future date :
Function Modules related to Date and Time Calculations
CALCULATE_DATE : Calculates the future date based on the input .
DATE_TO_DAY : Returns the Day for the entered date.
DATE_COMPUTE_DAY : Returns weekday for a date
DATE_GET_WEEK : Returns week for a date
DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified
MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
MONTH_NAMES_GET : Get the names of the month
WEEK_GET_FIRST_DAY : Get the first day of the week
HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
LAST_DAY_OF_MONTHS : Returns the last day of the month.
Hope you will try with these function modules.
Thanks,
Sakthi C
*Rewards if useful*
2007 Dec 10 1:05 PM
hi Lieven,
pls. note the out date has to be date type as well.
DATA : in TYPE sy-datum,
<b> out TYPE sy-datum.</b>
in = sy-datum.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
* DAYS = '0'
months = '1'
start_date = in
IMPORTING
result_date = out.hope this helps
ec
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |