Current Year Formula Variable with SAP-Exit
Hi Experts ,
Is there any SAP Exit Formula Variable avaliable that we can use in BEX which gives us the Current Calander Year?
I am able to find the current fiscal period ie "0F_CUFPE" which provides the current posting period/month.
On similar basis, I need a FV which provides me the Current Calender Year.
Please note that I do not need Characteristic Variables for Fiscal Year .
Regards
Dipali
Hi,
If you're refering to the InfoObject 0CALYEAR, there is an exit variable available called: 0CYEAR - Current Calendar year
Which will filter on the current year.
br
Mikael
Similar Messages
-
Formula variable with User Exit
Hi,
Can we create a Formula Variable of processing type USER EXIT...which will display a constant Value Y
Any syntax would be helpful
ThanksHi,
check this for formula variables with user exits;
http://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/customer-exit-to-derive-formula-variable-to-text-variable-sap-bw-35-3030684
Also Check the issues and solution :
Formula Variable with User Exit....Problem
Thanks
Hemav -
Formula Variable with customer exit
Hi,
can we use Formula variables with customer exit based on characteristics(ex Bill date)? if yes, can you guys help me on this.
Thanks
kriYes , you can use a formula variable with customer exit based on characteristics .
Depends on the requirement what you want to show in the formula variable ,
Eg : if you want to show the max fiscal year period , in that case :
create a new formula in the keyfigure section of your query , go to edit , you can see formula variable below the keyfigures ,
right click on the same and create new formula variable :
Write the code for the formula varible in the backend as we do for normal customer exit varaible :
for this e.g the code will be :
FORM get_variable_value
tables E_T_RANGE type RSR_T_RANGESID
using I_VNAM type RSZGLOBV-VNAM
I_VARTYP type RSZGLOBV-VARTYP
I_IOBJNM type RSZGLOBV-IOBJNM
I_S_COB_PRO type RSD_S_COB_PRO
I_S_RKB1D type RSR_S_RKB1D
I_PERIV type RRO01_S_RKB1F-PERIV
I_T_VAR_RANGE type RRS0_T_VAR_RANGE
I_STEP type I.
DATA L_S_RANGE LIKE LINE OF E_T_RANGE.
DATA loc_var_range LIKE rrrangeexit.
Data : l_inPer TYPE string.
IF i_step = 1.
Select min( distinct FISCPER )
from /BIC/A(DSO name)
into l_minper .
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = l_minper .
APPEND l_s_range TO e_t_range.
endif.
drag the formula variable in the new formula created and exexcute the query , you will be able to see the output .
This is just an example , your code will differ as per your requirement . -
Formula Variable with User Exit....Problem
Hi
My requirment is to create a Formula Variable on User Exit that will give me Current Cal Year...so that i can use that vale in Formulas
Created Formula Variable with processing Type Customer Exit single Value,Mandator and Unchecked the Variable input ready
The below code in CMOD
WHEN 'XXXXXXX'.
Year = sy-datum(4).
CLEAR L_S_RANGE.
L_S_RANGE-LOW = Year.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND l_s_range TO e_t_range.
But when i execute the query i am getting the below error
No value could be determined for variable xxxxxxx.
Incorrect call of OLAP layer CL_RSR_OLAP; error in BW-BEX-ET
Diagnosis
This error diagnosis is specific only to the variables 0P_FVAEX or 0P_CTPCA !
Termination message BRAIN 632 appears:
Could not determine value for variable 0P_FVAEX (or 0P_CTPCA).
WHAT WRONG I AM DOING...please update meUse the code:
WHEN 'XXXXXXX'.
IF i_step = 2.
Year = sy-datum(4).
CLEAR L_S_RANGE.
L_S_RANGE-HIGH = Year.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDIF.
Let me know, if it is work or not!
- Balajee Kannan -
Formula Variable with customer Exit (ABAP Code)
Hi Experts,
Please advise me wether i am going in the right way to achieve my requirment else please advise me any alternate approach and update me with the abap code for my customer exit as i am not familiar with ABAP.
My Requirment:
Data :
Emp_ID----Start_Date(DATS)---End_Date(DATS)
I had a user entry (intreval) VARIABLE created on Start_Date
User will enter the date intreval he want to analyze...
Ex: 01.01.2008 to 01.02.2008
Now i want to use the No of Days between user entered date intreval in my calculaction of a keyfigure
In the above example it is 31 days
So i created a Formula Variable of Customer Exit now i need a code that will
pass the user entered dates to
FM: FIMA_DAYS_AND_MONTHS_AND_YEARSImport parameters Value
I_DATE_FROM 01.01.2008
I_DATE_TO 01.02.2008
I_FLG_SEPARATE ' '
Export parameters Value
E_DAYS 31
E_MONTHS 1
E_YEARS 1
and need to pass the E_DAYS (31) to the result of formula
User Entry Variable (Intreval) : ZST_VAR
Formula Variable (Customer Exit) : ZND_EXIT
Code
WHEN 'ZND_EXIT'.
DATA: low_date2 TYPE d,
high_date2 TYPE d,
num_days TYPE N,
new_low_date2 TYPE d.
IF i_step = 2.
LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
CLEAR l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
ls_varrange-low = low_date2.
ls_varrange-high = high_date2.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = low_date2
I_DATE_TO = high_date2
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = NUM_DAYS
l_s_range = NUM_DAYS.
APPEND l_s_range TO e_t_range.
EXIT.
ENDLOOP.
endif.Hello,
Before the WHEN statement it shoud have a CASE statement. In the user exit coding place your WHEN statement anywhere between CASE...ENDCASE statement.
your code should look like
DATA: low_date2 TYPE d,
high_date2 TYPE d,
num_days TYPE N,
new_low_date2 TYPE d.
Case i_vnam.
WHEN 'ZND_EXIT'.
IF i_step = 2.
LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
CLEAR l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
low_date2 = ls_varrange-low.
high_date2 = ls_varrange-high.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = low_date2
I_DATE_TO = high_date2
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = NUM_DAYS
l_s_range-low = NUM_DAYS.
APPEND l_s_range TO e_t_range.
EXIT.
ENDLOOP.
endcase.
Thanks
Chandran -
Webi Bypassing BEx Authorization Variable with SAP Exit
BEx query has Hierarchy Node Variable with Authorization as processing type. Its set as User Input ready
When the Webi report is refreshed, the LoVs appear as per the Authorization. However, if user doesn't select any value (pushes from right to left in variable screen) he gets NOT_AUTHORIZED error. Which is not intended, it should check the authorization in the background via SAP exit and populate the result. This is how it runs inBEx query.
However, in Webi it's giving NOT_AUTHORIZED error? This is how the product is designed to work or is it a bug.
I see several forum threads and SAP KBAs/notes but they are not answering my question. Could anyone please help.
I am ready to provide more details on this error.
Thanks,
TilakHi,
this is how authorization variable would work in any of the clients and not just Web Intelligence.
You created an authorization variable which is configured as "read for input", so the user is getting prompted.
So In Web Intelligence the LoV shows up.
if the user does not select a value, then you are not sending a value, so you basically asking for all data and you are not allowed to see all data and therefore you are getting the message "no authorization".
if you are making authorization variables as ready for input then the user needs to select the proper values - regardless of the BI tool.
if you want the authorization to be check in the background then the authorization variable should be configured to not have ready for input.
regards
Ingo Hilgefort -
OLAP Variable with user exit for Infopackage Selection 0fiscper
Hi Frds/ Guru's ,
I have a requirement to use a OLAP Variable for Fiscal year period 0fiscper(Characteristic ) in the Infopackage Selection. . I need to extract the data for Previous Year and Current Year , that is to be automatically selected with a OLAP Variable . The standard one's provided by SAP are not satisfying my requirement,as they are getting populated with SAP Exit and I am not getting the ranges .I am planning to create a variable and use the processing type as Customer Exit and Populate it with ABAP code in respective Enhancement RSR00001.
Even Can I create a ABAP Routine ? Please suggest me which is better to do in respect to performance of dataload , will be really glad if anyone can provide some code for doing this as u might have faced the situation sometime .
I have checked with all the threads available , could get some idea but will be really thankful if u gimme some hints in writing the code , at Exit level and routine level .
Thanks,
Krishthnx
-
Formula variable with replacement path
HI ,
1. Is it possible to use "Customer exist- without user entry variable in the formula variable with the replacement ?
2. if I use two variable for a same time char in one report (one is User entry variable and the other is customer exit variable for calculating current system date), then how it will work ? (User entry variable is there in the "Char restrictions" section and the customer exit variable is customer exit used in formula variable)
Thanks in Advance.
Thanks
Rajesh1. Is it possible to use "Customer exist- without user entry variable in the formula variable with the replacement ?
Yes. use I_step=1
I_STEP = 1
Call takes place directly before variable entry. Can be used to pre populate selection variables
I_STEP = 2
Call takes place directly after variable entry. This step is only started up when the same variable is not input ready and could not be filled at I_STEP=1.
I_STEP = 3 In this call, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called again.
2. if I use two variable for a same time char in one report (one is User entry variable and the other is customer exit variable for calculating current system date), then how it will work ? (User entry variable is there in the "Char restrictions" section and the customer exit variable is customer exit used in formula variable)
Yes you can use both the variable of time char to restrict a characteristic but that should not be used on single characteristic.
You can use the sys defined 0date on one field and the customised one Zsydatum on other char.
Regards
KP -
Formula variable with replacement path on system date
Hi Experts,
I got a requirement to calculate "Days without payment" in report level.
Days without payment = System Date - Payment Date.
(Payment date field is available in CUBE, but system date field is not available in the CUBE)
As we know, the difference b/w 2 dates is not possible directly.It can be possible by creating 2 formula variables with replacement paths on the dates and by writing aformula on these 2 formula variables.
But the thing is I dont have system date readily available, and I tried by using SAP Exit. But we cant create formula variable replacement path on another variable (SAP EXIT).
Do we have any SAP variable for formula with replacement path readily avaliable to get system date (or) any other suggession.
Please suggest me.
Thanks,
Sai Chand.SHi Arminder,
Thanks for your valuable answer.
I tried doing the same previously.As u said we can get system date by creating customer exit variable.
But the thing is to find difference b/w 2 dates, we cant do it directly, we need to create 2 formula variables with replacement path.
1) Var1 = Formula variable with replacement path on system date(custoer exit variable).
2) Var2 = Formula variable with replacement path on paymanet date.
Number of days = var1 - var2.
But as in 1st point, we cant create formula variable with replacement path on another variable, as system date is already a variable of type customer exit.
We can create replacement paths only on characteristics.
Please suggest me .
Thanks,
Sai Chand.S -
How to use formula variable in customer exit
Hi all,
I just want to use formula varible in customer exit
For eg,
I have created formula variable with user manual lnput eg: ZFM_V01 = 30
Another char variable with user manual input eg: 0keydate = 28/02/2011
Required output,
I just want to read my ZFM_V01 value in customer exit
Result = 0KEYDATE - ZFM_V01
EG:
result = 28/02/2011 - 30
Required result = 29/01/2011
Kindly guide me how u get formula varibale value into customer exit(CMOD) and find the required result. please help me.
Thanks & Regards,
R. SaravananSorry, Bhanu,Ashwin need more info
As my understand ::
Function module RSW_CURRENCY_TRANSLATION uses the following parameters
Import parameters
I_CTTNM : Currency translation key (optional)
I_AMOUNT: Amount in source currency (not optional !!) (data type: floating point !!)
I_SCUR : Source currency (optional) I_TCUR : Target currency (optional)
I_TIME_IOBJVL : InfoObject for determination of the time reference (optional)
I_SCUR_IOBJVL : InfoObject for determination of the the source currency (p.eg. 0COMP_CODE) (optional)I_TCUR_IOBJVL : InfoObject for determination of the the target currency (p.eg. 0COMP_CODE) (optional)
I_PERIV : Fiscal year variant (optional)
I_RATE : Exchange rate (optional)
Export parameters
E_AMOUNT : Amount in target currency (data type: floating point !!)
E_RATE : Exchange rate
E_SCUR : Source currency
E_TCUR : Target currency
I created a Currency key(ZXX) which takes CAD and converts to GBP on Planned Exchange rate (P) with time reference 0CALMONTH.
In my case :
Currency Key : ZXX (Confused here)
Source Curr :CAD
Target Curr :GBP
I need a Variable ,which takes time reference and gives back the exchange rate .
,,I am I missing some thing ?
Sudh -
Formula variables with replacement from key
Hi Sdns,
Well We are doing Upgradation from BW3.5 to BI 7.0.. After Upgrade we got stuck up'd at reports.. We are facing an error for a report which is formula variables with replacement from key is not working. The final result is giving us unexpected results i.e, Itz showing the values as X.
We got some reference from Service.sap. We found a note which is 1005772. Howeer this Note is applicable for suport package level 12. But we are already in higher suppor package level 15.. So this note is not applicable.
Can anyone guide us if u people have faced this kind of issue.
Regards,
AluriHi,
Replacemet path processing type can be used with Charceteristics variables, text variables and formula variables.
For example u have created two restricted Key figues for two
years sales comparison and u have used characteristics variables on 0CALYEAR.
The years for which we want to compare sales volume will be selected during the Execution.
If 2000 and 2001 be selected,
these can be assigned as text for restricted Key figures in the record.
Please go thorough the following links.
An application of Replacement path variable can be found here.
http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
Another application to get the Document Count: For example Number of Sales Orders.
Query formula-Counter???
Example for Replacement Path: Characteristic Variable.
http://help.sap.com/saphelp_nw04/helpdata/en/2c/78a03c1178ad2ce10000000a114084/content.htm
Variable Replacement Example
http://help.sap.com/saphelp_nw04/helpdata/en/af/809528939d5b4fbff7e16a5bdc0d85/content.htm
Example for Replacement Path: Formula Variable.
http://help.sap.com/saphelp_nw04/helpdata/en/ca/5f9ac61a205a459d0e7ef313d10321/content.htm
Hope it's helpful......
Thanks,
Kameswari. -
BW 3.5 - Issue with formula variable with replacement path
Dear experts,
I'm facing an issue with formula variable with replacement path.
Just to clarify, I know replacement paths is raising a lot of questions but I've been using this functionnality extensively in the past, both in 7.0 and 3.5, so I'm not looking for basic information about how to use it.
I'm trying to setup a simple report that would show total values per plant of Purchase Order < 100
To do so I've setup a calculated key figure as follow:
VAR1 * ("PO value" < 100 ) * "PO value"
VAR1 is a formula variable with replacement path on 'purchase order' and value attribute 'constant =1'.
(The report has to show values summarized by plant but should not show the detail PO by PO, so I'm not looking at a solution based on condition)
The report as characteristic "plant" in rows and my CKF in columns.
Now let's take an example. I have 3 POs in Plant 1:
PO1 -> 150
PO2 -> 90
PO3 -> 80
Because of the variable with replacement path, the result in my query should be:
plant1 = 170 (even though characteristic "purchase order" is not in my rows, system should evaluate PO one by one and return values only for those two that are below 100).
But the result coming is 320, which is wrong.
I've done the same report on many other 3.5 systems and it worked perfectly, and I am not able to get proper support from SAP OSS who keep saying that this functionnality is not ready in 3.5 (although I've provided screenshot of this working on another 3.5 system!!! how frustrating...)
They have also pointed to problems of Before and After aggregation but that has absolutely no impact. Once again, the scenario is working perfectly on other 3.5 systems with the same query design, so i'm sure it has nothing to do with Query Designer options.
Would anyone have ever come to an equivalenet problem? I'm wondering whether the DB itself could not play a role in the variable with ref characteristic 'constant =1' ...
Any though is welcome!
thanksHi,
The text variable is replaced when the exact date is clear for this key figure column according to the restriction.
To achive this, please make sure that either the variable is directly restricted in the key figure selection, or that the date characteristic is in drilldown.
Regards,
Patricia -
Date formula variable with replacement path.
Hi ,
I have date formula variable with replacement path.
Variable pop up with date format yyyymmdd. but i want dd.mm.yyyy.
I have checked my user profile setting and it is dd.mm.yyyy.
Can u please suggest it .
Thanks
PramodThanks for the rely , but basically i need a variable only for selection.
thats why i have created formula variable processing my cutomer exit.
But i think customre exit variable comes with text format .
any1 has an idea for the same.
Thanks
Babu -
Combine two reports in query designer using key figure with sap exit
Hi experts,
i want to combine two reports in query designer using key figure with sap exit
in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
to calculate due and not due in two columns
in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
now i have requirement like this
not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
or
not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
thank youHi Dirk,
you perhaps know my requirement,
for the management to make used in one report,
we have in reporting finacials Ehp3.
Vendor Due Date Analysis - which show due, not due
Vendor Overdue Analysis - show only due and analysis in time grid frame
i want to combine in one report that show NOT DUE, DUE, DUE time frames in grid.
krish... -
Formula variable in Customer exit
Hi Experts,
I need help.
I create
first Formula variable (Z_OPTSEL) for a user entry, mandatory, ready for input, dimension ID = Number and
second Formula variable (Z_OPT1), customer exit, mandatory, not ready for input, dimension ID = Number .
User Exit code in ZXRSRU01 is :
When 'Z_OPT1'.
case i_step.
when '2'.
clear e_t_range.
read table I_T_VAR_RANGE INTO loc_var_range with key vnam = 'Z_OPTSEL'.
if sy-subrc = 0.
if <b> loc_var_range-low = '1'.</b>
l_s_range-low = '2'.
endif.
if loc_var_range-low = '2'.
l_s_range-low = '0'.
endif.
endif.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
clear l_s_range-high.
APPEND l_s_range TO e_t_range.
endcase.
Unfortunately, I get <u>no value in loc_var_range-low</u> (from Z_OPTSEL) so , I never can fill up Z_OPT1 !! What could I do to fix it ?
Any help would be welcome .
Thanks<FONT FACE = "Tahoma", Font Color = "Blue">
My Dear Friend<br>
<u>Please try the below code:</u><br><br>
Case vnam.<br>
When 'Z_OPT1'.<br>
check i_step = 2.<br>
<br>
read table I_T_VAR_RANGE INTO loc_var_range with key vnam = 'Z_OPTSEL'.<br>
<br>
if sy-subrc = 0.<br>
Clear l_s_range.<br>
if loc_var_range-low = '1'. <br>
l_s_range-low = '2'.<br>
endif.<br>
if loc_var_range-low = '2'.<br>
l_s_range-low = '0'.<br>
endif.<br>
endif.<br>
l_s_range--sign = 'I'.<br>
l_s_range-opt = 'EQ'.<br>
APPEND l_s_range TO e_t_range.<br>
endcase.<br>
<br><br>
Hope it helps.<br><br>
Cheers Abhijit<br>
</FONT><FONT FACE = "Verdana", Font Color = "Red">
Removed
</FONT>
Maybe you are looking for
-
How do you install foreign language fonts?
Does anyone know how to install foreign language fonts that doesn't come with iPad?
-
After Security updation of Windows 7 in Boot Camp (Mac Book Pro with Retina Display) on 13-Nov-2013, Windows 7 Desktop Gadgets are not working properly. This is boot camp problem, because in other normal notebooks (e.g. SONY VAIO, Lenovo with Windows
-
ITunes store wont load on my computer
iTunes run perfectly fine until i try to open iTunes Store, then it closes iTunes all together.
-
Lately I have been getting a rectangular screen titled Login Setting, with my Username and Password and asking me to Login. This screen shows up on opening the computer and has never been seen before the last month or so. It has one box titled Logi
-
Runtime Error R6031. Starting to tick me off
I have windows 10 Technical Preview installed, and it worked great for a bit, Then i started getting this error. it happens on all of my programs i try to run, install, and even trying to uninstall programs. i decided to do a system refresh and every