2007 Mar 06 10:34 AM
Hi Gurus
my requirement is just simple:
suppose today's date is : 07.03.3007.
I want to subtract 12 months from the current.
So that I have to get 07.03.2006.
Please suggest me any FM available.
Points are guaranteed.
Regards,
kumar
2007 Mar 06 10:37 AM
<b>CCM_GO_BACK_MONTHS</b>
data d1 type sy-datum.
CALL FUNCTION 'CCM_GO_BACK_MONTHS'
EXPORTING
currdate = sy-datum
backmonths = '12'
IMPORTING
NEWDATE = d1.
write d1.
Message was edited by:
Santosh Kumar Patha
Hi Gurus
my requirement is just simple:
suppose today's date is : 07.03.3007.
I want to subtract 12 months from the current.
So that I have to get 07.03.2006.
Please suggest me any FM available.
Points are guaranteed.
Regards,
kumar
2007 Mar 06 10:37 AM
<b>CCM_GO_BACK_MONTHS</b>
data d1 type sy-datum.
CALL FUNCTION 'CCM_GO_BACK_MONTHS'
EXPORTING
currdate = sy-datum
backmonths = '12'
IMPORTING
NEWDATE = d1.
write d1.
Message was edited by:
Santosh Kumar Patha
2007 Mar 06 10:38 AM
CALL FUNCTION 'CCM_GO_BACK_MONTHS'
EXPORTING
currdate = sy-datum
backmonths = '12'
IMPORTING
newdate = p__audat.
2007 Mar 06 10:40 AM
hi i dont think u will get any FM's to do this task
data: temp_dat(10).
data: year(4).
year = temp_dat+5(4).
year = year - 1.
concatenate temp_dat0(2) temp_dat3(2) year into temp_dat separated by '.'.
2007 Mar 06 10:42 AM
use FM 'CALCULATE_DATE'
u can give negative value in month field..like '-12'.
or u can simply write like this -
p_date = p_date - 12 .
bt for this date shud be of type sy-datum like 20061231.
amit
reward if helpfull
2007 Mar 06 10:44 AM
Hi ram,
Function module "CCM_GO_BACK_MONTHS" will give you the required format for the date that you want.
Mark all helpful answers
2007 Mar 06 10:47 AM
2007 Mar 06 11:04 AM
Hai sree ram ...
Here if u want to suntract exactly 12 munths from a date u can do it as:
DATA DATE LIKE SY-DATUM VALUE '20070307'.
SUBTRACT 1 FROM DATE+0(4) .
WRITE / DATE.
or
u can use the function modole 'CCM_GO_BACK_MONTHS'
W_D1 = SY-DATUM.
CALL FUNCTION 'CCM_GO_BACK_MONTHS'
EXPORTING
CURRDATE = W_D1
BACKMONTHS = 12
IMPORTING
NEWDATE = W_D1.
WRITE W_D1.
here w_d1 will get the new date.
Suresh....
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |