Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate no of days in a month

Former Member
0 Kudos

Hi all,

The no of days in a month should be equal to the total no of days in all the weeks in that month. But i was not able to get that. This scenario comes when the same cal week is involved in two different months. Can anyone explain how to achieve this.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

Try FM NUMBER_OF_DAYS_PER_MONTH_GET

See if firs ur requirements.

-Rajat

6 REPLIES 6

Former Member
0 Kudos

Hello,

Try FM NUMBER_OF_DAYS_PER_MONTH_GET

See if firs ur requirements.

-Rajat

0 Kudos

there is a stock on hand field which is used in the calculation for inventory carrying cost. the inventory carrying cost for a week/month is calculated using the stock on hand and no of days in that month. So in the report the total inventory carrying cost for all the weeks in that month should match with the monthly report carrying cost values which uses no of days as 28/30/31 depending on the month. But they are not matching.

I require your valuable inputs as to how to achieve this.

Former Member
0 Kudos

Hi,

you may use the function module

NUMBER_OF_DAYS_PER_MONTH_GET

IMPORTING

VALUE(PAR_MONTH) LIKE T009B-BUMON -


> Give Month

VALUE(PAR_YEAR) LIKE T009B-BDATJ -


> Give Year

EXPORTING

VALUE(PAR_DAYS) LIKE T009B-BUTAG

Regards,

Anirban

Former Member
0 Kudos

wht are your inputs. is it the fiscal week or the date range?

0 Kudos

it is fiscal week

Former Member
0 Kudos

done