Using variable in fox formula containing several characteristics

Hi @all,
is it possible to use a variable in fox containing more than one characteristic? I need to have some additional information for a few 0SEM_POSITs but don't want to create an attribute.
I've created variable ZSCV25 containing characteristics 0SEM_POSIT and ZSCADVDEL but wasn't able to get any data by using VARI.
Anybody an idea? Thanks for your help.
Regards,
Thomas

<FONT FACE = "Tahoma", Font Color = "Blue">
Dear Thomas<br>
I don't think FOX Formula Variable can contain more than one characteristic value. <br><br>However I can suggest you to try one thing. Create an Exit Variable and in its ABAP Code refer to the master data table of base variable and retrieve the value of its desired attribute. <br><br>For example, let us assume that you have a characteristic 0COMP_CODE and 0COUNTRY is its attribute. Now you want that depending on the value of 0COMP_CODE selected by User in another variable ZCOMP_CODE , 0COUNTRY should be automatically populated in variable ZCOUNTRY. So in this case, please make ZCOUNTRY as an Exit Variable and write ABAP Code for that. In the ABAP Code, get the value of 0COMP_CODE which is entered by User in the other variable ZCOMP_CODE. Then write a select statement in ABAP and retrieve the value of 0COUNTRY from the master data table of 0COMP_CODE where Company Code value is equal to value of variable ZCOMP_CODE.<br>
I hope I am getting you and you are getting me :-)<br>
<br>Please let me know in case of any confusion.
<br><br>
Hope it helps.<br><br>
Cheers Abhijit<br>
</FONT><FONT FACE = "Verdana", Font Color = "Red">
Removed
</FONT>

Similar Messages

  • Variables in FOX formulas in IP

    Hi All!
    I would like to create FOX planning function that will be based on variables.
    So, we have 2 variables AA and BB based on characteristics:
    1. For 0CALMONTH with tech. name AA
    2. For ZPROJECT with tech, name BB
    I have a query, where at the first screen I make a selection for ready-for-input variables AA and BB. Then, at the second screen I execute planning function via button.
    The sense of PF is copy all values of key figure ZKEYFIGURE from ZPROJECT = '0', 0CALMONTH = selected value of variable AA to ZKEYFIGURE of ZPROJECT = selected value of variable BB, 0CALMONTH = selected value of variable AA.
    In master data of characteristic ZPROJECT we have different projects. but 1 is with technical name 0. This is the first master data in table.
    DATA VAR1 TYPE 0CALMONTH.
    DATA VAR2 TYPE ZPROJECT.
    DATA VAR3 TYPE ZPROJECT.
    VAR1= VARV(AA).
    VAR2 = VARV(BB).
    VAR3 = VARI(BB, 1).
    {ZKEYFIGURE, VAR1,VAR2}={ZKEYFIGURE,VAR1,VAR3}.
    After execution I see , that records were read, but 0 generated, 0 changed.
    Maybe someone can advice what I do wrong?

    Firstly,for 0calmonth,the from and to value is same as you are using the selected values of variable AA.
    So no change in the value of 0CALMONTH
    Secondly, in the fox formula,  for zproject, you are using the same variables. Hence the fox formula understands that there is no change in the value.
    Define two variables for zproject, lets say proj1 and proj2.
    Assign proj1 ='0'.
    I have modified your fox code, give a shot with the following code, hopefully you might get the results as you want.
    DATA VAR1 TYPE 0CALMONTH.
    DATA PROJ1 TYPE ZPROJECT.
    DATA PROJ2 TYPE ZPROJECT.
    VAR1= VARV(AA).
    PROJ1 = 0.
    FOR EACH 0CALMONTH IN VARIABLE VAR1.
    PROJ2 = VARI(BB,1).
    {ZKEYFIGURE, PROJ2}={ZKEYFIGURE,PROJ1}.
    Endfor.

  • Set global variable in FOX formula

    Hi all,
    Does anybody know how to change the value of a global variable inside a FOX formula?.
    I can get its value and assign to a local variable but I would like to set the global value after reading a keyfigure and make some calculations.
    is it possible? maybe with some ABAP function call?
    Thanks for your help!

    Include characteristic HIRE in your 'fields to be changed' of planning function and in FOX write:
    DATA L_HIRE TYPE HIRE.
    DATA EXISTBPSID TYPE ZTA_BPSID.
    DATA BPSIDNO TYPE ZTA_BPSID.
    BPSIDNO = VARV(BPSTAS2).
    FOREACH L_HIRE.
    IF EXISTBPSID = '#'.
    {L_HIRE,BPSIDNO} = {L_HIRE,EXISTBPSID}.
    BPSIDNO = BPSIDNO + 0000000001.
    ENDIF.
    ENDFOR.

  • Can I use Variable Offsets or Formula definition  for my problem?

    Hello,
    how can i get my BEx report to show me cash weeks 28 to 35 when i enter 27 as the variable selection? What i need are the next 8 weeks ahead of the week that i entered.
    Thanks,
    SD

    Hi Sebastian,
    Create a new selection in a structur in columns.
    In that selection, use characteristic 0CALWEEK and restrict it by single value, ready for input variable.
    When you restrict the characteristic 0calweek in the selection(right click and restrict), choose the option value range.
    Now in the left part of the window you would see 2 fields, for low and high vaue.Click on F4 help. Put in the same single value variable created before in both the low value and high value field.Now transfer your selection to the right side of the window.
    Then right click on the selection on the right side of the window and  choose set offset value.
    Put 1 in the first window and press ok and 8 in the second window and choose ok until u return to query designer.
    You can place the key figure structure below this structure.
    Hope this helps.
    Regards,
    Sunmit.

  • What is the use of  fox formula in integrated planning

    what is the use of  fox formula in integrated planning

    Hi,
    just as a follow up - the FOX Extension Formula capability of the IP in BW is as others have mentioned - to help develop formulas to execute calculations during planning, forecasting, budgeting, etc. - it allows consultants, like myself, to develop these formulas without the help of an ABAP consultant - but creates ABAP programs behind the scenes.
    You can also use these ABAP programs separate from the IP component - once you create a FOX formula you can retrieve the ABAP program and then use it for other activities.
    With the FOX you can use variables in a formula, call another ABAP program, generate loops of data both master and transactional, allows IF, THEN statements, and a number of other activiities. There is a limit to the usefulness of the FOX formula process - you may find if the FOX formula is too complex or long that your process will run slowly during the calculations. If this is occurring you will need to debug your ABAP program to see if you can increaase the performance.
    Thanks and hope this helps, Pete

  • Fox Formula Variable In Query Designer

    Hi Experts,
    I have created 1 variable in fox formula of type VARV and i want this Variable to show in query designer while creating new Variable so that i can replace the Query Variable With Fox Formula by Using Replacement Path.
    While Creating new variable in Query Designer it is not Showing that Fox Formula variable.
    Because i want to use this in WAD While Executing the Planning Sequence.
    Is there any way we could get That Fox Formula variable in Query Designer.
    Regards
    Girish

    Hi Marc,
    While Creating Variable from Query Using Query Properties it is still not Showing That Variable in Fox Formula.
    And My Requirement was to Replace that Fox Formula Variable With Query Designer Variable.
    Please Suggest any Solution.
    Thanks
    Girish

  • Variable used in FOx formula should get value from user

    Hi Gurus,
    In my fox formula I want to multiply a keyfigure (say quantity) with a factor. For example if the factor is 10 then all records should get multiplied by 10.
    But the requirement is user shpuld be able to give the factor that should be multiplied. That is the l_factor used in the fox function should be a variable which gets value from user. I know we can give variables in filter and planning functions in IP. But can we give values in Fox formula.
    I would really appreciate the time and effort.
    Thanking you,
    Jerry Jerome

    Hello,
    May be you can try this solution.
    I think you have create a dummy character info-object(Z_Number) of same data type interget number.Create variable for Z_Number and restrict in filter(ZV_NUM).
    DATA Z_MAT TYPE 0Material.
    DATA Z_NUM TYPE Z_NUMBER.
    DATA Z_NUM_READ TYPE I.(Declate same as data type for Z_Number)
    Z_NUM = VARV(ZV_NUM).
    FORACH Z_MAT.
    Z_NUM_READ = Z_NUM.
    {Z_KF1,Z_MAT} = Z_NUM_READ * {Z_KF1,Z_MAT}.
    ENDFOR.

  • Using BPS numberic variables in the FOX formula???

    Hi all,
    Can someone tell me how to use one variable (<b>the variable type is 'numberic'</b>) in the FOX formula? Thank you.
    FOX formula example:
    <b>Inventory $= inventory unit * inventory (per unit) * depreciation monthS (<u>this is a numberic variable</u>.</b>
    J.

    Hi John,
       You can use the VARV function to get the value of the numeric variable in FOX.
       Lets say your variable for depreciation months is ZDEPMTS.In your FOX, you
       can say: Inventory $= inventory unit * inventory (per unit) * VARV(ZDEPMTS).
       Hope this helps.
    Cheers
    Srini

  • Fox formula - Copy variable value to a characteristic in IP

    Hi All,
    I have to copy the value of a variable to a characteristic in Fox formula in IP. In this scenario I am forecasting data using copy function. Whenever new data is copied I need to save it as a new version. So in the fox formula I have mentioned only 'version' as the field to be changed. I get the value of version automatically from a function module. In BPS I think it is possible but I am using IP.
    Example.
    Copied data
    Customer Material Version Year Qty
    c1            m1          0           2012  10
    c2            m2          0           2012  20
    c3            m3          0           2012   15
    This is the reference data got as a result of copy function. In the code I get the version computed from a function module in variable fm_version.
    I wrote the logic like this.
    data lv_version type version.
    foreach lv_version.
    {0quant_b, lv_version} = {0quant_b, fm_version}
    endfor.
    When it is execute it is showing error as records changed and deleted.
    Is it the correct method or is there any other workaround.
    I would realyt appreciate your time and effort.
    Thanking you,
    Jerry Jerome

    Hello,
    You can use either standard copy function or fox formula.
    So here I need to make the version as 1 since it is forecasted for the first time. I am trying to do it with a fox formula. In the fox formula I am trying to change the characteristic value of version from 0 to 1.
    You can not change the characteristic value of version from 0 to 1. The copy function or fox formula will copy the key figures from version 0 to 1.
    For example:
    The transaction data contains data like -
    customer     material            year     version    qty
    c1                 m1            2012     0           10
    c2                 m2            2012     0            5
    After copy you will get both version like this
    customer     material            year     version    qty
    c1                 m1            2012        0        10
    c2                 m2            2012        0         5
    c1                 m1            2012        1        10
    c2                 m2            2012        1         5
    Thanks.
    With regards,
    Anand Kumar

  • How to realize special scenario with FOX formula - FOREACH, variables

    Hello,
    we want to use the integrated planning for the following thing within the portal:
    A salesman should add manual values (planned turnover) for his top 10 customers. The rest of his yearly budget should be distributed automatically and equally to the rest of his customers.
    I thought a lot about it and arrived at the conclusion that:
    - we have somehow to put the salesman number into a variable maybe also the year for which the planning should be done -- Which possibilities are given to do this?
    - We need an additional flag that tells if this customer has to be planned / was planned manually.
    After the manual planning a planning function (FOX formula) has to be executed in order to
    1. get the budget that was already planned manually
        use of FOREACH in combination with an IF clause
        -- Which kind of FOREACH do I have to use?
    2. calculated total budget - manual planned budget = budget that has to be distributed
        after FOREACH
    3. count on how many customers the distribution has to be done and calculate the
        turnover per customer (rest budget / counted customers)
        use of another FOREACH loop which counts every value that hasn't got the flag set
    4. distribute the remaining budget on the customers that weren't planned manually
        -- Can it be done with something like turnover=value that should be assigned ?
    Maybe it's simple to realize this scenario but I'm a absolute "newbie" on that theme.
    Thanks
    Bettina

    Hi,
    I have been following this thread for quite long, here's my take on this
    1. Please create all the master data like sales man, customers in BI. for the key customers  add an attribute to key customer which can be a single character field.
    2. Add Sales man as an attribute to customer master and maintain values for each customer.
    3. Create an exit variable for customer number, this should read value from the sales man variable and populate all the key customers.
    4. Create an agg level with the above 2 and the required time characteristic. There will be 3 variables on the input ready query a. sales man number b. key customer exit variable c. some time period variable.
    5. Create a planning function of type generate combination for the agg level created in the above step. Add this function to the work book or the web template.
    6. Now salesman will be able to go in and create his budget for the key customers.
    Annual budget entry
    1. Create an agg level without customer, add salesman and time characteristics.
    2. create a query which will allow to enter data (yearly budget) for the salesman.
    Allocation to non key customers
    1. Create an agg level that should create the missing combinations sales man and non key customers. If designed properly the first agg level can also be used for this function.
    2. Create a fox function which with foreach loop for customer and sales man if the amount is 0 add 1 to counter, also read the value wtih customer as blank (yearly budget), lastly if the amount is not blank sum up the amount. This will help in getting the balance amount.
    3. get balance figure as total - allocated. One more foreach loop same as above if the amount is blank then amount = balance / counter.
    Tried to answer
    thanks

  • Query - Filter several characteristics by one variable

    Hi Experts,
    I'm facing the following situation in my current project:
    I have several characteristics named Formula ID for each cost component in the cube.
    Formula ID - Base Price
    Formula ID - Additives
    Formula ID - Differential
    Formula ID - Transportation
    Etc
    I need to create a single variable that is going to appear in the selection screen, where the user will be able to type a value. Then the query will search this value in all the characteristics below during query runtime.
    I was thinking in formula variable. Is it applicable in this case? If so, do I need to use customer exit together?
    Is there any other way to do it?
    Thanks!!!
    Helder

    I am not sure if formula variable would help coz. therein again, u can give only one ref characteristic.
    You can do this with customer exit provided the data type is same for all the char.
    Create restriction for one of the chars as you would do normally (create a variable. processing type - manual input. eg. for base_price)
    For the other char, create a variables of processing type customer exit (ready for input should not be checked); and write the below code for each of them.
    READ TABLE i_t_var_range WITH KEY iobjnm = 'BASE_PRICE' INTO l_s_var_range_dt.
        IF I_STEP = 2.
          l_s_range-low          = l_s_var_range_dt-low.
          l_s_range-high          = l_s_var_range_dt-high.
          l_s_range-sign          = l_s_var_range_dt-sign.
          l_s_range-option          = l_s_var_range_dt-option.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    In the above code, ZV_ADDITIVES is the customer exit variable for 'additives'.
    Write similar code for the other 2 char.
    When the query executes, only the variable for base_price would be prompted. the other variables would take the value from the base_price variable.
    Hope this helps!
    ~ Arun KK

  • How to change the variable value in fox formula?

    Hi All,
        Please help me achieve this scenario,
             in the variable selection screen , i wil give some i/p like, calyear(0calyear) = 2008.
          In planing function using FOX formula, i must be able change the variable value to 2009.
      Will it be possible to achieve this, can we change a variable value using FOX formula, if possible
    please let me knw how to achieve this.
    Thanks n Regards,
    Priya.

    Hi Priyadarshini,
    i dont know what is your requirement exactly.If you can give a better explanation of ur requirement we can help you. But to answer your question yes we can get new values for the variable in the planning function.
    for this you need to couple the planning function together with the planning filter in a planning sequence. This planning filter should have the variable that you wanted to change. In the WAD when you want to call this planning sequence there is an option to call variable screen. If you enable this, it will pop up the variable screen to get this value again.
    Guess this was helpful.
    Regards.
    Shafi.

  • How using ABAP function in fox formula ?

    Hello,
    I want to launch standard function :"RSW_CURRENCY_TRANSLATION" by Fox formula. I declare this function in SAP Table :rsplf_fdir, and I can call this function by fox, with all parameters.
    But when I want to use it, I've a problem with the first parameter : "Formula error: Type RSR_CTTNM is not permitted"
    What's the solution ?
    Best regards,

    Hi Cyril,
    I read the fact that you have chosen to use CURC instead of the Function Module.
    Did you fix your exchange rate type in your CURC formula: For example:
    CURC (LCAMT,12312008,EURP,LCUR,GCUR).
    Or did you make into a variable, that can be chosen at run time?
    I'm asking because I'm trying to make the 'exchange rate type' in this formula to be more dynamic (like a local variable).For example:
    DATA EXRATE TYPE 0RTYPE.
    DATA EXRATE_V TYPE 0RTYPE.
    EXRATE_V = VARV(EXCHRATE).
    {0AMOUNT,GCUR, GCTYPE,FYPERIOD,VERSION,COSTELM,INT_ORDER} = CURC (LCAMT,12312008,EXRATE_V,LCUR,GCUR).
    But the system returns the error meesage that it doesn't recognise 'EXRATE_V' even though i have declared it earlier on. So I have a fear that the system is expecting me to enter a fixed exchnage rate type that exists in RSCUR, in this formula..!!  Is that true??
    I don't want it to be fixed in the formula, it should be chosen at time of planning. How do you have yours right now? Do you know why I get this error message, and what I need to do to in the FOX formula, to make sure it can be populated at run time?
    Thanks for your help and information in advance.

  • Ignoring characteristics in a BPS FOX formula

    Hello,
    I have a multiplanning area consisting of two planning areas. In the first one there are yearly data. In the second one there are monthly data. I have a FOX formula distributing the yearly data by a set of periodization keys into the planning area with monthly data.
    Now we have introduced a new characteristic "Resource class" in the planning area with yearly data. It has not been added to the planning area with monthly data, as it is not relevant there.
    My original assumption was that the FOX formula didn't have to be modified as "Resource class" should not be taken into consideration during the periodization. This proved to be wrong. It seems only data with no resource class are periodized. So it seems the system keeps the values of all characteristics not in the "Fields to be changed" and ignores the data if a characterstic value can't be stored in the destination planning area because the characteristic doesn't exist in that planning area. Even if the characteristic is not in the planning level.
    I want data to be periodized regardless of resource class. One way to do it is to loop over all resource classes and then periodize the total value. The FOX formula is however already quite complicated. Is there a simpler way to make the system completely ignore the resource class and run the existing FOX formula with values aggregated on resource class?
    Best regards,
    Christoffer Owe

    If you are using a distribution function for distributing the yeraly data to monthly data then  try unchecking the 'resource class' characteristic in the 'to be changed fields'.

  • Using offset for global variables in FOX

    Dear all,
    I'm using global variables (i.e. defined in planning area)in my FOX formulas by using VARV-command.
    I'm doing this for fiscal year, which has default value current year. However I'd like to use this variable also for next year thus creating the following code:
    DATA CURYEAR TYPE 0FISCYEAR.
    DATA NEXTYEAR TYPE 0FISCYEAR.
    CURYEAR = VARV(Z021VA01).
    NEXTYEAR = CURYEAR+1.
    This gives a syntax error. Anabody any idea how I can use offset in the FOX for my variables?
    Thanks in advance!
    Kind regards, Harjan

    Harjan,
    Use TMVL function to get the offsets.
    DATA CURYEAR TYPE 0FISCYEAR.
    DATA NEXTYEAR TYPE 0FISCYEAR.
    CURYEAR = VARV(Z021VA01).
    NEXTYEAR = TMVL(CURYEAR, +1).
    hope it helps.

Maybe you are looking for