on 04-25-2007 7:44 AM
Hi,
can anyone tell me any function module which will return the no of months between two dates like
if i enter .
12.12.2008 - 08.08.2009
it shud return 9 as no of months .
if 12.02.2007 - 05.05.2007 it shud return '4'.
thnx
Hi,
try this code
DATA: lv_m(10) TYPE C.
CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = '20070505'
i_datum_von = '20070212'
I_KZ_INCL_BIS = 'X' "takes the to date into consideration
IMPORTING
E_MONATE = lv_m.
"the result here is 3... I guess 3 full months...
otherwise get the number of days btw two dates and calculate according to your req:
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
I_DATUM_BIS = l_END_DAY
I_DATUM_VON = l_START_DAY
I_KZ_INCL_BIS = '1'
I_STGMETH = '2'
IMPORTING
E_TAGE = l_DAYS.
hope this helps,
Olivier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Check this previous thread which speaks on same
https://forums.sdn.sap.com/click.jspa?searchID=2271431&messageID=3066260
hope this solves ur problem
Regards
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.