FOX Formula does not calculate ratio

Dear guys,
We are customizing the process for calculation of data which will be used for elimination of profit/loss in stock and revenue and expenses during consolidation of manufacturing companies group's financials.
At the moment we're customizing a FOX Formula for calculation of share of revenue from (source) materials sold to other companies inside the group and used for production of other (target) materials and total revenue received for each of these source products.
We use the following key figures and characteristics in the level:
0CS_VERSION     Consolidation (End-Result) Version
0CURKEY_GC     Currency Key for Group Currency
0FISCPER3     Posting period
0FISCVARNT     Fiscal year variant
0FISCYEAR     Fiscal year
0MOVE_TYPE     Movement Type
MPZZFKOD     Source Material Consolidation Code
PRODUCER     Company - Producer
SL_TYPE          Sales Location Type: Export/Domestic
TRG_COMP     Target Company
ZZFKOD          Target Material Consolidation Code
COGSGGC     COGS Gross GC
SREVENGC     Revenue Statistical GC
VS_SUPSH     VS Supplier Share
MPZZFKOD ZZFKOD     TRG_COMP  COGSGGC    SREVENGC      VS_SUPSH
2651     #      #           0             10.070.099     0,00000
2651     2703      3           21.000              0                     0,00000
2651     2704      3           19.116              0                     0,00000
We need to calculate a ratio of COGSGGC for each ZZFKOD and total SREVENGC. (21.000/10.070.099 and 19.116/10.070.099).
Below is a program code:
DATA SUM_KF TYPE F.
DATA SHARE  TYPE F.
DATA FLAG   TYPE I.
DATA KEYFIG TYPE F.
DATA L_ENTRIES TYPE I.
*DATA L_ZZFKOD TYPE  ZZFKOD.
*L_ZZFKOD = VARV(TMCONSCD).
*DATA L_MPZZFKOD TYPE MPZZFKOD.
DO.
IF FLAG > 1.
EXIT.
ENDIF.
ENDDO.
L_ENTRIES = VARC(VERSION).
*SUM_KF = 0.
*FOREACH L_MPZZFKOD.
SUM_KF = SUM_KF +
*{SREVENGC,'#','#'}.
*ENDFOR.
*SUM_KF = SUM_KF + {SREVENGC,'#','#'}.
*FOREACH L_MPZZFKOD.
SHARE = {COGSGGC,L_MPZZFKOD,'#'} / SUM_KF.
{VS_SUPSH,L_MPZZFKOD,'#'} = SHARE.
*ENDFOR.
*SUM_KF = SUM_KF + {SREVENGC,'#'}.
*FOREACH L_ZZFKOD.
*SUM_KF = SUM_KF + {SREVENGC,L_ZZFKOD}.
*ENDFOR.
*DO.
*IF FLAG > 1.
*EXIT.
*ENDIF.
*ENDDO.
*FOREACH L_ZZFKOD.
*SHARE = {COGSGGC,L_ZZFKOD} / SUM_KF.
*{VS_SUPSH,L_ZZFKOD} = SHARE.
*ENDFOR.
Could you help us to understand the reason the program does not work?
Mila

Mila,
I see some issues with your logic:
1. you are not using fiscal period at all but you declared it.  Is it in your field to be changed or just in your field for condition or package / filter?  Also version 0CS_VERSION?
2. What is the purpose of Flag > 1?
3. You are very confused in your looping logic...  You need to think more logically about what you want to do
4. What is the 3rd items in your fields to be changed?  If you don't use it or change based on it in the FOX, remove it from fields to be changed.
You want to process for each source material MPZZFKOD (I persume for each fiscal period) and within each source material MPZZFKOD, you want to loop through each target material ZZFKOD.
Note: the items in the {} depends on the order of your to be changed characteristics
Give this (or a similar version to this) a whirl.
DATA SUM_KF TYPE F.
DATA SHARE TYPE F.
DATA L_MPZZFKOD TYPE MPZZFKOD.
DATA L_ZZFKOD TYPE ZZFKOD.
FOREACH L_MPZZFKOD.
  SUM_KF = {SREVENGC,L_MPZZFKOD,'#'}.
  FOREACH L_ZZFKOD.
     SHARE = {COGSGGC,L_MPZZFKOD,L_ZZFKOD} / SUM_KF.
     {VS_SUPSH,L_MPZZFKOD,L_ZZFKOD} = SHARE.
  ENDFOR.
ENDFOR.
You can even do without the share if you map it directly.
     {VS_SUPSH,L_MPZZFKOD,L_ZZFKOD}
            = {COGSGGC,L_MPZZFKOD,L_ZZFKOD} / SUM_KF.
