on 04-25-2006 10:45 AM
Hi.
I have a attribute called Relase date. I want to calculate no.of days from the current date. In cube I have no Cal Day so I cannot calculate the no.of days in Be.x.
Thanks in advance.
sudhakar.
Hi,
1. In the new formula create a varibel with repalcement path in the operands side. Give release dt characteristic
as object and with 'key'. Drag this variable in the new formula. This should display release dates.
2.Now you have to write a customer exit for getting SY-DATUM. Use the following code.
Before that create a variable of type customer exit for system date on the same release date
object. (ex: ZSYSDT - not ready for input processing type customer exit)
DATA: W_I_T_VAR_RANGE_IN like RRRANGEEXIT.
L_S_RANGE TYPE RSR_S_RANGESID.
CLEAR: W_I_T_VAR_RANGE_IN, L_S_RANGE.
If I_STEP = 2.
READ TABLE I_T_VAR_RANGE WITH KEY = 'ZSYSDT' INTO W_I_T_RANGE_IN.
CASE VNAM.
WHEN ZSYSDT.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-LOW = SY-DATUM.
APPEND L_S_RANGE TO E_T_RANGE.
ENDCASE.
ENDIF.
3.Now in the new formula subract ZRELDT from ZSYSDT.
This will display the no of days. You can do this at CKF level also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sudhakar
You need Two Formula Variables in order to Calculate No of days From your available 'Release Date' and the Current date( which is not available in your cube).
1) Create one Formula Variable(For Ex, ZV_RLDT), with following properties
Processing Type : Replacement Path
Characteristic : Your Release Date attribute
Replace Variable with : Key
Dimension ID : Date
This variable will be populated by your Release date Attribute
2) Create another Formula Variable(Ex,ZV_CURDT), with following properties
Processing Type : Customer Exit
Dimension Id : Date
Insert the following Code in your CMOD project in the Include (ZXRSRU01) section of Function Exit (EXIT_SAPLRRS0_001)
-
DATA: wa_e like line of e_t_range.
CASE I_VNAM.
when 'ZV_CURDT'.
clear wa_e.
wa_e-sign = 'I'.
wa_e-opt = 'EQ'.
wa_e-low = sy-datum.
append wa_e to E_T_RANGE.
ENDCASE.
-
This will populate the Current Date in the Variable 'ZV_CURDT'.
3) Now write the below shown simple logic in your new Formula defined on Keyfigures
No. of Days = ZV_CURDT - ZV_RLDT
Hope this Helps.
Let me know still if any doubts.
Dont forget to assign points if it solves your problem.
Balu P
IBM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Balu,
Do you have any idea after getting calculated the No. of days, Indeed I have to devide by 30 in order to get months.
So I have to build a quey where I nedd to display the Stock Quantities against to the Titles according to their ageing.
Let us see, the following objects available in the Query:
<b>Stock Quantity</b>(selection in Columns, ristricted with Current cal week)
<b>Age</b>: in Months( should be hidden)
<b>Titles</b>
Now I will place the titles in rows. In the columns I should have <b><6Months</b>, <b><12 Months</b>, <b><24 Months</b>, <b>>24months</b>. All these columns should display the stocks.
How to write formulae for the above columns.
Thanks,
Suresh
you can define a formula variable for the same. I had done that in my last project. if you need to calculate the diff. b/w 2 date fields. define 2 variables and then one formula variable which is the difference b/w the both.
Steps are as follows.
Under key figure, right click and select New Formula. Under formula variable, right click again and define new variable. The variable wizard will pop up. in that eneter the name and description. Processing by must be Replacement path.
Then click on the NEXT button and select the infoobject. In your case it will be a data characteristic i.2 0DATE. and then click on the NEXT button and select Replacement variable with 'KEY. then go to the next screen and select DIM ID ad number. then clcik on finish.
Now to the above steps for other dtae variable.
Once the variable for bothe the dates are defined now you can use both the variable to calculate the formula i.e you can caluclate the difference b/w both the dates.
hope this will help.
if you still have doubt then please let me know.
contact tapan.tripathy@wipro.com.
Regards,
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 do that in a customer exit I believe. Let me know .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.