Code help for formula variable with processing type customer exit
Hi Gurus,
I need help in user exit code. I am calculating a formula variable ( demand variability) in the user exit for a range of values given in the selection screen ( i.e processing based on the values given I_STEP = 2).
i am able to populate the E_T_RANGE table but the output is sending a single value output.
Expected Output
Plant ( sel screen Input) I Material ( Sel screen Input) I Demand Var(calculated O/P)
1800 I 12345 I 0.609
1700 I 21355 I 1.234
Actual Result
Plant ( sel screen Input) I Material ( Sel screen Input) I Demand Var(calculated O/P)
1800 I 12345 I 0.609
1700 I 21355 I 0.609(WRONG )
Here you can see that its sending the same values for all the plant and material combination.
I found in debugging that it populates 2 values into E_T_RANGE table in loop. But it is giving out only one value to all.
I tried to refresh and clear that but its giving the same output. Can we use E_T_RANGE in loop to give out range of values?. how to out put this throught user exit?
did anyone face this kind of issue and solved it?. Help is needed urgently. any help or guidance is greatly appreciated.
Regards
satish.
Hi Oliver,
Thanks for the reply. Dont get confused here please. It was an example . For example
I give one plant as input and 2 materials as input .
You see the sample code :
WHEN 'ZPRDEMVA'. ( formula variable name)
IF i_step = 2.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZPRPLTSV'. ( plant variable input)
CLEAR L_S_RANGE.
v_werks = LOC_VAR_RANGE-LOW.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZPRMATSV'.
CLEAR L_S_RANGE.
v_matnr = LOC_VAR_RANGE-LOW.
CALCULATES THE FORMULA VARIABLE (DEMAND VARIABILITY)
WE TAKE DATA FROM ANOTHER ODS AND DOES CALCULATION.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = sum2.
DOES ALL CALCULATIONS PERFECTLY AND SINCE THERE ARE 2 MATERIALS AS INPUT, PUTS 2 VALUES IN E_T_RANGE. BUT IN THE OUPUT IT DUPLICATES SAME VALUE TO 2 RECORDS AS I POSTED IN THE FIRST
Append l_s_range to E_T_RANGE.
ENDLOOP.
ENDLOOP.
ENDIF.
Similar Messages
-
Node variable in query - Processing type customer exit?
We are on NW 2004S. I created a hierarchy for an info-object along with several nodes and child nodes.
I also created a node variable in a query for this info-object. I have the following questions with regards to using node variables in a query.
1) Can I use a node variable with processing type 'Customer Exit". My objective is to set the value of the node variable in the user exit.
2) If answer to first question is "Yes", how would I code the node value in the user-exit - Example code or some pointers to that effect.
I really appreciate your thoughts on this issue.
Thanks,
SanjayHi Sanjay,
As far as I'm aware this hasn't changed in NW2004s, (in any case it still works), so:
1)Yes you can, no difference with other type variables.
2)In userexit EXIT_SAPLRRS0_001 (include ZXRSRU01).
There's different options depending on at which stage you want to change it:
http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm
If you do a forum search on above technical names I think you'll find plenty of coding samples, but if you want something more specific, I'd be happy to help you out.
Regards,
Pieter -
Can anyone explain with senairio for formula variables with replacement pa
can anyone explain with senairio for formula variables with replacement path?
See the below link
An Example for Replacement path
http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
Document Count using Replacement path
I've explained the steps in this thread.
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
Formula Variable.
http://help.sap.com/saphelp_nw04/helpdata/en/ca/5f9ac61a205a459d0e7ef313d10321/content.htm
Regs
Gopi
Assign points if it helps -
Charateristic variable with Processing type "replacement path"
Hi all
I am using BI 7.0;
I have a characteristic ZPL_CNT in one dimensions of a Cube;
now i want to use the value of the ZPL_CNT as column in Query.
So i created a formula and a formula variable with replacement path of processing type:
setting:
i created a new formula "Calculated MBZ"
the formula variables is "ZMBZ" and inserted the variables into "Calculated MBZ"
Reference characteristic: ZPL_CNT
Processing type : Replacement path
Replace variable with: Attribute value
Attribute: characteristic Reference (constant 1)
But i find the value in Query incorrect
Can anyone help me solve this problem?
Thanks!Hi Dragon,
Can you not drag and drop this characteristic directly in the columns...have I misunderstood something?
I think when you use replacement path in the formula variable , the fromula variable tries to find the reference characteristic value at each record level in the report and then replaces it with attribute value as defined and may be in your case as the characteristice is not defined in the row , it has problems to identify which value of the characteristic it has to replace.
Regards,
Sunmit. -
Hi Gurus,
is it possible to get a drop down box for a ready for input formula variable in the BEx Analyzer (not BEx Web!)?
We want to let the users choose scaling factors 1, 1000 or 1000000 (implemented via this formula variable). In the settings of the formula variable you can only choose a default value but there seems to be no option to provide all three factors in a drop down box like the ones for characteristic value variables.
We could prevent other entries in the variable pop up via customer exit (i_step 3) but the business is wishing an F4 input help like the ones for characteristic values.
Thanks for your help,
MarcoHi Macro,
Its not possible to get drop down box for a ready for input formula variable. Because it is possible only for characterstic value variables but not formula variable.u donnot get any drop down box like ready for input for formula variable.
Regards,
Premalatha.C -
Oninput processing Code help for four variables
Hi,
I am new to BSP. I am trying to write the code for this requirement but always getting error.
In the layout , I have four input boxes say input1,input2,input3,input4.
User can enter anyone or all or some of them and click OK.
so oninputprocessing, I want to check if any one of this is not empty then a select statement on a table should execute.
if the select statement fetches records then it should go to next page.Otherwise it should through exception.
thank you.
chittidiHi,
First define the input fields in layout and in oninputprocessing validate the fields and with the help of flags we can display the messages in same page.
For displaying messages in detail [Validation|https://wiki.sdn.sap.com/wiki/x/CIHvB ]
Here is the sample code in oninputprocessing :
Case w_eventid.
when '<button-name>'.
call method cl_htmlb_manager=>get_data
exporting
request = runtime->server->request
name
='inputfield'
id = '<idname>'
receiving
data = w_object.
w_inputfield ?= w_object.
w_in_value = w_inputfield->value.
w_prid = w_in_value.
clear: w_object,w_in_field,w_in_value.
if w_input1 is initial.
fl_flag = 1.
endif.
call method cl_htmlb_manager=>get_data
exporting
request = runtime->server->request
name
='inputfield'
id = '<idname>'
receiving
data = w_object.
w_inputfield ?= w_object.
w_in_value = w_inputfield->value.
w_prname = w_in_value.
clear: w_object,w_in_field,w_in_value.
if w_input2 is initial.
fl_flag = 2.
endif.
call method cl_htmlb_manager=>get_data
exporting
request = runtime->server->request
name
='inputfield'
id = 'clntname'
receiving
data = w_object.
w_inputfield ?= w_object.
w_in_value = w_inputfield->value.
w_clntname = w_in_value.
clear: w_object,w_in_field,w_in_value.
if w_input3 is initial.
fl_flag = 3.
endif.
call method cl_htmlb_manager=>get_data
exporting
request = runtime->server->request
name
='inputfield'
id = '<idname>'
receiving
data = w_object.
w_inputfield ?= w_object.
w_in_value = w_inputfield->value.
w_person = w_in_value.
clear: w_object,w_in_field,w_in_value.
if w_input4 is initial.
fl_flag = 4.
endif.
<Select statement>
Endcase.
For flags write the following code in layout tab:
<%
if fl_flag eq 1.
%>
<center>
<br><font style="font-size:11px" face="Verdana" color ="#FF0000">"All Fields are Mandatory"</b></center>
<% endif.%>
Hope this solves the issue.
Regards,
Rajani. -
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 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 -
How to display text variable of type customer exit
Hi to all,
I have created a query in query designer which display sales value according to plant.
There i have also used a variable which will take input from user and restricted on 0CALDAY.
I have also created 2 text variable to display the text for sales based on input in variable.
I need when user enter the 01.02.2010 - 31.12.2010 value in variable , text variable should display SALES FROM 01.02.2010 TO 31.12.2010
i knew how to do that by using text variable of processing type customer exit.
But display of text variable is like SALES FROM 01022010 TO 31122010 ,
But i need that SALES 01.02.2010 TO 31.12.2010
i shall be thankfull to you for this.
Regards
Pavneet Rana
Edited by: pavneet rana on Dec 22, 2010 7:46 AM
Edited by: pavneet rana on Dec 22, 2010 8:03 AMHi,
Give Description on Sales Amount as SALES FROM &ZVAR_YEAR1& TO &ZVAR_YEAR2&.
ZVAR_YEAR1 & ZVAR_YEAR2 are the two text variables. These two variables should NOT be input enabled.
In the Exit - under I_STEP = 2, write the below code.
WHEN 'ZVAR_YEAR1'.
DATA: l_s_range TYPE rs_s_range,
loc_var_range TYPE rrs0_s_var_range.
READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZVAR_INPUT_CALDAY'.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = loc_var_range-low.
APPEND l_s_range to e_t_range.
WHEN 'ZVAR_YEAR2'.
DATA: l_s_range TYPE rs_s_range,
loc_var_range TYPE rrs0_s_var_range.
READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZVAR_INPUT_CALDAY'.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = loc_var_range-high.
APPEND l_s_range to e_t_range. -
Formula variable type customer exit
Hi all,
Can you explain me how link variable formula processing type customer exit to an infoobject?
Can you give an example of the exit?
Thanks
GianmarcoHi Gianmarco,
Here's an example of some CMOD code that converts yesterday's date to the factory date - in this case it refers to Factory Calendar Z1. You'll have to create a formula variable (in this case the technical name of the formula variable is ZVFCYEST) to call the code. I'm not much of an ABAPer so it might not be the most efficient code in the world, but at least it works.....
WHEN 'ZVFCYEST'.
IF i_step = 1. " BEFORE THE POPUP
z_today = sy-datum.
z_yesterday = z_today - 1.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
correct_option = '-'
date = z_yesterday
factory_calendar_id = 'Z1'
IMPORTING
factorydate = z_yestfact.
CLEAR l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = z_yestfact.
APPEND l_s_range TO e_t_range.
ENDIF.
Hope this helps,
Janet -
User input formula variable with greater than/less than operators for KFG
Hello all,
I have used a formula in my query that is a difference of two key figures .For e.g:
Difference = tax from system A - tax from system B.
Now when the users run the report they should be prompted for the 'Difference' threshold for seeing the report say where difference is greater 100 or equal to 10 and so on.Currrently I have created a formula variable with 'user input' and created a 'condition' to display 'Difference' greater than the user entered value.
However,it is required to have various selection options for setting the threshold of difference.For e.g User should be able to set say 'equal to'/'greater than/less than/not equal to operator for 'difference' in the initial selection screen of the report.
With the current user-input formula variable I am not getting these 'greater than' etc operators.Any ideas on how to achieve this?Ya know, that's all well and good ... BUT ... WHAT IF you do want to sort text type columns with Greater Than and Less Than operatiors??
SQL does it just Fine ... so WHY does APEX have the limit??? This is an Oracle BUG ... it SHOULD NOT limit the operators ... I realize "they" may be trying to be helpful with proper constraints to field searches ... but ... if SQL can do it, then ... no need for a limit.
EG ...
Show the records where
the "Begin_Year-Wk" data is less than or equal to "2009-09" AND
the "End_Year-Wk" data is greater than or equal to "2009-04"
... to give everything that was running in that 5 week period whether or not it starts within that time frame
I can run this query perfectly fine via SQL ... but not in APEX ... unless I reconvert a lot of strings back to numbers, and for sorting / formatting / explain-to-user purposes, I really don't want them to be numbers.
So ... there's gotta be a hidden tweak for operators somewhere ... -
Formula date variable ,which is processing by 'Customer exit' with ready in
Hi ,
I need to create 1 variable which takes date from user and do some calculation.irrespective of any date char.
so I have created Formula date variable ,which is processing by 'Customer exit' with ready input .
But when selection screen pop up date formula variable comes with the format yyyymmdd.
but i need dd.mm.yyyy. i have checked my profile and it is dd.mm.yyyy.
Waitin for replyHi Babu
Did you get the answer to the query....if yes please drop me a mail on this as I have the same requirement and thanks in advance...
my id [email protected]
REgards
Amit -
Realtime scenarios for text &formula variable with replacementpath
Please search the forums before posting
i want real time scenarios for Text & formula variable with replacement path separately & how to solve it
Edited by: Arun Varadarajan on Mar 15, 2009 7:26 PMHi Karen,
This require a text Variable with customer exit which reads the User entry formula variable and populate the coloum heading
Hope you got it
Regards
Happy Tony -
Default multiple values for formula variable on variable selection screen
Hi All,
Suppose 'A' is formula variable with customer exit as processing type then i want four default values for this variable eg: 3, 6,9, and 12 as selection options, when we will execute query user can able to pick any one of the default value.
is it possible in BEx for formula variables?
I also tried with ABAP code in 'cmod' t-code, but it is not working properly for 4 default values....but for single default value, code is working fine.
I am using following code ::
When 'ZCSIMCTB'. // variable name
IF i_step = '1'.
CLEAR : l_s_range.
l_s_range-low = 3.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
CLEAR : l_s_range.
l_s_range-low = 6.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
CLEAR : l_s_range.
l_s_range-low = 9.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
CLEAR : l_s_range.
l_s_range-low = 12.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDIF.
Thanks in advanceHi Sankar,
Thanks for reply...
With single quotes also its not working.......
Also as I am using Formula Variable so by default "Single Value" is coming on Variable Details....
Regards,
NIlesh -
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 .
Maybe you are looking for
-
Hi, I have just followed 2 training regarding BW (BW305/BW310). Before starting to implement a BW project, the first thing I wanted to do was to activate the Business Content and analyse the InfoObjects used to see if it's possible to get back some i
-
Hi SAP Gurus, Could you let me know how is it possible to export bw project in a html file. I went in metadata repository /extra /export BW. But we upload many files where link between each other doesn't work correctly. Can we optimize this extractio
-
Error running the Journal Report
Hi, We are getting the below errow whenever we try to run a Journal report in any other format that teh HFM_Format. Any clues why thsi coudl eb happening? Access is denied. Show Details: Error Reference Number: {CA2E2A91-02B6-4C2C-B20C-77A3E54F3F50};
-
100% page size ??
Hello, im new with Muse and for now i couln`t find what i was looking for and am lost. I`m using the CC 2014 version of muse and am working on a page that gets displayed wrong in the browser. the width of the page is 1000 and the height is 950. The
-
Hai every body, can any one tell what is Adobe Forms, why it is used,?
hi , can anyone tell what is adobe forms?when and why it is used ? Can i have step by step screen cams for adobe forms, please help me.