‎2007 Jun 04 7:52 PM
hello friends,
i have a scenario, where , when the entered period as parameter is
YYYYMM the last date for that particular month MM
should be calculated ( i dont know how), and should be attached to this period
like
YYYYMMDD
how do i calculate this DD (ie. last day of the moth) for the
given month and year.
like yyyymm is 200404 then i should output 20040431
if 200510 then output sould be 20051031
if 200302 then output should be 20030228.
can some one help.
thank you.
‎2007 Jun 04 8:10 PM
Try this.
report zrich_0001.
data: yyyymm(6) type c value '200704'.
data: datum type sy-datum.
data: last_datum type sy-datum.
datum = yyyymm.
datum+6(2) = '01'.
call function 'LAST_DAY_OF_MONTHS'
exporting
day_in = datum
importing
last_day_of_month = last_datum.
write:/ last_datum.
Regards,
RIch Heilman
‎2007 Jun 04 8:05 PM
Hi Saritha,
Check this function module "BKK_GET_MONTH_LASTDAY" or "FKK_LAST_DAY_OF_MONTH"
Pass the date to the function module and it will give the last day of the month.
Search in SE37 with lastday* and you will get lots of function modules for your requirement.
Regards,
Ramesh Babu
*Award points if reply found useful
‎2007 Jun 04 8:10 PM
Try this.
report zrich_0001.
data: yyyymm(6) type c value '200704'.
data: datum type sy-datum.
data: last_datum type sy-datum.
datum = yyyymm.
datum+6(2) = '01'.
call function 'LAST_DAY_OF_MONTHS'
exporting
day_in = datum
importing
last_day_of_month = last_datum.
write:/ last_datum.
Regards,
RIch Heilman
‎2007 Jun 04 8:31 PM