on 2009 Sep 07 3:37 AM
Hi,
I have problem generate query report on counting days in month and year. My report has only fiscal year/period variable.
The report has a formula where figure need to multiply with days in month and year
Example:
Jan Feb March
Inventory (RM) 1000 2000 3000
Cost of Sales (RM) 100 200 300
No. of days in month 31 28 31
No. of days in year 365 365 365
YTD Cost of Sales 100 200100 300200+100
YTD No of Days 31 3128 3128+31
YTD Inventory days (1000/100)31 days [2000/(200+100)](31+28 days)
YTD Inventory turn 365/YTD Inventory days
Formula :
YTD Inventory days = (Monthly inventory / YTD Cost of sales) x YTD No. days in a year
YTD Inventory turns = 365 / YTD inventory days
Please advice me on the solution.
Thank you.
Thank you, problem solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mansi Dandavate,
Thanks for the solution but i also needs to calculate YTD no. of days. Example if my input 02.2009 the days will calculate days in january and days in february such as 31+28 = 59. Do i need to create a new formula variable based on this, since the days in month also i need in the row?
Appreciate if you can give the solution.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mansi Dandavate,
I manage to solve the problem for count days in month but not year. Could you provide me the coding for this. I'm using 0P_FPER period/fiscal year. I have this coding for count days in month.
CASE i_vnam. " Variablenname
WHEN 'ZNUMDAY'.
DATA: l_firstday LIKE SY-DATUM,
l_lastday LIKE SY-DATUM,
ws_year(4) type c,
ws_mth(2) type c.
DATA: l_number_of_days TYPE INT4.
DATA: loc_var_range LIKE rrrangeexit.
clear : ws_year, ws_mth.
IF i_step = 2.
LOOP AT i_t_var_range INTO loc_var_range
WHERE vnam = '0P_FPER'.
EXIT.
ENDLOOP.
ws_year = loc_var_range-low(4).
ws_mth = loc_var_range-low+5(2).
CONCATENATE ws_year ws_mth '01' INTO l_firstday.
CONCATENATE loc_var_range-low '01' INTO l_firstday.
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
DAY_IN = l_firstday
IMPORTING
LAST_DAY_OF_MONTH = l_lastday .
l_number_of_days = l_lastday - l_firstday.
l_number_of_days = l_number_of_days + 1.
CLEAR l_s_range.
l_s_range-low = l_number_of_days .
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDIF.
ENDCASE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can create two formula variables to count no of days in a month and year and in the exit you can find out how many no of days are present in the year and month...
Use the following funtion module...This will give you the last day of the month...
For no of days in year just chk if feb has 28 or 29 days and accordingly the year will have either 365 or 366....
SLS_MISC_GET_LAST_DAY_OF_MONTH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ahmed,
I am not to understand the following values
YTD Cost of Sales 100 200100 300200+100
YTD No of Days 31 3128 3128+31
Plz explain in more details . so that i can to answer u r question
Regards
Ram.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.