Hope this helps.  Sounds like you need to read up on some documents on FOX and/or practice with it.
Mary

Similar Messages

  • [Project Pro 2013] User Custom Field w/ Formula does not calculates on Group Tasks

    This issue happens only on Project 2013. When I make a formula (using Duration, Cost, Number, etc...) on a custom field and set "Use formula" option in "Calculation for task and group summary rows",
    works fine without groups, on resume tasks. But when I Group the tasks, the group tasks values disappear.
    When I open the same file on Project 2010, it works correctly.
    Thanks in advance.

    Thank you for the effort. This problem is a bit tricky and hard to explain without images or files.
    I'll try to explain using your example:
    - I do not coded my summary tasks with the value in the "Text1" field and
    - I do not want to maintain hierarchy on groups like you show.
    1. On "No Group" mode, the summary tasks works fine. All summary tasks shows the values calculated by the formula. Summary tasks are not the problem.
    2. However, when you group the tasks by Text1, the Group Tasks (the colored ones that appear on group mode: Group: a, b and c) do not show the values calculated by the formula, even if you set to "use formula" on summary and group tasks.
    3. When you open the same file on Project 2010 (default configs), group tasks values appears (values calculated for the groups of the detail tasks: a, b, c). If your Duration1 field stays the same or disappear, change some values and refresh the field to check
    the formula is working.
    4. If you see that everything are working correctly so far, try this on your file:
    4.1. Maintain your tasks grouped by Text1.
    4.2. Add three Fields: "Duration2", "Duration3" and "Duration4".
    4.3. On every detail tasks, enter 2 days for Duration2, 3 days for Duration3.
    4.4 Set Duration2 and Duration3 to "show Average" value on the resume and group tasks. Set the Duration4 to "use formula".
    4.5. Create on Duration4 field a simple formula, like [Duration2]+[Duration3], or [Duration2]/[Duration3].
    4.6. See that the formula works fine the detail tasks (Duration4 = 5 days).
    4.7. Now the problem: The group tasks shows nothing. Duration4 should be calculated (average duration2: 2 days + avg duration3: 3 days = 5 days).
    4.8. Save the file and open on Project 2010. If the resume tasks on Duration4 continues to show nothing. Refresh the field by clicking right button on field and going to "Custom field" and pressing OK.
    See that Duration4 are calculated on Project 2010 correctly, but not on 2013 version. That is the problem
    Thanks again. I hope it helps.

  • PR00 does not calculate / deleted for TANN in R/3 for CRM order - Free Good

    I hv done free good configuration both in R/3 and CRM.
    Main Category - TAN and Free good category - TANN
    Pricing for TANN = PR00 and ZFRE -100% discount
    When I see result in R/3 and CRM, it does populate PR00 and calculate ZFRE.
    While in Order creation in CRM it does calculated PR00 and ZFRE, on order save it replicates order in R/3 but in R/3 it does not calculate or retain PR00 & ZFRE value as a result I'm getting price log error in R/3 saying mandatory condition PR00 missing. Where as in CRM it does not impact calculate pricing.
    Note: I don't want to retain PR00 as a mandatory condition and I don't want to change my calculation. Is there any technical solution to achieve this.
    Thanks,
    Nilesh P.

    Hi Nilesh P,
    Have you set the parameter PRICINGTYPE to G in table SMOFPARSFA as per note 490932 - 'G' = Copy price components unchanged. If so then the only possibility is to debug the transfer to ERP as per note 656823 in order to determine where the condition value is initialized.
    I hope this helps.
    Kind regards,
    Vanessa.

  • Website page with jquery datepicker does not calculate dates while other pages without datepicker and all other browsers do their job

    I wrote two mobile pages with dreamweaver cs5.5 and jquery. Both do online calculations. Both appear and accept input. One page using jquery datepicker does not calculate. Solely in Firefox. IE9, Safari, Chrome display correct results. Debuggers show no error. Firebug seems telling me that Firefox does not get a result from datepicker function.

    Thanks. But did not help. I had done this several times before, reload, clear cache, disable extensions etc. Always used standard theme. I tried the same on two different machines, with next to last version and after having installed the latest version. In the debugger I can see that variables "zeit1" (jquery datepicker) were not filled with the datepicking results, while in all other browsers zeitX shows the current date and the app shows the results that are expected. Given that another comparable app - only without date and datepicker functions - works in Firefox I think one should explore why solely datepicker - or the function using datepicker - does not show results solely in Firefox on desktop (no mobile device with Firefox on hand) . I indeed believe that there is a mistake in my code which is detected only by Firefox (10.0.2 at the present time, with Win7 64bit - had the problem with 3.6... on another machine). Given that you could run the app with results on your machine: could it be the context of locale/culture (here: de)?
    Kind regards

  • Text formula does not woek

    Hi,
    I want to use date reference and compare two cells. It does not work when a dynamic last empty cell reference needed. I tried this one
    =IF(((TEXT(C6,MMMM/YY)))=((INDEX((TEXT(C6,MMMM/YY)):(TEXT(C45,MMMM/YY)),COUNTA(C6:C45)))),(" "),(INDEX(TEXT(C6,MMMM/YY)):(TEXT(C45,MMMM/YY)),COUNTA(C6:C45))))
    This is the working formula   =IF((TEXT(C6,"MMMM/YY")=TEXT(C45,"MMMM/YY")),"",(TEXT(C45,"MMMM/YY")))
    I want a dynamic reference for TEXT(C45,"MMMM/YY")) part from cell C6:C45 for last filled cell.
    Please help.
    Thaanks,

    Hi drsantoshsinghrathore,
    Thanks for posting in MSDN forum.
    This forum is for developers discussing developing issues involve Excel application, since the issue more relative to end-user, I would like to move it
    Excel IT Pro Discussions forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Fox tab does not go away after being launched

    Just recently about a week a go fox tab stopped working. As in when it is launched and i click on a tab it does not go a way and i have to close the browser and open it a gain to get rid of the fox tab screen.
    I hope someone can help.
    I am running Firefox 18.0.1, fox tab 1.4.5 and flash plugin 11.5.502.146.

    See these articles for some suggestions:
    *https://support.mozilla.org/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    *https://support.mozilla.org/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    If you do not keep changes after a restart then see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Pie chart legend total does not calculate correctly

    Hi All
    I have a pie chart in a CR 2008 report (SP0). 
    The pie has one "On Change Of" and one "Show Value" field.
    The datasource for the report is an Oracle 10g (Rel 2) Stored Procedure (SP).
    The SP signs the value per each transaction (record), so if the txn is a reversal is will arrive in the report as a negative value
    The records that are listed in the report have the correct sign on each line, and totals in the report are correct
    So, if the first record has a value of 10,000 - these would be known as Cash txns
    and the second record has a value of -5,000 - these would be known as Cash Reversal txns
    The report total will be 5,000
    In the legend entry of the pie chart the values per series are being displayed correctly.  There is a series per Txn type (so one series represents Cash txns, the second series represents Cash Reversal txns)
    From the example above my pie shows 1 txn for Cash @ 10,000
    and 1 txn for Cash Reversal @ -5000 (it has the negaitve amount in brackets)
    But the total in the legend is 15,000
    I cannot figure out why that the legend total is not calculating correclty.
    Has anyone seen this behaviour before?
    Any help would be great thanks
    Best regards
    Patrick

    Just realised why....  The total is counting all txns, and my formula is not telling it that Reversal should be subtracted - duuhhhh!!!!

  • Exception defined on a formula does not chande display for key figure

    All,
    I have an exception defined on a formula included in the key figure structure based on which the display for another key figure should change.  The display is changing for the formula and not for the key figure as i would like for it to do. 
    The setting of the exception is set to display on "following structure elements" and points to the key figure and is defined on the formula.
    This behavior is exhibited correctly when run through BI 7.0 Query designer portal however when executed using Analyzer both 3.5 and 7.0 version i am encountering this issue.
    Any help is appreciated.

    I believe you are using 3.x.
    Please mention the version of BW in the problem statement.
    If you dont want to use exception aggregation in the query the second option is setting this property in the backend for the keyfigure. But I believe that you are trying to set this for the CKF, so I dont see any other option to generate exception aggregation.
    I would like to comment on your reasons why you dont wnat to usee the exception aggregation.
    1. It is not working: If it not working, you should contact SAP for this. Exception aggregation is 20% heart of any query and it is very rarely used things in reporting.
    2. It is obsolete: I am not sure, if this is correct. There are many industries where you cannot built certain reports without exception aggregation. The simplest report of sales where you are asked to find the rate of the material from Total Sale and Quantity at aggregation level can not be created without exception aggregation. So this option is and will never obsolete.
    Please try using before aggregation.
    - Danny

  • Fox tabs does not work anymore what is up?

    I tried to add some websites to my top sites and it does not work. I still have some previously stored sites left but I cannot add any more.

    Hi!
    From what I read, you are trying to customize the sites that show up in "My most visited" folder in your bookmarks.
    Unfortunately this folder is automated and it's content can't be manually modified. But, you can customize your list of bookmarks with the ones that you want, and even create a My top sites folder that is curated manually.
    You can learn more about bookmarks in the following article: [[Use bookmark folders to organize your bookmarks]]
    I hope it helps.
    Ibai

  • Absolute cell reference in formula does not work when sorting. Previously posted solution does not work.

    I have two worksheets. Worksheet A has 5 columns. First Name, Last Name, Donation Amount, Donation Date, Contact Person. On the other worksheet I am trying to get the donations done or enabled by a certain
    contact person.  My formula is a simple addition: 
    ='Board_Donations_2013-2014'!D7+'Board_Donations_2013-2014'!D284
    It's a simple addition but when I sort Worksheet A by first name, or last name or any other way the amount/number on the cells change. D7 for example is $5,000, but when I sort the list by a different parameter
    it becomes $20,000 or whatever amount is on that cell now. I tried to use absolute reference, but it still changes.
    I want the amount/number on the cell (in this case D7 or D284) to stay consistent in the formula after sorting, not the cell location itself.
    I have office XP and Excel 2010.
    Any suggestions?
    Thanks,
    Rose

    Hi,
    Based on your required, we may add a Vlookup formula in the calculation process. It'll help us keep the relevant name & donation amount value after sorting. Please see the below image:
    Formula: =SUM(VLOOKUP("jonh",A2:E4,3,0),VLOOKUP("luna",A2:E4,3,0))
    http://office.microsoft.com/en-us/excel-help/vlookup-HP005209335.aspx
    Regards,
    George Zhao
    TechNet Community Support

  • I down load latest fire fox but when run tells me I dont have the latest & fox button does not go to sync setting.

    I have downloaded the latest addition of fire fox changing the language to UK English. When I run the down lode under the Google box the system says that I am not running the latest version.
    I also have a Samson Tablet & having down loaded Firefox it asks me to sync with my computer. Thus I accessed the computer how to sync & clicked on the Firefox button at the top left of the screen (This only shows Restore Minimize Close) No path to sync data.

    hello WallyWalsh, if this warning is showing up you might have to reset the homepage to the version that is used in firefox 4 & above (the old homepage will show the warning you have referenced). to change it go to firefox > tools > options > general & reset the homepage to the default (that's '''about:home''').
    to set up sync between your pc and the tablet, go to ''firefox > tools > sync'' & create a sync account - for detailed information about it please refer to [[How do I set up Firefox Sync?]]

  • Table with a column with RANK formula does not sort properly

    Hello,
    I have a table in excel with Rank function that reference another column with numerical values. The results in the column (called Rank) with rank function are as expected but Sorting (ascending or descending) doesn't
    work as expected on the column .  The Rank gets sorted in the following order: 1,15, 2,19, 8 , 4......
    Few things that I've verified are:
    1. Verified that there are no text values in the column.
    2. Tried changing the format to number but this still doesn't resolve the sort issue.
    3. Copied the values from the Rank column to a different sheet and applying sort works as expected.
    Does anyone have any idea on what could be wrong? Appreciate your help!
    Thanks!

    Resolved the issue. I had an incorrect formula in one of the that was referenced by the Rank column.

  • Crop tool does not show ratios

    When I click the crop tool or press "c" I do not get the ratio options, only free hand cropping. It worked as I installed Photoshop/Bridge/Camera Raw but it just stopped. What can I do? I have CS5 and I use Windows. Thanks from Magnus

    I am having the same problem.  The crop menu doesn't show drop down menu's.  I am running the 64 bit version of
    photoshop CS5 and I don't know if maybe it is a compatiblity issue?  Any help to get the drop down menus to appear?

  • Fox news does not load all the things on it in a lot of the boxes, like pictures andthings under news and faces.Have checked all the image settings and such....

    on fox news site JUST recently the picts and some text , like under faces and news and under categories like WATCH now, NOTHING appears....just satrted happening..have checked the settings to no avail...HELP

    notice the blank areas under the bullets

  • Does not calculate cost

    Hi Gurus,
    I am calculating cost thru CK11 for a material, Hours exist in the Standard Values in Master recipe but in CK11 it is not picking those hours and hence giving cost(Over head) zero.
    This material is having only One production version.
    There are other material but cost is coming for them.
    Would you please explain this to me..
    Thanks in Advance
    Atul Bhardwaj

    Hi
    with respect to your query please check following steps in master receipe ( CRC2)
    CAN you check for costing tab that cost centre and activity type are assigned . prior to that  KP26 activity price planning should be complete.
    and also you check the overhead rates maitained for plant specific in the costing sheet in use
    tcode  KZZ2  For maintenace of OVERHEAD RATES and KZS2 for mainteance  of values in  costing  sheet
    i hope this will clear your issue can you check once and letme know
    thanks
    shaik

Maybe you are looking for