Fox Function for Distribution

Hi Guys,
I have requirement that when the user enter the Prod Units (Key Fig) in Local currency(100) then it has to spread to global Currency(50). Even the UOM(Column in the example)  which is on 0unit. has to spread. (LB or KG,,,,ETC)
I am thing on haveing Fox Function which will do this below is my function.
For Eg:
BA     Plant     UOM     Prod unit     curr type
1000     10     LB     10000     100
1000     10     LB     10000     50
1000     10     KG     5000     100
1000     10     KG     5000     50
My Fox Function:
DATA UT TYPE 0UNIT.
DATA CT TYPE 0CURTYPE.
DATA VR TYPE 0VERSION.
FOREACH UT,RC.
IF {GPRODBASU,100,UT,001} <> 0.
{GPRODBASU,50,LB,001} = ({GPRODBASU,100,UT,001}/GPRODBASU,100,UT,000})*{GPRODBASU,50,LB,000}.
ENDIF.
ENDFOR.
But this Fox function is not working the way i want it. Any suggestion will be great.
Thanks
SP

Once i have changed the Fox Function. It worked for me.

Similar Messages

  • FOX Code for COPYING Data

    Hi,
    I am trying to write a FOX function for key figure 0AMOUNT. The users will be choosing FROM and To Versions (I have created two input variable-ZVERFROM and ZVERTO), From and To Forecast Plan Years (ZYRFROM and ZYRTO). I have to combine them into the following code,
    1) If the TO plan year (ZYRTO) is less than current fiscal year, the TO version becomes 100 ( actuals)
    else.
    2) If the TO plan year (ZYRTO) is greater than or equal to current fiscal year, copy the chosen FROM Version (ZVERFROM) to TO Version (ZVERTO).
    Can someone give me the exact code for the same.
    Thanks
    Rashmi.

    DATA VF TYPE 0VERSION.
    DATA VT TYPE 0VERSION.
    DATA YF TYPE 0FISCYEAR.
    DATA YT TYPE 0FISCYEAR.
    DATA CY TYPE 0FISCYEAR.
    VF = VARV('ZVERFROM').
    VT = VARV('ZVERTO').
    YF = VARV('ZYRFROM').
    YT = VARV('ZYRTO').
    CY = VARV('ZCURRYR').  "Create a variable in BeX to give the current fiscal year from sy-datum and read this variable value here
    "You can call a function module also to get the current fiscal year instead of creating an exit variable
    IF YT < CY.
    {0Amount,100,YT} = {0Amount,VF,YF}.  "Copying FROM version, FROM the year chosen to version 100 and TO year
    ELSE.
    {0Amount,VT,YT} = {0Amount,VF,YF}.   "Copying FROM version, FROM the year chosen to TO version and TO year
    ENDIF.

  • 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

  • Enabling the Export function for a distribution list in 'Private folders'

    Dears,
    Could someone please guide to the appropriate authorization that would allow the 'Export...' function for a distribution list created in a folder under 'Private folders' - Transaction : SBWP
    The option is dimmed, although the user used has the SAP_ALL profile.
    Thanks.
    Reda

    click file/publish settings/flash/actionscript settings and make sure frame 1 is set as the export frame.
    if that's already set, don't use test scene.

  • Can't activate the COMPARE function for object DNL_CUST_TVAST for Adapter

    Hello
    I've applier OSS note 866824 to enable the exchange of the sales area flag deletion. I had to do the initial download for the customizing object DNL_CUST_TVAST but it failed because the no intial load was permitted as the data distribution was active. So I've applied note 887696 to enable the intial load for this object : I've deleted the COMPARE function for this object with transaction R3AC3. I've done the initial load for this object and now I can't add the COMPARE function : the error message is enter linked bdoc type for synchronisation load. and I don't know what to do...
    if somebody can help me...
    thanks a lot

    Thanks for your tip but it does not work, I need to fill this field.
    I just have an answer from SAP support, this value COMPARE is relevant for loading data in CDB.
    there no sense to add the compare value for this object : the compare load can never be used for this object. It was a delivery error
    Edited by: Jerome Munier on Dec 5, 2008 7:13 PM

  • Error FOX function BW 7.4 on HANA SP5

    Dear Experts,
    We are now involved in the Testing for SAP BW on HANA 7.4 SP5 and we are getting some issue regarding with IP FOX functions.
    Everytime I execute a FOX function I get a dump as following:
    Syntax error in program "00O2TG6FIIX6XEWDCX9ORY8KV
    Error in the ABAP Application Program
    The current ABAP program "CL_RSPLFC_FORMULA=============CP" had to be
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    In include "00O2TG6FIIX6XEWDCX9ORY8KV               ", in line 148 of program
    "00O2TG6FIIX6XEWDCX9ORY8KV               ", the following syntax errors
    have occurred:
    Field "H0VE" is unknown. It is neither in one of the specified tables
    nor defined by a "DATA" statement. "DATA" statement.
    Error in the ABAP Application Program
    The current ABAP program "CL_RSPLFC_FORMULA=============CP" had to be
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    In include "00O2TG6FIIX6XEWBDZMPVJ68K               ", in line 175 of program
    "00O2TG6FIIX6XEWBDZMPVJ68K               ", the following syntax errors
    have occurred:
    The field "XT_MES" is unknown, but there is a field with the similar n
    ame "XT_MESG". "XT_MESG".
    I found a SAP note that match with this error, but is not relevant for SP5. Anyone of you have faced the same problem?
    1716329 - Planning function formula: Syntax error in generated program
    Thanks in advance
    Regards

    Hi Eduardo ,,
    We are facing one more standard code dump  in function module RSPLSF_FORMULA_PARSE line number 3915
    IF l_tabix > 1 OR ls_code-cline(2) <> '_F'.
    Ls_code-cline is type of string  but at run time which is getitng single char value "-".
    and comparing with two char fixed value "_F" so that it is getting dump as per my understaning.
    I serach for notes relted to this issue  but I didn't get any Note  .
    I think there should be a note for this isses can u sugget me any note related to this isssue .
    We are facing same probelm in BWX , BWT and BWP system ..
    Thanks in advance ...
    Regards,
    Srikumar Anamlaa

  • Partner function for sales contract

    Hi
    I have to extract Sales related data from SAP R/3 to BW.
    Facing issue if someone just changes partner function for Sales contract as they are not captured in any of the standard extractors.
    If there is change in partner function for Sales order then it gets captured in 11 vascl but if its for contract then it doesnt get capture.
    Any solution ?
    Regards,
    monika

    Hi ! Ivy
    I guess there is a option.
    Try this out. Use the menu path IMG> Sales & Distribution> Sales> Lists> Set updating of partner index
    In the resulting screen, click on 'New Entries' make entries 0 - for sales orders and 4 - for contracts as transaction group. Under the column 'partner function' ener the partner function for which you want the report and save your entries.
    Now when you go for executing your report, click on the push button 'Partner functions' ( Say in VA05) , you will have the option for selecting the new partner functions , select and execute your report.
    Provide your feedback.
    Regards,
    PATHIK

  • Is there a "where used" functionality for SEM variables?

    Hello everybody,
    I am about to do some major changes to a BPS application that i have built and have come to realize that it will be quite some work to go through the whole thing for the purpose of replacing some variables.
    Hence, is there a "where used" functionality for SEM variables somewhere out there?
    Greetings,
    Martin

    Hi Martin,
              Have not seen that functionality before,however I have used the same by creating my own reports.All the variables can be found in the UPC_VAR table.If you are looking for the use of the variables in fox code,use a wild card search with UPC_FORML table in the formula column for %'VARV'%.IF Searching for uses in the conditions field for planning functions , use the table UPC_OPTIOS, column variable.In my case i needed to search the foxcode for variable uses.
    Hope this helps to some extent.
    regs.

  • BI IP --- Planning function for File Upload

    Hai All,
    In BI IP , When I am trying to load the data (text file) by using Planning function for File Upload. I am getting an error message When I am clicking on Update .
    Error Message : Inconsistent input parameter (parameter: <unknown>, value <unknown>).
    In Text file I am using Tab Separation for each value
    Anyone help me out.
    Thanks,
    Bhima

    Hi Bhima
    Try one of these; it should work:
    1. If you are on SP 14 you would need to upgrade to SP 15. It would work fine
    2. If not, then -
         a] apply note 1070655 - Termination msg CL_RSPLFR_CONTROLLER =>GET_READ_WRITE_PROVIDS
         b] Apply Correction Instruction 566059 [i.e: in Object - CL_RSPLFR_CONTROLLER GET_READ_WRITE_PROVIDS,
    delete the block: l_r_alvl = cl_rspls_alvl=>factory( i_aggrlevel = p_infoprov ).
    and insert block - l_r_alvl = cl_rspls_alvl=>factory( i_aggrlevel = i_infoprov ).
    Goodluck
    Srikanth

  • Is there any functionality for AVERAGE in ALV, like do_sum, subtot?

    Hi Experts,
    In my_alv report, am doing sub/totals for prices, by using do_sum, subtot functions.........fine. But, I need to do/display the AVERAGE value for Discount % column?
    Is there any functionality for AVERAGE in ALV, like do_sum, subtot?
    thanq

    hi
    check these links out
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    regards
    vijay
    reward points if helpful

  • Crash on search function for HTML Help file (.chm) when connected to a Visual C++ application

    Crash on search function for HTML Help file (.chm) when
    connected to a Visual C++ application
    I use the RH_ShowHelp API command to connect a HTML Help file
    (.chm file generated by RoboHelp Word X 5) to my Visual C++
    application. My application is able to call up this HTML help file
    in context-sensitive mode and everything is working great in the
    Contents and Index panels EXCEPT when I click on List Topics (after
    I enter a KEYWORD for search) in the Search panel.
    I got an error that said “Unhandled exception in
    xxxx.exe.(HHCTRL.OCX):0xC00000FD: Stack overflow”
    I am able to execute this .chm file by itself and the search
    function works well in this case. I am using HHActiveX.dll that is
    created on 2/23/04. Is this the correct version?? Any advice what
    to do here??

    Hi agschin and welcome to the RH forums. The hhactivex.dll
    file is not used by the search function so you can rule that our.
    Have you tried recompiling and seeing if the problem still happens?
    You can also start the Bug Hunter feature in RH - View > Output
    View and then select the Bug Hunter button - and see if that throws
    up any clues.

  • How to Use the language function for assignment and validation

    Hi All,
    If anyone can explain me in details with example ,how to use the language function for assignments and validations?
    Thanks
    Arnab

    Hi Arnab,
    The expression is checked only for the current MDM session.
    If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
    Try connecting to the DM with the XYZ language.
    It should go to the if part rather than else.
    Hope it helps.
    Thanks,
    Minaz

  • Error "You cannot enter a partner function for output NEU"

    Hi Experts,
    I'm having these error "You cannot enter a partner function for output NEU" (message VN041) when I tried to assign a partner function (e.g OA)  in the conditions records for application "EV" (Purchase outline agreement). The system do not allow me to do this for any doc type (LP, LPA, MK, OA, etc). I'm using t-code NACE or MN08.
    I want to assign partner for key combination "Document Type". The conditions is already there but with no value, so I want to assign partner function "OA" or "VR".
    I already check all the configuration and looks fine. For example, define possible partner functions for output type "NEU" for application "EV" (Purc outline agree).
    Hope you can help me to find the problem.
    Thanks,
    Mairo.

    I have the error in NACE or using tcode MN08.
    As soon I executed those transaction the system shows the condition records created for varios Doc Type (e.g LP, LPA, MK, etc) but with no partner function assigned. For example:
    Doc. Type /  Name                     /             Funct  /   Partner     /            Medium  /  Date/time  /   Language
    LP        /       Scheduling Agreement     /  blank  / blank  /                                          2      /          3   /              EN
    LPA      /      Scheduling Agreement                              / blank    / blank   /                1        /       3         /        EN
    For example, I try to assign function "OA" for Doc. Type "LP", choose value from quickpick. Then when I press enter, the system give me the error "You cannot enter a partner function for output NEU", message no. VN041. Do not allow me to continue, so I have to leave this field blank, with no change.
    Thanks,

  • Down payment functionality for PO with account assignment K Cost Center

    QUESTION: Is there a way to turn-on down payment functionality for cost centers?
    When a vendor down payment is posted via tcode F-47 against a PO line item with INTERNAL ORDER as the account assignment, SAP posted the following documents from the payment run (tcode F110):
    1. Accounting Document
    dr  vendor / GL= downpymt clearing / internal order = IO1234 / cost center = CC5678
         cr  bank           
    2. Controlling Document
    dr internal order IO1234
    However, when a vendor down payment is posted against a PO line item with COST CENTER as the account assignment, SAP does not post any Controlling document, just the accounting document:
    dr  vendor / GL= downpymt clrg / cost center = CC5678
            cr bank
    From my research, it appears that the down payment functionality applies to internal orders and projects only. Then settlement is run to move the values from internal order to AUC assets and/or cost centers. Perhaps I'm missing a configuration step for the cost center piece?
    Your prompt response will be much appreciated. Thanks in advance!

    system wont generate any controlling document for noted items  downpayment and normal payments.
    Because all are balance sheet accounts. Controlling documents will generated for only P&L accounts.
    Your analysis correct.

  • How do I delete documents from my iPad that were added when it ran regular Acrobat, now that it has switched to DC?  The docs are not on the cloud, and DC does not seem to have a delete function for non-cloud docs.

    I use an iPad.  It automatically switched me from old-fashioned Acrobat to DC.  How do I delete docs that were put on my iPad with the old Acrobat?  They are not in the cloud, and DC does not seem to have a delete function for them.

    Hi,
    By default, Acrobat DC for iOS displays recently viewed files.  You need to switch to other file location (such as Local, Document Cloud, Creative Cloud) to delete, rename, move, or duplicate files.
    You can switch to Local, if you would like to see the files and folders that are locally stored on your iPad.
    Would you take a look at the following document to see how you can switch to other file location and delete files?
    How to manage files in Acrobat DC for iOS
    Please let us know if you have additional questions.  Thank you.

Maybe you are looking for