Definition of Reference Data in complex Fox Formulas

Hello IP Experts / Gurus / Developers,
As far as I know there is no real concept behind the determination of Reference Data in Integrated Planning, when you do run functions from a sequence and not directly on a Dataprovider (where you have the possiblity to define editable and not editable structure elements).
The reference data is generated at runtime of the FOX Code. Using Complex FOX Code with a nested loop, the reference data in the planning buffer (seen in Planning Modeller) isnt really the data that it should be. Some read statements (in loops, but also outside the loops) are not recognized and obviously do not lead to the definition of Reference Data. This is not a specific problem of my function or architecture. It doesnt occur, when I reduce the complexity of the FOX Code to a few rows.
The question that I have is: Is there any possibility to define reference data in a fox statement or before running it?
Function modules, hidden statements etc. ?
Maybe a trick with running a loop like the one below (doesnt work, it also leads to immense performance issues)
FOREACH YEAR, CCODE IN SELECTION.
   VALUE = {0amount, YEAR, CCODE).
   EXIT.
ENDFOR.
Thanks in advance for sharing your experience.
Michael

A: Definition of Reference Data in complex Fox Formulas

Hi Michael,
   I don't think I understand from your post what is the issue that you are trying to solve; but it would not be correct to say that there is 'no real concept' behind determination of reference data.
Reference data is the data a planning function needs to read, which is outside the selection of the filter under which the function is currently running. So for the same function, reference data can change when running under different filters. Reference data can only be read, not modified - I am sure that is already clear. And also, the selection corresponding to reference data is not locked by planning.
Whenever you put any selection (inside the curly braces - {}) on the right hand side of the equal sign (talking about Fox), and if this selection is not contained in the filter, this data will be read as reference data. Also, statement like FOREACH in REFDATA will read reference data. Regarding the amount of data that is read (and hence the performance impact), it depends on factors like master data (for eg, in the Foreach statement in your code, it must be slow becuase of the huge master data that CCODE might be having), and number of records in cube, that are being read. You cannot really "define" reference data using code - it will be determined at run-time.
Hope this helps.

Hi Michael,
   I don't think I understand from your post what is the issue that you are trying to solve; but it would not be correct to say that there is 'no real concept' behind determination of reference data.
Reference data is the data a planning function needs to read, which is outside the selection of the filter under which the function is currently running. So for the same function, reference data can change when running under different filters. Reference data can only be read, not modified - I am sure that is already clear. And also, the selection corresponding to reference data is not locked by planning.
Whenever you put any selection (inside the curly braces - {}) on the right hand side of the equal sign (talking about Fox), and if this selection is not contained in the filter, this data will be read as reference data. Also, statement like FOREACH in REFDATA will read reference data. Regarding the amount of data that is read (and hence the performance impact), it depends on factors like master data (for eg, in the Foreach statement in your code, it must be slow becuase of the huge master data that CCODE might be having), and number of records in cube, that are being read. You cannot really "define" reference data using code - it will be determined at run-time.
Hope this helps.

