2011 Aug 29 7:17 AM
Hi ,
Can anyone please suggest me whether we have any standard function module to calculate a date in following format:
example:
If I enter date 26/08/11(format for entering date can be any)
It should return me 08/11, 07/11, 06/11
i.e on entering date i should get in return previous two months along with current month as output.
I have searched with std date function module but none of them was matching my reqiurement.
Please help.
Thanks & Regards,
Shweta
Moderator Message: Basic date related questions are not allowed. Please search before posting.
Edited by: Suhas Saha on Aug 29, 2011 12:57 PM
Hi ,
Can anyone please suggest me whether we have any standard function module to calculate a date in following format:
example:
If I enter date 26/08/11(format for entering date can be any)
It should return me 08/11, 07/11, 06/11
i.e on entering date i should get in return previous two months along with current month as output.
I have searched with std date function module but none of them was matching my reqiurement.
Please help.
Thanks & Regards,
Shweta
Moderator Message: Basic date related questions are not allowed. Please search before posting.
Edited by: Suhas Saha on Aug 29, 2011 12:57 PM
2011 Aug 29 7:43 AM
2011 Aug 29 7:48 AM
You can create a simple custom function module and achieve this requirement.
2011 Aug 29 8:11 AM
Hi,
This is a very simple requirement. You can just do like below.
va_month = sy-datum+2(2). "Month
va_year = sy-datum+4(4). "Year
if va_month > 2.
va_prev_first_month = va_month - 1.
va_prev_sec_month = va_month - 2.
concatenate va_month va_year seperated by '/' into va_curr_month.
concatenate va_prev_first_month va_year seperated by '/' into va_prev_1.
concatenate va_prev_sec_month va_year seperated by '/' into va_prev_2.
else.
case va_month.
when 1.
va_prev_first_month = 12.
va_prev_sec_month = 11.
concatenate va_month va_year seperated by '/' into va_curr_month.
va_year = va_year - 1.
concatenate va_prev_first_month va_year seperated by '/' into va_prev_1.
concatenate va_prev_sec_month va_year seperated by '/' into va_prev_2.
when 2.
va_prev_first_month = 1.
va_prev_sec_month = 12.
concatenate va_month va_year seperated by '/' into va_curr_month.
concatenate va_prev_first_month va_year seperated by '/' into va_prev_1.
va_year = va_year - 1.
concatenate va_prev_sec_month va_year seperated by '/' into va_prev_2.
endif.
2011 Aug 29 8:14 AM
Hi ,
By using this function module CCM_GO_BACK_MONTHS
you can create your own .
regards
Deepak.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |