‎2009 Apr 14 10:50 AM
Hi All,
Is there any Function module to convert 1st date of current month to last date of preveous month.
becouse my date is coming like ' 79949668' I have convert it into 01.04.2005 with the help of FM
CONVERSION_EXIT_INVDT_OUTPUT.Ok now I want last date of preveous month so I tried minus one option but it is not working.
Please help.
Regards,
Tushar
‎2009 Apr 14 11:28 AM
Hi,
The actual date is 99999999 - 79949668 = 20050331. Move this value to sy-datum variable format and do the minus operation, that would give the date value you are looking for.
Issa
‎2009 Apr 14 10:53 AM
By example if you have a variable
data L_date like sy-datum.
with 20090101 and you want the day before make this
l_date = l_date - 1.
Now you have 20081231
‎2009 Apr 14 10:59 AM
dear
this is the Fuction module solve your problem :
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = 02.02.2009
days =
months = 1
* SIGNUM = '+'
years =
* IMPORTING
* CALC_DATE = 02.03.2009 rgds ankit
‎2009 Apr 14 11:01 AM
hi,
you can also do it this way... it will work for sure....
date = date - 31.
Regards,
Siddarth
‎2009 Apr 14 11:28 AM
Hi,
The actual date is 99999999 - 79949668 = 20050331. Move this value to sy-datum variable format and do the minus operation, that would give the date value you are looking for.
Issa
‎2009 Apr 14 12:23 PM
Hi,
Try with the following Function Modules.
OIL_LAST_DAY_OF_MONTH - Gives the last day of the month
SG_PS_GET_LAST_DAY_OF_MONTH - Last day of the month
OIL_LAST_DAY_OF_PREVIOUS_MONTH - Gives the last day of the prevous month
OIL_MONTH_GET_FIRST_LAST - Gives the month first day date & last day date
Thank you,
Sekhar.
‎2009 Apr 14 12:45 PM
Hi Tushar,
try this FM "HR_PT_ADD_MONTH_TO_DATE "
HR_PT_ADD_MONTH_TO_DATE "HR-PT: Add or subtract months to a ', '-' or '='. if '=', then
u2022 DMM_POS = 'BEG' - return 1st day of the DMM_COUNT month of the same year. Use MM format (e.g. 02) otherwise you can get date like '2 /12/2002' for February uF04C.
u2022 DMM_POS = 'END' - returns the (DMM_COUNT month + 1), (day - 1) for the input date DMM_DATIN.
Bug: try DMM_DATIN = MM/31/YYYY, DMM_COUNT = 1 uF04C.
RS_VARI_V_L_LAST_MONTH Returns last day of last month.
RS_VARI_V_1_ACTUAL_MONTH Returns first day of the actual Month
RS_VARI_V_1_LAST_MONTH Returns first day of the Last MOnth
RS_VARI_V_1_NEXT_MONTH Returns first day of the next month.
Regardss,
Prabhu