Similar Messages

  • ACCESS CURRENT DATE in IP - FOX formula

    Dear Experts,
                    I need to pass current date as the parameter in the ATRT function but I do not have access to any infoobject of type date. If I try to access the value of a variable defined by SAP like 0dat I couldn't save the formula. Please help.
    DATA ZPM_TODAY TYPE  D.
    ZPM_TODAY  = VARV( 0DAT ).
    The CHECK function results ok but SAVE fails and there is dump in st22 on CX_RSR_COB_PRO_NOT_FOUND . Please suggest.

    I defined a function module in ABAP to return the current date when invoked then. You may try "varv" and define a variable with replacement path pointing to any pre-defined variable that gives you the current-date. Hope it helps
    Suresh Reddy

  • BPS: Create records from reference data in FOX

    As writed in "How to Loop over Reference Data in Fox Formulas", I create FOX Function with DO statements, but unfortunetely if I have no data yet in the subset my fox formulas can't be executed at all.
    It's write "0 data records were read, 0 of them were changed, 0 generated". Even if I put Break-point in fox formula, it doesn't take place. When I input somehow one or so "test" record, it works perfect, and creates new lines from reference as I want.
    How can I execute fox formula at list one time with empty subset?

    Hello,
    use a copy function to create one (dummy) record. Then call your FOX function (and delete the dummy record). You can combine them in a sequence.
    Also see SAP Note <a href="http://service.sap.com/sap/support/notes/646618">646618</a> for looping over reference data.
    Regards,
    Marc
    SAP Techology RIG

  • Fox formula for actual/plan data  - Planning function

    Hello,
    I am working on the following scenarios for developing a  planning functions for a monthly forecast.
    It is rolling montly forcast where user starts the planning in Jan and he has to show the actaul value for the month of Jan and blank values for the remaining 11 months of the year and then the user post his new forecast values for the remain 11 of the year(to replace initial balnk values) so that the data will be saved to real time cube with version v108
    In Feb, Jan & Feb months has to show the act values and remaining 10 months has to show last month forecast data. The the user may revise the forecast for the 10 months and then we have to write the data to the real time cube with version v208
    In Mar, Jan, Feb and Mar has to show the actual values and the reamining 9 months has to show the last month forecast and then users may revise the forecast data and then i have to write back to the cube with version v308.
    I want to automate this process for all the months and all years without manual intervention. So, i decideed to write a fox formula for this scenario with following draft code.
    I will get the fy period & year as a variable values and then take the system date into the variable
    for each fy period
    if the fy perio <= sys date.
      {version, infoprovider,value type,amount} = {0,act cube, 10, 0amount)
    else
    {version, infoprovider,value type,amount} = {result,plan cube, 20, 0amount)
    endif.
    result will be calculated on the separe routine and populated here
    case (fy per)
    when 01.
    concatenate v1 with fy+2(2) into y
    result = v1+y
    when 02.
    concatenate v2 with fy+2(2) into y
    result = v2+y
    when 03.
    concatenate v3 with fy+2(2) into y
    result = v3+y
    when 04.
    concatenate v4 with fy+2(2) into y
    result = v4+y
    when 05.
    concatenate v5 with fy+2(2) into y
    result = v5+y
    when 06.
    concatenate v6 with fy+2(2) into y
    result = v6+y
    when 07.
    concatenate v7 with fy+2(2) into y
    result = v7+y
    etc...for all months
    So, can you please let me know the best way to implement this (either by fox formuls or exits)...your inputs are really appreciated
    Thanks,
    Srini
    Edited by: srini on Mar 28, 2008 12:05 PM

    Hi Srini,
    If I 've understood u r problem clearly ,You have to write two Fox Functions and you can call exit variable in both to check the system date.
    I think first you should create exit varriable which would return the system date,use the same variable in data slice to lock the data till current period.
    After that create one fox restricted with any one version where you can copy the data for planning .for example:-
    1)First Fox:-
    DATA TIM_FISCPER TYPE 0FISCPER.
    TIM_REF_FISCPER = VARV(ZEXIT_FPER).
    Get the last month
    version using modlue or any another logic .(v108)
    FOREACH TIM_FISCPER.
        IF TIM_FISCPER <= TIM_REF_FISCPER.
      {0amount,version(001) ,tim_fiscper} = {0amount,version(000) ,tim_fiscper}.
    else.
      {0amount,version(001) ,tim_fiscper} = {0amount,version(v108) ,tim_fiscper}.
         endfor.
    Its just n example use the granularity according to the requirement.
    2)Second fox would save the changed plan data:-
    DATA TIM_FISCPER TYPE 0FISCPER.
    TIM_REF_FISCPER = VARV(ZEXIT_FPER).
    Get the last month
    version using modlue or any another logic .(v208)
    FOREACH TIM_FISCPER.
        IF TIM_FISCPER > TIM_REF_FISCPER.
      {0amount,version(v208) ,tim_fiscper} = {0amount,version(001) ,tim_fiscper}.
         endfor.
    Here ZEXIT_FPER is an exit variable created using cmod and populated with system date.
    Hope it will helpful for u.
    Rgds,
    Indu

  • Data package selection vs fox formula

    Hi,
    I have a selection of data by variables in a layout. in the  variable 1 (from char V1)I placed 2 values ( multiples values). In my fox formula I was excepting have all data which has this 2 values in the characteristic V1.
    But what i have is the data from one of this values.
    Is this behind the correct one?
    Or I have to do somthing more in my fox code, level or package?
    regards
    Victoria

    Thanks,
    I see, when I select the option "restriction of values required by user" with replacement type "user-defined values". The user only  can place in this variable one value or a range of values. When I clear the check box, the variable accept more than one value.
    I need this variable obligatory and it must accept multiple values.
    in other case, the user value and # value ( the # is obligatory - fixed) I need both. (In Bex this situation is posible)
    is there an option in order to obtain this?
    Regards
    Victoria
    Message was edited by: Victoria León

  • FOX forumla in IP: can I use Planing-functions in a FOX-formula ?

    Hi All,
    I know that there is a possibility to call an ABAP functions via a function modules within a FOX formula,
    but is it also possible to use a standard planning functions in a FOX formula ?
    I have some planing functions created like the copy-function, the delete-function or the repost-function.
    Now I would like to use the standard planing functions within a fox formula.
    If it´s possible, how do I call them within a FOX formula?
    Thanks a lot 

    Hi,
    You would be knowing that any planning function gets the data to operate on, based on the filter using which it is executed - it can give entirely different output in two cases if the filters are different. Thats why it does not mean much to call a planning function from inside another planning function - think about it, the situation will get messy if that was done. As I understand, you probably want to execute some standard functions after some part of your fox code and after that is executed, get back on with the code.
    For such a requirement, you can break your fox into multiple parts and then combine the parts and the std. pl. functions in a planning sequence in the order you need.
    But please also remember that depending on the complexity, many times it is advisable to create one fox (or exit) function rather than a sequence of many functions. Reason being that each function's execution in the sequence will include some overhead due to the planning framework (determining the transaction and reference data, lock server etc), so if you create just one function for the whole operation, this overhead will get significantly reduced.

  • Distribute data by reference data

    Hi,
    requirment as follow:
    1actual sale data cube (reference data)
    0plant 0article year/week acturalsalesdata
    D001     00010     2007/01     100.00
    D002     00010     2007/01     200.00
    D001     00010     2007/02     150.00
    D002     00010     2007/02     250.00
    2planned sales data cube  (data to be changed)
    0article year/week acturalsalesdata
    00010  2007/03     400.00
    I want to distribute the planned sales data in 2007/03 to each plant.
    In the distribution function I choose the field 'year/week' as 'fields for reference'
    then in the parameter group I can specify which week to be the reference week.
    But in the parameter group  I can only choose single value (2007/01  or 2007/02),
    How could I use both of these week as reference data?
    for example :
    0plant   0article year/week                    acturalsalesdata
    D001   00010   2007/01 and 2007/02    100.00 + 150.00
    D002   00010   2007/01 and 2007/02     200.00 + 250.00

    Hello
    Yes, distribution reference data needs to be restricted to a single value.
    Two ways I have done this before:
    1. Use a planning sequence where the first step is to copy your 2 weeks of reference data into a spare version and combine into a single period. Then use this as reference data for the dustribution function. A third step can be added if needed to delete the copied data in the spare version.
    2. You can generally get to the same thing using  FOX formula but can get complex. Whether the planning sequence or formula approach ends up being more efficient in execution time depends on the data, complexity of function etc...
    Chris

  • 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 implement this planning function using Fox formula

    Hello,
    I am new to Fox.
    I want to implement this complex logic in a planning function
    i have A (Kf X from infoprovider Z_A), B (Kf Y from infoprovider Z_B) & moreover there is one more condition,
    If current FISCPER > variable value of FISCPER
    KF Z = KF Z1 (from Cube C1)
    Else KF Z = KF Z2 (from Cube C2).
    for a particular calender week,
    X =   ( Y * Z ) / (summation of (Y * Z)  for each week of the whole year)
    I know it is complex.
    but i have to implement this in a planning function.
    The aggreagtion level is built on a multiprovider having A, B , C1 & C2.
    Can someone help me out with the FOX formula for this? or is there any better way to do this.
    Thanks john

    Hi Gerardo,
    Thanks for that.
    I have tried something similiar to it
    DATA CHA_CALWEEK TYPE 0CALWEEK.
    DATA CHA_COMP_CODE TYPE 0COMP_CODE.
    DATA CHA_FISCPER TYPE 0FISCPER.
    DATA VAR_PERIOD  TYPE 0FISCPER.
    DATA SUM_YEAR TYPE F.
    DATA TEMP_D TYPE F.
    DATA SUM_WEEK TYPE F.
    CURRENCY IS LOCAL CURRENCY. FOR DATA SELECTION TO BE RIGHT, NECESSARY TO DERIVE FROM CC.
    DATA UN_LOC_CURRCY TYPE 0LOC_CURRCY.
    UN_LOC_CURRCY = VARV(Z_U_I100).
    CHA_COMP_CODE = VARV(Z_U_I100).
    To Calculate the D
    VAR_PERIOD = VARV(Z_U_I010).
    SUM_YEAR = 0.
    TEMP_D =0.
    IF CHA_FISCPER > VAR_PERIOD.
    TEMP_D = {ZSA_BUD2X,CHA_COMP_CODE,CHA_FISCPER,YBUDG_01X,CHA_CALWEEK}.
    FOREACH CHA_CALWEEK.
    SUM_YEAR = SUM_YEAR + TEMP_D * {ZCREENTSV,CHA_COMP_CODE,CHA_FISCPER,ZIP_RREF1} .
    ENDFOR.
    ELSE.
    TEMP_D = ({ZSAEXCUSV,CHA_COMP_CODE,CHA_FISCPER,YRT_C02X} - {ZCREENTSV,CHA_COMP_CODE,CHA_FISCPER,YRT_C02X}).
    FOREACH CHA_CALWEEK.
    SUM_YEAR = SUM_YEAR + TEMP_D * {ZIP_INDEX,CHA_COMP_CODE,CHA_FISCPER,ZIP_RREF1}) .
    ENDFOR.
    ENDIF.
    But i am getting a syntax error
    Formula error: } expected
      Syntax error in row 21, column 20
    i have marke line21 in bold. above.
    I feel it is correct, still wonder why i am getting this error.
    can you pls help ?

  • How to access reference data in BPS Exit Function

    Hi Experts,
    Can any please tell me how to access reference data in BPS Exit function. I am creating a copy function using ABAP Exit Function (Std copy and fox formula doesn't work for my requirement).
    Please suggest,
    Thanks in advance,
    Shiwesh

    Hi Deepti,
    Thanks a lot for your reply. xth_data contains all the data based on package filteration. Let me explain you,
    Say, I have a characteristic char and whose value is 'A', I want to change it to 'B' in my copy function, while keeping the original record with 'A' as well. So now I want my xth_data to contain two records, one with A and other with 'B'. I mean to say from value is 'A' and to value is 'B'. Now my package contains 'B' (the to value) as the allowed value, but not A because in the package I am setting this using a BPS variable. There are two types of variables, one is to variables other is from variable. There could be two scenarios,
    1. If I set from varibale in the package: if I do so, I will have the data in xth_data containing 'A' as char value. But in this case when I change it to 'B' and try to save both the records, package won't recognize the record with value 'B' and reject it.
    2. If I set to variable in the package: In this case the xth_data itself will not contain anything and I can not loop over xth_data because there is no record with 'B'. Only record available in the system is with 'A' values.
    That is why I am thinking about having reference daya somewhere. I could loop over reference data and then pass it to xth_data. Package will contain to variable so it will allow all my modifications to get saved.
    Thanks and regards,
    Shiwesh

  • How to Write a FOX Formula in Intergrated Planning Functions?

    HI BI-IP Experts,
    I have just written a FOX formula to call an ABAP Function Module which will execute a Process CHain to run.
    Here is what I wrong in the FOX formula in the Planning Function ZPF_FOX_CALL_PC.
    Call Function Z_CALL_PROC_CHAIN
    = * 1.
    I had to add in this line otherwise the system do not allow me to save the FOX.
    In the Function Module Z_CALL_PROC_CHAIN, it contains the following codes:
        SUBMIT rsprocess
               WITH type    = 'CHAIN'
               WITH variant = 'Process chain name'
               AND RETURN.
    Next I created a workbook with a button that executes this Planning Function ZPF_FOX_CALL_PC.
    The button contains 3 lines:
    CMD => Execute Planning Function
    Planning Function Name => ZPF_FOX_CALL_PC
    CMD => SAVE_AREA.
    After I clicked on the button, my excel seems to be running and I waited for very long but nothing happens.
    And it seems to be running and running and won't stop.
    Is it because the program is running in a loop because I missed out some codes in the FOX?
    Thanks,
    Shunhui.

    hi,
    Since you have not given any condition, the fox formula is being executed for all the number of records...thats why you are seeing the loop.
    example if you have 10 records in your BPS template, the formula is getting executed 10 times for each
    you need to select the field for condition which will make 1 entry, so the function module gets executed just once..
    or.. in the function module when you trigger the process chain, make an entry in a database table... when the 2nd row starts, it will check the table... if the entry exists, it will skip the scheduling of process chain... so on..
    In the process chain.. at the end, delete the entry from the database..
    so your code in the function module should be like this ... assume you have 10 records..
    select * from table zlock  where process chain name = pc name  
    (this is to check if the process chain is already running, if yes skip, if no trigger the process chain)
    if sy-subrc eq = 0.
    exit
    else.
    DATA: number           TYPE tbtcjob-jobcount,
          name             TYPE tbtcjob-jobname VALUE 'JOB_TEST',
          print_parameters TYPE pri_params.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    (this will trigger the process chain in background)
    IF sy-subrc = 0.
      SUBMIT rsprocess
      WITH type = 'CHAIN'
      WITH variant = 'PC name'
      VIA JOB name NUMBER number
                        AND RETURN.
    (after the process chain started, make an entry in the lock table.. so it will not be executed again)
    insert entry in table zlock
    ENDif.
    endif.
    I understand this is complex, but I think its one solution I can think of.

  • 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

  • Unable to create new records with FOX formula (IP)

    Dear Guys,
    We created a FOX formula that could not create any records within an empty infocube (got 0 records read, 0 created, 0 changed, 0deleted). how to change this formula to make sure record are created?
    DATA K_0FISCPER3 TYPE 0FISCPER3.
    FOREACH K_0FISCPER3 IN SELECTION.
         { 0AMOUNT, K_0FISCPER3 } = 100.
    ENDFOR.
    Many thanks!
    Kind Regards
    Olivier DESFOUR

    Hello,
    this behaviour is explained in the docu.
    Internal Data Objects and Address
    The internal data objects that are edited are subsets of the transaction data contained in the planning package. The user executes a planning function by selecting a package and a parameter group. This package is divided into smaller data objects made up of transaction data. If a formula requires reference data, these data objects are also created from this reference data. Note: If it is not possible to create data objects, a formula is not executed.
    You will find this detailed docu, if you press F1 in the formula editor in transaction BPS0.
    For BI-IP this detailed docu will be part of one of the next docu shipments.
    The docu belongs to the data element UPC_Y_FLINE. Therefore you can access the docu from the transaction SE11. Choose data type = UPC_Y_FLINE. Press the button DISPLAY.
    Best regards
    Hans-Juergen Schwab

  • Multiplanning area FOX Formula

    Hi everyone,
    I’m trying to implement a Fox’s formula with multi-areas through integrated Planning, but the function does not bring any result,  it just says that has read 24 records, but it hasn’t modified nor created any record, when, in fact, are at least 4 thousand.
    The client request is that apply a correction factor over last year operation amounts. The correction factor is in a different Infocube than the others amounts.
    All the characteristics of the aggregation level are set as “characteristic to be changed”, which are all relevant fields of both infocubes, including the field "Infoprovider". Therefore when I want to reference a key figure I use them all, so, when one of the fields is not in the key figure’s Infoprovider, I declare  it (or set it) with the value "#", Is that procedure correct?.
    Ex. Characteristics in bold are not in the key figure's Infoprovider
    {Key Figure, 0COMP_CODE, 0COSTCENTER, 0COSTELMNT, 0CO_AREA, 0CURRENCY, 0FISCPER, 0FISCPER3, 0FISCVARNT, 0FISCYEAR, 0INFOPROV, 0PROFIT_CTR, 0VERSION, 0VTYPE, Z1AVERSIO, ZVAR_EC}
    Then, the string to reference this key figure is:
    { Z1AINDDVA, #, #, #, #, #, DAT_FYP1, DAT_FPER, VAR_FSCV, DAT_YBAS, ZBPS_VAR, #, VAR_VIPC, VAR_TVIE, VAR_IPCV , VAR_VREC}
    This is my FOX formula code:
    DATA CHA_CELM TYPE 0COSTELMNT.
    DATA CHA_CMCO TYPE 0COMP_CODE.
    DATA CHA_CECO TYPE 0COSTELMNT.
    DATA CHA_CURR TYPE 0CURRENCY.
    DATA CHA_COAR TYPE 0CO_AREA.
    DATA CHA_CEBE TYPE 0PROFIT_CTR.
    DATA DAT_YBAS TYPE 0FISCYEAR.
    DATA DAT_YDER TYPE 0FISCYEAR.
    DATA DAT_FPER TYPE 0FISCPER3.
    DATA DAT_FPR1 TYPE 0FISCPER3.
    DATA DAT_FYP1 TYPE 0FISCPER.
    DATA DAT_FYP2 TYPE 0FISCPER.
    DATA DAT_FYP3 TYPE 0FISCPER.
    DATA INF_PROV TYPE 0INFOPROV.
    DATA FLO_IPC TYPE F.
    DATA FLO_BASE TYPE F.
    DATA FLO_DERV TYPE F.
    DATA VAR_VDBA TYPE 0VERSION.
    DATA VAR_VDAA TYPE 0VERSION.
    DATA VAR_VIPC TYPE 0VERSION.
    DATA VAR_VREC TYPE ZVAR_EC.
    DATA VAR_AREF TYPE 0FISCYEAR.
    DATA VAR_MODI TYPE 0FISCYEAR.
    DATA VAR_TVDB TYPE 0VTYPE.
    DATA VAR_TVIE TYPE 0VTYPE.
    DATA VAR_TVDM TYPE 0VTYPE.
    DATA VAR_IPCV TYPE Z1AVERSIO.
    DATA VAR_FSCV TYPE 0FISCVARNT.
    DAT_YBAS = TMVL( VAR_AREF, 0, VAR_FSCV).
    DAT_YDER = TMVL( VAR_MODI, 0, VAR_FSCV).
    DAT_FPER = '012'.
    DAT_FYP1 = CONCAT ( DAT_YBAS, DAT_FPER).
    DAT_FYP2 = CONCAT ( DAT_YDER, DAT_FPER).
    FLO_IPC = 1.
    FLO_BASE = 0.
    FLO_DERV = 0.
    FLO_BASE = { Z1AINDDVA, #, #, #, #, #, DAT_FYP1, DAT_FPER, VAR_FSCV, DAT_YBAS, ZBPS_VAR, #, VAR_VIPC, VAR_TVIE, VAR_IPCV , VAR_VREC}.
    FLO_DERV = { Z1AINDDVA, #, #, #, #, #, DAT_FYP2, DAT_FPER, VAR_FSCV, DAT_YDER, ZBPS_VAR, #, VAR_VIPC, VAR_TVIE, VAR_IPCV, VAR_VREC}.
    IF FLO_BASE <> 0 AND FLO_DERV <> 0.
    FLO_IPC = 1 + ( FLO_BASE / FLO_DERV ).
    ENDIF.
    FOREACH CHA_CMCO, CHA_CECO, CHA_CELM, CHA_COAR, CHA_CURR.
    IF CHA_COAR = 1000.
    IF VAR_VREC = CL01.
    { 0AMOUNT, CHA_CMCO, CHA_CECO, CHA_CELM, CHA_COAR, CHA_CURR, DAT_FYP3, DAT_FPR1, VAR_FSCV, DAT_YDER, ZSEM_C18, CHA_CEBE, VAR_VDAA, VAR_TVDM, #, # } =
    { 0AMOUNT, CHA_CMCO, CHA_CECO, CHA_CELM, CHA_COAR, CHA_CURR, DAT_FYP3, DAT_FPR1, VAR_FSCV, DAT_YDER, ZSEM_C18, CHA_CEBE, VAR_VDAA, VAR_TVDM, #, # } * FLO_IPC.
    ELSE.
    { 0AMOUNT, CHA_CMCO, CHA_CECO, CHA_CELM, CHA_COAR, CHA_CURR, DAT_FYP3, DAT_FPR1, VAR_FSCV, DAT_YDER, ZSEM_C18, CHA_CEBE, VAR_VDAA, VAR_TVDM, #, # } =
    { 0AMOUNT, CHA_CMCO, CHA_CECO, CHA_CELM, CHA_COAR, CHA_CURR, DAT_FYP3, DAT_FPR1, VAR_FSCV, DAT_YDER, ZSEM_C18, CHA_CEBE, VAR_VDAA, VAR_TVDM, #, # } * 1.
    ENDIF.
    ELSEIF  CHA_COAR = 2000 OR CHACOAR = 3000.
    { 0AMOUNT, CHA_CMCO, CHA_CECO, CHA_CELM, CHA_COAR, CHA_CURR, DAT_FYP3, DAT_FPR1, VAR_FSCV, DAT_YDER, ZSEM_C18, CHA_CEBE, VAR_VDAA, VAR_TVDM, #, # } =
    { 0AMOUNT, CHA_CMCO, CHA_CECO, CHA_CELM, CHA_COAR, CHA_CURR, DAT_FYP3, DAT_FPR1, VAR_FSCV, DAT_YDER, ZSEM_C18, CHA_CEBE, VAR_VDAA, VAR_TVDM, #, # } * 1.
    ENDIF.
    ENDFOR.
    Finally, when I try to debug the formula,  it doesn’t bring any value to the correction factor and exits without continue executing the next part of the code in which it should apply the correction factor over the amounts.
    I have some question about this kind of FOX formula:
    1.- How I resolve this issue in order to get my correction factor to be applied over the amounts.
    2.- Is there a way to make a direct reference in order to read each Infoprovider?
    3.- When is right to use all of the fields in the aggregation level (as “characteristic to be changed”) and when is not?.
    4.- If I don't use all multiprovider’s fields in the aggregation level, the update is over all of the records and its combinations?
    I hope you can help me with this.
    Thanks in advance and best regards
    Inge Eichhorns

    Hi Inge,
    See my response below for your perusal.
    How can i make a direct reference in order to read each Infoprovider?
    **When you have a combination of InfoProviders...you need to advise the system to pick up the appropriate InfoProvider. Either you will make the selection a constant or will assign a variable. By selecting or identifying the InfoProvider your function will write to the appropriate Key Figure.**
    When is right to use all of the fields in the aggregation level (as “characteristic to be changed”) and when is not?
    **It depends on the requirement. Having said that...**
    **You will select all the characteristics in the cube when you are  planning to copy one year/one period data to other periods keeping all other characteristics as constant.**
    ***You will select characteristics based on the functionality that affects the changes on the InfoProvider.
    Hope I addressed your requirement.
    Should you have any further concerns please let me know.
    Regards
    Srinivas
    Thanks.

  • How to display my FOX formula result on the layout

    Hi Guru's,
    I have created one Fox Formula for OTB using the given below calculation
    Planned Open-To-Buy (Retail Price) = Sales / Retail Value +  Last Planned Stock (Retail Value) - Open Purchase Orders (Retail Value with Tax) - GR Posting Date / Vendor RtlT + Promotion Sales / Retail .
    When I am executing my Planning function (using BPS0) then it is working fine. It is showing the correct OTB value.
    I have insterted this FOX function into my layout using UPSPM tcode. When I execute the OTB calc function from UPSPM then correct data gets saved into my real-time cube. However OTB data is not getting displayed on my layout.
    Is there something else which I am supposed to do to display the result on the final layout ?
    Thanks,
    Ashu gupta.

    Hii Guys,
    Thanks a lot for your inputs. My issue has been resolved. I was not able to get the FOX formula output on the layout as the formula was not giving unique record. I have removed version char from my level and flds for selection. Now everything is working fine.
    Thanka again for your valuable time.

Maybe you are looking for