2014 May 16 3:29 PM
Hi guru's,
actually my requirement is to add 1 month to input date which is having range (FROM DATE and TO DATE ).
lets say, my input is for From date is 01.04.2014 and TO Date is 30.04.2014.
and i'm expecting From Date is 01.05.2014 and TO Date is 31.05.2014 after adding month as may month contains 31 days.
in my report i have used "RE_ADD_MONTH_TO_DATE" function module. it's giving me TO date is 30.05.2014 .
could anybody please give me some idea .
Thanks in Advance.
Regards
satish
2014 May 16 3:38 PM
Hi.
use this function
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = '1'
olddate = sy-datum
IMPORTING
NEWDATE = l_fecha .
Regards
Miguel
2014 May 16 3:38 PM
Hi.
use this function
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = '1'
olddate = sy-datum
IMPORTING
NEWDATE = l_fecha .
Regards
Miguel
2014 May 16 3:49 PM
hi miguel,
Thanks for ur prompt reply, but I've tried and failed to make this work.
As i've already mentioned in my query , given input is 30.04.2014 and it's giving me 30.05.2014
but i'm expecting 31.05.2014.
regards
satish
2014 May 16 3:54 PM
you are asking for 1 month from the input date.
it sounds like what you are after is the last day of the month
several ways you can do this.....
one way....take the 1st day of a month and subtract 1 from it
or use one of the many date functions, like
FKK_GET_LAST_DAY_OF_MONTH for example....only need to supply the date in and last day is returned.
2014 May 16 3:54 PM
so, what u need to do is to first count the days of the months, some months 30 or 31..then add those days to the date by normal add.
l_date1 = 01.04.2014
CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
EXPORTING
par_month = '05'
par_year = '2014'
IMPORTING
PAR_DAYS = l_dias .
l_date = l_date1 + l_days.
Regards
Miguel
2014 May 16 3:56 PM
Hi,
add first 1 month than try FM: LAST_DAY_OF_MONTH-
regards, Dieter
2014 May 16 4:14 PM
thank u all for your valuable time and helpful replies. problem solved.