I'm using BW QueryDesigner 3.5.
I have three key figures in my structure:
Key figure A --> Value X restricted with 0Calmonth to actual month
Key figure B --> Value Y restricted with 0Calmonth to actual month -1 (Offset -1)
Calculated Key figure C:
Now I calculate Key figure A minus Key figure B.
In the description for this calculated Key figure I want a text variable where give me the value of the actual month - at the moment the standard SAP text variable can't find anything cause - I think - the variable can't decide between the two values of months...
How can I achieve this? Could anyone give me please the required coding?
I read a lot of threads but can't find something like this.
Need detailed help.
If you need more information or my description are not clear enough please let me know.
thanks in advance for all answers and hints!!!
I understand what you're saying.
That's just the issue you can't use the SAP standard variable. Because you've actual in one column and actual-1 in another, SAP variable can't return the appropriate text for each.
Therefore you can use two customer exit variable to return the text. So create a text variable of type user exit for actual, let's name it zactual and another text variable of type user exit let's name it zactualminus1.
So you already have the variable for the actual, imagine it's name was ZMONTH
The logic of the code in CMOD transaction can be like this:
IF i_step = 2.
ln_range-sign = 'I'.
ln_range-opt = 'EQ'.
LOOP AT i_t_var_range INTO ln_t_var_range
WHERE vnam = 'ZMONTH'.
SELECT SINGLE TXTMD FROM /BI0/TFISCPER3 INTO i_month_txt
WHERE LANGU = 'EN' AND FISCPER3 = ln_t_var_range-low.
ln_range-low = i_month_txt.
APPEND ln_range TO e_t_range.
In my example I was using FISCPER3 instead 0CALMONTH, so you have to replace the text table of FISCPER3 for CALMONTH, but the logic is the same as above. Also you should do a similar code for ZACTUALMINUS1. You can also put a breakpoint in your code to see what's happening to the variable when you execute your query.
Hope this helps,