Use Formula variable in planning function

Hello,
I would like to use a formula variable in a planning function.
The problem is that when I execute this function all keyfigures values are set to 0 so the FOX is not executed.
The idea is to have something like
= VARV(FORMULAVARIABLE).
How could this be achieved using FOX ?
Or how using an exit function could I call this FORMULAVARIABLE which is not used in the query ?
Thanks,
Matthieu

Hello Matthieu,
Please search the forum before posting:
http://forums.sdn.sap.com/click.jspa?searchID=70350665&messageID=9814615
Regards,
Marc
SAP Techology RIG
PS: You closed the thread so I have to add some details here. The FOX runtime is hardcoded to 0RSPLS_FORMULA. Therefore, 0RSPLS_FORMULA cannot be copied to a custom planning function type as you suggest.
Edited by: Marc Bernard on Feb 23, 2011 3:36 PM

Similar Messages

  • 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.

  • Using value variables throw public functions

    He all!!
    I'm trying to use value variables throw public functions in
    the same class.
    Is there any possible to do it?
    I'll explain:
    What i whant is in tha FLA file to get the songName of the
    mp3 like trace(musica.nomeMusica);
    quote:
    //AS Code
    package Mp3Player{
    import flash.media.Sound;
    import flash.media.SoundLoaderContext;
    import flash.media.SoundChannel;
    import flash.media.ID3Info;
    import flash.net.URLRequest;
    import flash.events.Event;
    public class Mp3Player {
    private var sound:Sound;
    private var req:URLRequest;
    private var context:SoundLoaderContext;
    private var channel:SoundChannel;
    private var id3:ID3Info;
    private var nomeMusica:String;
    public function tocarMusica(file) {
    sound=new Sound ;
    req=new URLRequest(file);
    context=new SoundLoaderContext(8000,true);
    sound.load(req,context);
    channel=sound.play();
    trace("A tocar");
    sound.addEventListener(Event.ID3,id3Info);
    public function id3Info(event:Event):void {
    id3=event.target.id3;
    nomeMusica=id3.songName;
    public function get getNome():String {
    return nomeMusica;
    //FLA Code
    import Mp3Player.Mp3Player;
    var musica:Mp3Player = new Mp3Player();
    var nome:String = musica.getNome;
    musica.tocarMusica("Saia_Indiscreta.mp3");
    trace(nome);
    The trace of my code is:
    quote:
    A tocar
    Null
    What i'm doing wrong or is missing?

    Tnks all for the reply but none of them give me any answer :(
    Making the question in other way.
    Using the code above, how can i set a funcion to call the
    musicaNome value from FLA file?
    quote:
    //AS Code
    package Mp3Player{
    import flash.media.Sound;
    import flash.media.SoundLoaderContext;
    import flash.media.SoundChannel;
    import flash.media.ID3Info;
    import flash.net.URLRequest;
    import flash.events.Event;
    public class Mp3Player {
    private var sound:Sound;
    private var req:URLRequest;
    private var context:SoundLoaderContext;
    private var channel:SoundChannel;
    private var id3:ID3Info;
    private var nomeMusica:String;
    public function tocarMusica(file) {
    sound=new Sound ;
    req=new URLRequest(file);
    context=new SoundLoaderContext(8000,true);
    sound.load(req,context);
    channel=sound.play();
    trace("A tocar");
    sound.addEventListener(Event.ID3,id3Info);
    public function id3Info(event:Event):void {
    id3=event.target.id3;
    nomeMusica=id3.songName;

  • IP: Use of input-ready variable in planning function

    Dear all,
    I'm using an input-ready variable for fiscal year (0P_FYEAR) in my input ready query. It's used for restricting my columns.
    I'd like to use the value of this variable in my planning function and I use VARV for that in the FOX.
    However, when implementing the pl.function as a button in the BEx Analyzer I need to fill in the static parameters the VAR_VALUE_1 with a value.
    If I delete this line from the static parameters my plfunction end swith an error.
    I like this value of course to be filled with value of fiscal year entered by the user when starting the query.
    Does anybody know how to solve this?
    Kind regards, Harjan

    Hi Johannes,
    Thanks for all the useful information!
    Another thing on using PF.
    I've got two workbooks with different queries but using <u>same</u> filter.
    Queries differ in keyfigures, but are on same cubes in MultiProvider.
    I can run the workbooks simultaneously: no locks occur.
    I've got two planning functions that make calculations on the keyfigures entered in the workbook.
    However when I inplement the PF's in both workbooks and assign the dataprovider as filter, i do get locks!
    So, the PF also uses the same filter, but doesn't take into account the different keyfigures.
    In the fox-formula i don't have the option to make conditions on keyfigure values (field keyfigname), neither to enter them in the filter.
    Do you have any thoughts on this?
    <u>Second</u> point:
    When i filter on a navigational attribute and execute the pf, i get errors on my pf.
    It states it can't find the value of the characteristic to which the navigational attr belongs. F.i. when i filter on nav attr 'customer group'  (attr of char 'customer') and execute pf, the system gives an error on the value of char 'customer'.
    It states: value of characteristic customer is notincluded in the selection.
    Any thoughts on this one?
    Thanks in advance!
    Kind regards, Harjan

  • 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. Saravanan

    Sorry, 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

  • Regading Variable in Planning function in integrated Planning

    Hello All,
    I have a requirement where i have to run a planning function to copy the data of one key figures to other.
    But i need a input screen before execution of this planning function where i could insert the characteristics values for which i do not need this Planning Function to be Executed.
    Please let me know how to do this.
    I think this can be done using input ready variables.But i m not sure.
    Regards,
    Pratighya

    Hi All,
    With regards to the above issue, I have similar question and appreciate any inouts.
    Used a Planning function - type FORMULA
    Function needs an Input parameter to execute.
    So I want to create a Planning IP variable and assign it to the function call in my formula.
    From the Front end WAD/BEX - want to exceute the planning function by passing inpur value.
    Regards
    Rao

  • Using filter values in planning functions

    Hi experts!
    Is it possible to somehow pass the values users set in query filters (during query execution) into the planning function and use them there as variables?
    Thanks!

    Hello,
    I think it is possible.
    Please follow the steps
    1) Create query with only one characteristic ( WHich you want to use in Planing funnction)
    2) Create variable with replacement path using above query name.
    3) Use above variable in filter.
    4) read variable value using varv(Variable name)
    Thanks
    With regards,
    Anand Kumar

  • Can I use formula variable in description of a query

    Hello, I created a query to list top N of vendors by the number of PRs created using condition in the query. N will be entered by users according to what they like (could be, top 10, top 5...). My query works reasonable, but I want to use variable to have the query description changes to reflect the top number user wants to see. For example, currently my report name is "Top N Vendor of PRs". Is there any way I can let "N" dynamically changes everytime when user enter different N? "Top 5 Vendor of PRs", "Top 10 Vendor of PRs", .....
    Please help.
    Thanks.

    I am still struggling and need your help. Here is what I did:
    1. Created a formula variable, let's call "ZFM_VAR" from BEx. Processing by: Manually Input/Default Value. Choose YES for ready for input.
    2. Created a text variable called "ZTX_VAR" from BEx. Processing by: customer exit. Variable entry is Mandatory. Choose NO for ready for input.
    3. Wrote following code from enhancement EXIT_SAPLRRSO_001 include ZXRSRU01:
    data: w_i_t_var_range like rrrangeexit,
             l_s_range type rsr_s_rangesid.
    CASE i_vnam.
        WHEN 'ZTX_VAR'.
           IF i_step = 2. "after the popup
              CLEAR: w_i_t_var_range,l_s_range.
              READ TABLE i_t_var_range WITH KEY vnam = 'ZFM_VAR'.
                 l_s_range-opt = 'EQ'.
                 l_s_range-sign = 'I'.
                 l_s_range-low = w_i_t_var_range-low.
                APPEND l_s_range TO e_t_range.
          ENDIF.
    ENDCASE.
    After I am done the above 3 steps, I still didn't get the same value for ZTX_VAR as I entered in ZFM_VAR. When I run the function moduel in debugging mode, there is nothing in table i_t_var_range. Any ideas for what I missed or did wrong? If somebody can provide detailed instruction, that would be greatly appreciated.
    Thanks.
    Yingping

  • Using Formula Variable in Customer Exit variable

    Hi,
    I want to assign valuees of 2 Formula Variables to one cstomer exit variable based on some Characteristic.
    Example. Formula variables are Early and Late. If Early = 3 and Late = 4 , I want to pass value to the Customer Exit variable as Low = 3 and High = 4.
    The problem is in I_T_VAR_RANGE there is no value for formula variable in LOW field.
    Other variables based on Characteristics have values in this field.
    What can I do in this case?
    Regards
    SSS

    SSS,
    You can restrict your characteristic with two variables in the value range options of restricting.
    One can be used as low and the other can be high.
    Hope that helps.
    Thanks.

  • Using Formula variable in a key figure formula

    Hi Expert,
    Can anyone tell me how to use a formula variable to pass the fiscal year variable value (with offset values define in different columns) to the be used in the formula (if statements)?
    Currently, I create a formula variable using replacement path from the fiscal year reference object and key but it's not pull the correct value. I'm not sure what's the difference between the different objects i.e. key, external char key value, attribute value etc.
    Please give me some lights.
    Thanks!

    Hi Janice,
    From Standard SAP Help
    http://help.sap.com/saphelp_nw70/helpdata/EN/43/565cd22fc95f6ce10000000a1553f6/content.htm
    Don't want to sound rude, but please search the Forum and SAP Hel before posting a thread, it helps everyone.
    Thanks
    CK

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • Can't use bind variable in a function

    This is a repost from my earlier post at
    URGENT: Problem creating the report using Procedure
    The problem is when I bind a variable in a function, I get REP-0002. Please look at the following steps to reproduce
    ===
    set serveroutput on
    create or replace
    package Q_REP_test
    as
    type drec is record
    sdate date
    type dreccursor is ref cursor return drec;
    Procedure Get_sysdate(retdate out dreccursor);
    procedure add_days_tocurdate(no_of_days in number, retdate out dreccursor);
    end q_rep_test;
    show errors
    create or replace
    package body q_rep_Test
    as
    procedure Get_sysdate(retdate out dreccursor)
    is
    begin
    open retdate for
    select sysdate retdate from dual;
    end;
    procedure add_days_tocurdate(no_of_days in number, retdate out dreccursor)
    is
    begin
    open retdate for
    select sysdate+no_of_days retdate from dual;
    end;
    end q_rep_test;
    show errors
    ===
    Invoke the SP as follows:
    ===
    function QR_1RefCurDS return q_rep_test.dreccursor is
    tempc q_rep_test.dreccursor ;
    begin
    q_rep_test.add_days_tocurdate(:p_1,tempc);
    return tempc;
    end;
    ===
    1. Create a report
    2. create an user parameter(p_1)
    3. add a pl/sql as above
    4. run it(to verify the report works)
    5. save it.
    6. close the report
    7. Open it again, you get an as
    "REP-0002: Unable to retrieve a string from the Report Builder Message file". Now it is corrupted and can't be used at all.
    Please treat this as urgent and help me.
    Thanks

    Hi ,
    Though you have stated it as Oracle92iDS check whether it has the 9.0.2.2 patchset applied. If not please try applying the latest Patchset 9.0.2.2 for Oracle9i Reports.
    To download the patch goto Metalink &lt;http://metalink.oracle.com/metalink/plsql/ml2_gui.startup&gt; and search for Patch# 2842923.
    This Patchset is for iAS and iDS.
    In either case, please let me know the results.
    Thanks,
    Vinod.

  • How to use formula variable to calculate the days for a document.

    Hi expert.
    I have a question, I need to calculate how many days it cost for a document, therefore , it should be like this,
    cost days = clearing date - creation date..
    how can I implement this calculated key figure by formula variable..
    Here cost days should be a key figure, but the clearing date and creation date are the characteristics in the document.
    it seems that formula variable by replacement path can not be used, do I have to use the customer exit for this variable ??
    any other good ways to calculate the cost days (beside during the data loading or by virtual key figure).
    I just want to implement this in the query designer..
    Please give a detailed steps if you could,  thanks a lot.

    Hi,
    These steps below are for the query designer in BI 7.0:
    1. First create a Formula in the Columns.
    2. Edit the formula, in the "Available Operands" see for the "Formula Variable".
    3. Right Click on the "Formula Variable" folder and then create a new variable.
    4. Edi the Formula Variable in the edit screen provide the Description and Technical name; select the processing by as Replacement path.
    5. In the reference characteristic select your characteristic "Creation Date".
    6. Save the variable.
    7. Select the variable into the formula and name the formula as Creation Date.
    Repeat the Same steps for the "Clearing Date".
    Then create another formula for the Cost days in which you mention as Clearing date (Formula) - Creation Date (Formula).
    Hope your issue is solved...
    Regards,
    Ravi Kanth

  • Error message while using formula in a Ifthen function

    Hi all,
    I have a problem with IfThen (or If) function in Financial Reporting. I add a formula column and write this simple function.
    IfThen([A]=[A],[A],0). It returns #ERROR. I have tested the same function in another environment. It works fine.
    I do not know if there is a configuration problem or not. All the other functions are working, but I cannot use If statements.
    I use essbase connection. Do you have any ideas?

    let see if this works
    Ifthen(IsMissing(I),Eval(OxB),Eval((O+I)xB))
    Regards,
    Rahul

  • Using Substitution variables in Range function in FR

    Hi,
    According to one of my report requirement, I want to show current quarter’s weeks till the current week. Just to elaborate more I am able to show current quarters all weeks but unable to show till current week. I had created Current quarters starting week (CurrQtrSW) as a substitution variable and CurrWeek as other substitution variable when I keep these two SV's in Range function it is throwing me error and my report is not running. Can anybody help me in this?
    It is urgent
    Thanks in Adv.

    If you're using the standard 13 week quarters and they are labeled that way, you can just use Week1 as the starting point (as opposed to having weeks 1-52 in your essbase cube).
    Have you restarted essbase/FR Studio since adding the sub vars? It can sometimes require one or both to fully recognize them.
    Hope this helps.
    Cheers, Iain

Maybe you are looking for