Balance Carryfoward Function Using FOX

Hi ,
  I got to create a FOX function to do (BCF) Balance Carryforward ..
i need to COPY some records from one version(P6),Fiscal Year(2008) to another version(P1) and fiscal year(2009).While doin so i also need to carryforward the Previous years Balance(0BALANCE).
<b>Records in the Real-Time Cube:</b>
Zrecordid, ZPLANYEAR, 0FISCYEAR,0version,0Balance,0AMOUNT
123,          2008,             2008,           P6,         100,          50
123           2008,             2009,           P6,          0.0,          40
123           2008,             2010,           P6,          0.0,          30
124           2008,             2008,           P6,          200,         60
124           2008,             2009,           P6,          0.0,          25
<b>After the FOX Funtion i should get records:</b>
Zrecordid, ZPLANYEAR, 0FISCYEAR,0version,0Balance,0AMOUNT
123,          2009,             2009,           P1,         150,          40
123           2009,             2010,           P1,          0.0,          30
124           2009,             2009,           P1,          260,         25
<b>I keyed in the following code to copy the records that doesn't have BCF value
: Will it work ???</b>
IF CHA_FYEAR <> '2008' .
       {0AMOUNT,#,'P1','2009'} = {0AMOUNT,#,'P6','2008'}.
   ENDIF.
I have started come coding assuming the copy to version and year is done..
**BALANCE CARRY FORWARD CALCULATION**
DATA ZFISCYEAR TYPE 0FISCYEAR.
DATA ZPLANYEAR TYPE ZPLANYEAR.
DATA ZVERSION TYPE 0VERSION.
DATA ZRECORDID TYPE ZRECID.
DATA L_RECS TYPE I.
DATA L_COUNT TYPE I.
*ZFISCYEAR = VARV( 'TOFISCYEAR' ).
*ZPLANYEAR = VARV( 'TOPLANYEAR' ).
*ZVERSION = VARV( 'TOVERSION' ).
L_RECS = VARC(ZRECID).
BREAK-POINT.
*IF {0BALANCE,#,#,#} <> 0.0
FOREACH ZRECORDID.
   {0AMOUNT,#,'P6',2008'
ENDFOR.
*ENDIF.
DO.
   L_COUNT = L_COUNT + 1.
   IF ZFISCYEAR = '2008' AND ZPLANYEAR = '2008'.
       {0BALANCE, ZFISCYEAR , ZVERSION, ZPLANYEAR} =
                            {0BALANCE, '2009', 'P1' , '2009'} + {0AMOUNT,
'2009', 'P1', '2009'}.
ELSE.
       {0AMOUNT, ZFISCYEAR , ZVERSION, ZPLANYEAR} = {0AMOUNT, '2009',
'P1' , '2009'}.
ENDIF.
   IF L_COUNT = L_RECS.
     EXIT.
   ENDIF.
ENDDO.
Can someone help me with this issue..........
regards,
Nava.

I guess DU is not required in your 'Fields to be changed' in planning function as it is not changing anywhere in your function and you do not have any condition on this field also. So, if you remove DU try the below code:
DATA BRAND TYPE ZCH_BRAND.
DATA SEASON TYPE ZCH_SEASN.
FOREACH BRAND, SEASON.
IF BRAND = 'ADIDAS' AND SEASON = 'WINTER'.
{ ZKF_HPVOL ,BRAND,SEASON} = { ZKF_HPVOL ,BRAND,SEASON} * 20.
ENDIF.
ENDFOR.
If you want to keep DU, then try below code:
DATA BRAND TYPE ZCH_BRAND.
DATA DU TYPE ZCH_DEVUT.
DATA SEASON TYPE ZCH_SEASN.
FOREACH DU,BRAND.
IF BRAND = 'ADIDAS'.
FOREACH SEASON.
IF SEASON = 'WINTER'.
{ ZKF_HPVOL ,BRAND,DU,SEASON} = { ZKF_HPVOL ,BRAND,DU,SEASON} * 20.
ENDIF.
ENDFOR.
ENDIF.
ENDFOR.
Regards,
Deepti

Similar Messages

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

  • Trial Balance Upload function

    Dear Friends,
    We have developed customized Trial Balance upload function.
    While uploading we are Debit all the TB item which are debit and credit the GL A/c. 9999999901 and same we are credit the all the TB items and debit GL a/c 9999999901 which results GL A/c 9999999901 is become the 0 (Zero).
    After completing upload function we can view entry using T Code u2018FB03u2019 to verify the JV.
    Can anyone please guide me how to extract the Trial balance and is there any other way to kin the opening trial balance manually.
    And also which Item from TB I need to take care while uploading the TB as per my seniors they can help me to take care of e.g. Sundry Creditor, Debtors and Cash in Hand and also any subledgers.
    Thanks in advance.
    Mahendra Dev

    For TB (GL Balances):
    S_PL0_86000030 - G/L Account Balances (New)
    S_ALR_87012277 - G/L Account Balances
    Vendor TB: S_ALR_87012082 - Vendor Balances in Local Currency
    Customer TB: S_ALR_87012172 - Customer Balances in Local Currency

  • How to call standard planning function in FOX code

    Hi,
    I want to call std. Distribution by reference planning function in FOX formula. Through CALL FUNCTION std planning functions can not be used.
    My requirement is that because I need to execute this distribution function thousands of times with different variable values so I am planning to pass the values for these variables through FOREACH loop.
    Any help is appreciated.
    regards
    Amit Jain

    Hi Amit,
    unfortunately calling a planning function inside a planning function is not possible. And calling a planning sequence from a planning sequence is not supported as well.
    I think is is better if go for a more complex FOX or an exit-function if the planning function needs to be executed online.
    Another way some customers are using to met similar requirements is writing a z-program which determines the variable values in a loop (e.g. by reading a z-table). Inside the loop they set the variables (in the variable container) and when this is done execute a planning sequence for the current variable setting. The whole thing could be executed e.g. in a process chain.
    Hope this helps ...
    Regards Matthias Nutt
    SAP Consulting Switzerland

  • How to report on balance sheet accounts using 0EC_PCA_3

    Hi Experts,
    How to report on balance sheet accounts using 0EC_PCA_3
    Thanks
    nagini

    Hi,
    IF you want to see the accumulated balances you need to select the period from 0 to 12.
    EX: you want to open the report up to period 6th 2009 and want see the figures including the carryforward balances from 2008.
    then in selection screen select the from period = 0  and to period =6.
    hope its helpful
    thanks,

  • SQL report region source to call a pl/sql function using DB link

    Hi - I have a pl/sql function fn_dbtype(id NUMBER) defined in database X. The pl/sql function executes couple DML statements and returns a string (a SELECT query). I am able to call this function using SQL Plus (Connected to Database X) as below and it works fine:
    declare
    vSQL VARCHAR2(100);
    begin
    vSQL := fn_dbtype(1);
    end;
    The DML operations completed fine and vSQL contains the "Select" query now.
    In APEX:
    I am trying to create a SQL report in APEX using SQL query(PL/SQL function returning a sql statement) option. I am trying to figure out what to put in the region source so that the output of the "Select" query is displayed in the report.
    Moreover APEX is hosted in a different database instance. So I would need to call this pl/sql function using a DB Link.
    Please let me know what I need to put in the region source to execute the pl/sql function which returns the "Select" query thereby displaying the query output in the report. Thanks.
    Edited by: user709584 on Mar 19, 2009 2:32 PM
    Edited by: user709584 on Mar 19, 2009 2:34 PM

    try something like this:
    return fn_dbtype(1)@dblink;

  • How do I pass an array of structs to a C function using the dll flexible prototype adapter?

    What I want to do is pass into a C dll function a variably sized Array of structs of type TPS_Data. My Code compiles but when I run it in TestStand, I get an error -17001; Program Error. "Cannot allocate 0 size buffer Error in parameter 2, 'OpenFrdData'."
    I've allocated the Array of structs, and all of the information is there before I call my function, so is it my prototype? Or am I asking too much of the DLL Flexible Prototype Adapter to pass an Array of Structs?
    I can pass in a single struct of type TPS_Data and that works, but not an array.
    Here's the relevent code:
    typedef struct TPS_DATA
    char Report_Number[256];
    char System_Name[256];
    char Open_Date[256];
    char UUT_Part_Number[256];
    char UUT_Serial_Number[256];
    char UUT_Name[256];
    char Open_Employee_Name[256];
    char Open_Employee_Number[256];
    char Close_Employee_Name[256];
    char Close_Employee_Number[256];
    char Close_Date[256];
    } TPS_Data;
    typedef struct TPS_DATA_ARRAY
    TPS_Data DataRecord;
    } TPS_DataArray;
    long __declspec(dllexport) __stdcall OpenDialog (CAObjHandle Context, TPS_DataArray *TpsData[], const char *psFaultStr, char *sComments, const int nCount);

    OK,
    I can pass the data to the DLL function, using the following types:
    typedef struct StringArrayType
    char string[10][256];
    } StringArray;
    typedef struct MultiStringArrayType
    StringArray Record[10];
    } MultiStringArray;
    void __declspec(dllexport) __stdcall ATP_TestStructPassing(StringArray Strings)
    return;
    void __declspec(dllexport) __stdcall ATP_TestMultiStructPassing(MultiStringArray *Strings)
    return;
    But when the MultiStruct function Exits, TestStand reports an Error:
    -17501 "Unexpected Operating System Error" Source: 'TSAPI'
    There doesn't seem to be a way around this, and once the error occurs, I have to force quit TestStand. I've included the sequence file, and the dll code can be compiled from the fun
    ctions shown above.
    Any thoughts on how to get around this error would be greatly appreciated.
    Attachments:
    StructArrayPassing.seq ‏16 KB

  • How do I copy the URL of a PDF file that I have opened in FireFox using FoxIt Reader add-on?

    This does NOT seem to be a FoxIt question because, when I use FoxIt 5.0 as my PDF reader in Internet Explorer 8, I do not have this problem. I have encountered the problem only when using FoxIt 5.0 as my PDF reader in FireFox 4.0. The problem is quite annoying. I NEED to capture the URLs of the PDFs I view and I prefer to use FireFox as my browser. The problem exists because no destination field is displayed when FoxIt opens in FireFox. A destination field IS displayed when FoxIt opens in IE.

    Another option for sending large files is to use :
    http://www.filedropper.com/
    You upload the files to the website and it creates
    a URL that you can copy and paste into an email
    which you send to the recipient and they use the
    generated link to get the file.

  • Firefox will not use Foxit Reader plugin.

    Why doesn't the configuration to use the Foxit Reader plugin for PDF files work? The Adobe Reader plugin (in Firefox) is used instead.
    In Firefox 3.6.8 "Options" window, "Applications" tab, for "Content Type" -- "PDF file," the selected "Action" is "Use Foxit Reader Plugin for Mozilla (in Firefox)."
    For "Content Type" -- "PDF file, in the "Action" dropdown list, no option is listed for "Use Adobe Acrobat (in Firefox)."
    The "C:\Program Files\Mozilla Firefox\plugins" folder contains both (1) the Foxit Reader plugin (npFoxitReaderPlugin.dll ver.1.0.1.1117), and (2) the Adobe Reader plugin (nppdf32.dll ver.9.3.3.177).
    When Firefox connects to a website using a URL for a PDF file, the PDF document always appears in Firefox using Adobe Reader.
    Given the configuration, why doesn't Firefox open the file using Foxit Reader? How can this be fixed?
    Operating system is Windows XP Media Center Edition 2005.
    Thank you.

    BTW, Foxit has released Foxit Reader 4.3.0 which uses Firefox plugin 2.0.2010.1103.Plz take a look at foxit download center:http://www.foxitsoftware.com/downloads/index.php

  • How can i do the upload file function using tomcat library??

    how can i do the upload file function using tomcat library??

    Did you read the document for the library?
    If you can't figure it out, why don't you ask the people who provide the library?
    This has nothing to do with JavaMail.

  • How to  use data function using characterstics variable for calculation on

    how to  use data function using characterstics variable for calculation on  attribute as key figure

    Hi Gayatri
    Did you not see my answer for CASE because CASE does indeed offer the use of the BETWEEN clause, but DECODE does not. Let me give you a little synopsis of DECODE.
    In its most simple form it takes 4 values and looks like this: DECODE(A, B, C, D)
    This essentially means, IF A = B THEN C ELSE D
    The trick to solving BETWEEN in a DECODE is to work out algoriths where A = B. Because we don't know how many values are between 00 and 99, although I could guess there were 100 we could of course have 100 parts in the DECODE but that would be awful. How about if we look at it another way and say this:
    IF PART_NUMBER < 'SDK00' THEN pay_amount
    ELSE IF PART_NUMBER > 'SDK99' THEN pay_AMOUNT
    ELSE pay_amount + 100
    This statement only had 2 hard coded values, but how to make DECODE work with less than? Easy, we use the LEAST function. The LEAST function takes 2 values and returns the one with the lowest value. So I use LEAST(PART_NUMBER, 'SDK00') then whenever the PART_NUMBER is lower than SDK00 it will be true. A similar situation exists for the opposite function GREATEST. Putting all of this together then, you can do this:
    DECODE(PART_NUMBER, GREATEST(PART_NUMBER, 'SDK00'), DECODE(PART_NUMBER, LEAST(PART_NUMBER, 'SDK99'), PAY_AMOUNT * 100, PAY_AMOUNT), PAY_AMOUNT)
    In English this can be read as follows:
    IF the PART_NUMBER is greater than or equal to SDK00 and the PART_NUMBER is less than or equal to SDK99 THEN PAY_AMOUNT x 100 ELSE 0
    Best wishes
    Michael

  • Is it possible to create a tree with drag-and-drop functionality using ajax

    I saw these samples;
    Scott Spendolini's AJAX Select List Demo
    http://htmldb.oracle.com/pls/otn/f?p=33867:1:10730556242433798443
    Building an Ajax Memory Tree by Scott Spendolini
    http://www.oracle.com/technology/pub/articles/spendolini-tree.html
    Carl Backstrom ApEx-AJAX & DHTML examples;
    http://htmldb.oracle.com/pls/otn/f?p=11933:5:8901671725714285254
    Do you think is it possible to create a tree with drag-and-drop functionality using ajax and apex like this sample; http://www.scbr.com/docs/products/dhtmlxTree/
    Thank you,
    Kind regards.
    Tonguç

    Hello,
    Sure you can build it, I just don't think anyone has, you could also use their solution as well in an APEX page it's just a matter of integration.
    Carl

  • Pop up window, and window.opener function using workshop?

    hi,
    pop up window, and window.opener function using workshop?
    hi,
    i am having two folders.
    one folder having
    abc.jpf file,
    test1.jsp
    second folder having
    xyz.jpf
    test2.jsp
    i am using weblogic workshop8.1
    i need to call test2.jsp as pop up window
    from test1.jsp.
    i need to pass value from test1.jsp to test2.jsp
    again i need pass value from test2.jsp to test1.jap
    normal jsp programming we can use window opener
    javascipt function to do above.
    same thing how to us in weblogic workshop?
    any can help?
    thanks,
    jp reddy

    Hi,
    assuming action.do is the action method of ....../folder1/abc.jpf you can try out this in the test1.jsp,
    function openNameHistory(url) {
    var args = "<%= request.getContextPath() %>/folder1/"+url;
         window.showModalDialog(args,'','dialogHeight:320px;dialogWidth:600px;scroll:yes;status:no');
    <netui:anchor href="javascript:openNameHistory('action.do')">Name History</netui:anchor>
    u need not specify the abc.jpf in the url because , workshop allows only one jpf per folder
    hope this helps...
    regards
    shakan

  • Repost Function using Variable is not working

    Hello experts!  I am on BW-BPS 3.5.  I have set up a repost function using variables to change a characteristic value for Business Unit.
    1. I created 2 variables as Bus.Unit From and Bus.Unit To in the Planning Area. I am not using the variables in my planning level.
    2. I entered the variables in the parameter group New Values area for the From and To Values.
    3. My goal is when the user executes the Repost Function for a Variable Prompt should appear and have the user select the From Business Unit and To Business Unit.
    The Variables are set up as USERVALUE User-Defined Values, Restriction of Values required by user and I have tried with/without option of Input Allowed by User. 
    Can you tell me what I am doing wrong, I expected a variable prompt when executing the Repost Function but it does not work.
    Thank you,
    Teri

    Ravi, Thank you for your reply however I contiue to have errors or the execution does not repost (change any value) as noted below.
    1. I have 2 Variables in Planning area var1 (from) var2 (to) for the same charateristic which is Business Unit
    2. Business Unit is in the level,  on the selection tab to add the variable I can only add 1 variable, So I added var1 (from) to the level. 
    3. Parameter group for old and new values - I have Var1 (from), var2 (to)
    4. Report Function - are you referring to Reporting variables in BPS? I have set this up as suggested in the "How to Use Reporting Variable in BW-BPS" document.
    5. Enter plan data: I receive prompt for VAR1, mandatory. At this point there is no value in Var2.
    6. Execute Repost function - I receive an error to "Restrict Var2"
    7. If I set variable values and add a value for Var2 I receive an error "The generated data is not contained in the selection condition".
    Next I removed VAR1 from my planning level and turned on the option 'Selection in package' for Business Unit. This seems to work well.
    What do you recommend?
    Thank you,
    Teri

Maybe you are looking for

  • How to get all lines in a paragraph?

    Hey all, I've got a confusing question, see the codes below: tell application "Adobe InDesign CS4"           set doc to open orphan_check           tell doc                     set myPage to page 4                     set myTextFrame to first text fr

  • How can i send my purchased apps(from itunes in my computer) to icloud through new icloud control panel on my windows computer

    I usually buy apps from my computer but i am unable to send these on icloud. I use a windows 7 64-bit I upgraded my itunes and got the icloud control panel but i am not able to stream my photos or apps to it Can someone help.

  • Error-handling in PKGBUILDs is far from perfect

    Hi, PKGBUILDs should die on failure, rather than just continue regardless of errors. Here's a little rant: Why is it acceptable for ./configure to fail? Or make install to fail? Or the installation of just about any file? They could fail for lots of

  • Ranking for Row grouping in SSRS report

    Hi, I want to display data in following format in ssrs report.  Rank Group  Value 1        G1      10 2        G1      20 3        G1      30 4        G1      40 1        G2      25 2        G2      54 3        G2      64 I tried row count and other

  • Probem in displaying long text

    Hi, I got the long text in ITAB1. ITAB2 having other details which match this long text. when iam displaying the two Internal tables,this long text is displaying one step down.How to move UP? OBJNR        LONGTEXT 200000123            <b>{getting gap