2007 Sep 17 6:56 AM
Hi Experts,
I need a Function module name for the below thing.
If my date is 20070812 then it should minus 1 year and return as 20060812.
If my date is 20050611 then it should minus 2 year and return as 20030611.
I dont need a coding, I need FM for this.Could anyone help?
Points for sure..
Thanks,
Ponraj.s.
2007 Sep 17 7:10 AM
Hi Ponraj,
I do not think that any Standard FM will be there.Either you should code it in your program or you can create your own Z FM for your requirement.
Regards,
Mukesh Kumar
Hi Ponraj,
I do not think that any Standard FM will be there.Either you should code it in your program or you can create your own Z FM for your requirement.
Regards,
Mukesh Kumar
2007 Sep 17 7:03 AM
Hi Ponraj,
The FM can be searched for if there is any logic for the number of years to be deducted from the dates that you have mentioned above.
What is the logic?
Regards,
Puneet Jhari.
2007 Sep 17 7:06 AM
Hi Puneet,
Watever date am giving, it should simply minus 1 year from that and returns that date.
wat that FM name???
2007 Sep 17 7:10 AM
Hi Ponraj,
I do not think that any Standard FM will be there.Either you should code it in your program or you can create your own Z FM for your requirement.
Regards,
Mukesh Kumar
2007 Sep 17 7:14 AM
HI,
you can use FM like 'HR_HCP_ADD_MONTH_TO_DATE'
CALL FUNCTION 'HR_HCP_ADD_MONTH_TO_DATE'
EXPORTING
im_monthcount = '-12' " in months
im_date = lv_date " e.g '10.12.2007'
IMPORTING
EX_DATE = lv_result " result will be 10.12.2006
.
Regards.
2007 Sep 17 7:14 AM
I don't think you will get a FM for such a simple calculation.
There is no need of developing a FM which has such a simple calculation.
Instead you can try to write a simple one liner code for the same.
Regards,
Puneet Jhari.
2007 Sep 17 7:15 AM
Hi,
Use the Function Module : MONTH_PLUS_DETERMINE, Provide inputs months as -12 and olddate as today date.
Hope this info will help you.
Rewards points if useful.
With Regards,
K K V
2007 Sep 17 7:33 AM
Hi,
Use the below code.
DATA: V_DATE LIKE SY-DATUM.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = '20070812'
DAYS = 0
MONTHS = 0
SIGNUM = '-'
YEARS = '01'
IMPORTING
CALC_DATE = V_DATE.
WRITE:/ V_DATE.
CLEAR V_DATE.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = '20050611'
DAYS = 0
MONTHS = 0
SIGNUM = '-'
YEARS = '02'
IMPORTING
CALC_DATE = V_DATE.
WRITE:/ V_DATE.
2007 Sep 17 9:34 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |