2007 Nov 23 3:20 AM
Hi Experts,
Is there any function module to find by number of days in a month by passing month name or value.
Thanks in Advance,
Best Regards,
IFF
2007 Nov 23 3:22 AM
2007 Nov 23 3:22 AM
2007 Nov 23 3:28 AM
Hi,
You can use this FM LAST_DAY_OF_MONTHS.
data: last_day type sy-datum.
data: num type i.
call function 'LAST_DAY_OF_MONTHS'
exporting
day_in = sy-datum
importing
last_day_of_month = last_day.
num = last_day+6(2).
write:/ num.
Regards,
Ferry Lianto
2007 Nov 23 3:44 AM
Hi IFF,
The codes below are the sample codes to get number of days .
If you're about to count the working days, consider to subtract number of public holidays from table THOC .
GET NUMBER OF DAYS IN SPECIFIED MONTH
parameters :
P_MONTH(2),
P_YEAR(4) .
tables T009B.
data :
DAYS like T009B-BUTAG,
MONTH like T009B-BUMON,
YEARS like T009B-BDATJ.
start-of-selection.
Get number of days
MONTH = P_MONTH.
YEARS = P_YEAR.
call function 'NUMBER_OF_DAYS_PER_MONTH_GET'
exporting
PAR_MONTH = MONTH
PAR_YEAR = YEARS
importing
PAR_DAYS = DAYS.
.
write : /1(10) 'Month : ', (10) MONTH .
write : /1(10) 'Year : ', (10) YEARS .
write : /1(10) 'Days : ', (10) DAYS .
----- END OF PROGRAM
Rgds,
TSW
2008 Jan 30 2:13 PM
You can try yo use Function Module K_ABC_WORKDAYS_FOR_PERIODS_GET and then count the records returned.
Regards
2008 Jan 30 2:19 PM