Sentence Vari on fox formulas 2004s

Hi Gurus !!  I need some help on an error for my code.
I have a fox formula that it works on 3.5 version but it doesn´t on 2004s.
The error message is " Error en función VARI acceso con offset 2 cantidad de valores 1 "  It means that the VARI sentence is on error with the offset 2, and the same for the rest of the offset. I`m trying to do this :
DECLARACION VARIABLES
DATA V_MONTO TYPE F.
DATA COUNT TYPE I.
DATA V_PER TYPE 0FISCPER3.
DATA V_YEAR TYPE 0FISCYEAR.
DATA V_FISCPER TYPE 0FISCPER.
*ASIGNACION VALOR VARIABLES
V_YEAR = VARV(VYEAR1).
V_MONTO = VARV(VAR_MONTOANUAL).
V_MONTO = V_MONTO/12.
COUNT=1.
DO.
V_PER = VARI(VPER,COUNT).
V_FISCPER=CONCAT(V_YEAR,V_PER).
{0AMOUNT,V_FISCPER, V_PER,V_YEAR} = V_MONTO.
COUNT = COUNT + 1.
IF COUNT = 13.
  EXIT.
ENDIF.
ENDDO.
Any Clues ??
Thanks in advance !!
Natalia.

I already solution it.

Similar Messages

  • Using variable in fox formula containing several characteristics

    Hi @all,
    is it possible to use a variable in fox containing more than one characteristic? I need to have some additional information for a few 0SEM_POSITs but don't want to create an attribute.
    I've created variable ZSCV25 containing characteristics 0SEM_POSIT and ZSCADVDEL but wasn't able to get any data by using VARI.
    Anybody an idea? Thanks for your help.
    Regards,
    Thomas

    <FONT FACE = "Tahoma", Font Color = "Blue">
    Dear Thomas<br>
    I don't think FOX Formula Variable can contain more than one characteristic value. <br><br>However I can suggest you to try one thing. Create an Exit Variable and in its ABAP Code refer to the master data table of base variable and retrieve the value of its desired attribute. <br><br>For example, let us assume that you have a characteristic 0COMP_CODE and 0COUNTRY is its attribute. Now you want that depending on the value of 0COMP_CODE selected by User in another variable ZCOMP_CODE , 0COUNTRY should be automatically populated in variable ZCOUNTRY. So in this case, please make ZCOUNTRY as an Exit Variable and write ABAP Code for that. In the ABAP Code, get the value of 0COMP_CODE which is entered by User in the other variable ZCOMP_CODE. Then write a select statement in ABAP and retrieve the value of 0COUNTRY from the master data table of 0COMP_CODE where Company Code value is equal to value of variable ZCOMP_CODE.<br>
    I hope I am getting you and you are getting me :-)<br>
    <br>Please let me know in case of any confusion.
    <br><br>
    Hope it helps.<br><br>
    Cheers Abhijit<br>
    </FONT><FONT FACE = "Verdana", Font Color = "Red">
    Removed
    </FONT>

  • Message in fox formula

    Hi,
    I have a fox formula, I write a red message code
    MM = VARI(ZVALID, 1).
    IF MM <> #.
    MESSAGE E001(ZBW).
    ELSE.
    if the variable A has not the value # send the message.
    That works fine, but the message appears by each subset,  and also appear other messages in green/yellow color.
    how can I write the code to send only one red message, and not one message by each subset or green/yellow messages?
    Regards
    Victoria

    Hi Victoria,
    to show this message only one time it is needful to put all characteristics of your planning level in the fields to be changed of the corresponding planning function. This means, that the system will generate only one data-package including all data of your planning-level-selection and now the fox-coding is called only <b>one</b> time !
    In GUI it is not so easy to suppress the green and yellow system-SAP-messages, in the Web-Interface-Builder you can supress all messages with a special method.
    Bye Gil

  • Variables in FOX formulas in IP

    Hi All!
    I would like to create FOX planning function that will be based on variables.
    So, we have 2 variables AA and BB based on characteristics:
    1. For 0CALMONTH with tech. name AA
    2. For ZPROJECT with tech, name BB
    I have a query, where at the first screen I make a selection for ready-for-input variables AA and BB. Then, at the second screen I execute planning function via button.
    The sense of PF is copy all values of key figure ZKEYFIGURE from ZPROJECT = '0', 0CALMONTH = selected value of variable AA to ZKEYFIGURE of ZPROJECT = selected value of variable BB, 0CALMONTH = selected value of variable AA.
    In master data of characteristic ZPROJECT we have different projects. but 1 is with technical name 0. This is the first master data in table.
    DATA VAR1 TYPE 0CALMONTH.
    DATA VAR2 TYPE ZPROJECT.
    DATA VAR3 TYPE ZPROJECT.
    VAR1= VARV(AA).
    VAR2 = VARV(BB).
    VAR3 = VARI(BB, 1).
    {ZKEYFIGURE, VAR1,VAR2}={ZKEYFIGURE,VAR1,VAR3}.
    After execution I see , that records were read, but 0 generated, 0 changed.
    Maybe someone can advice what I do wrong?

    Firstly,for 0calmonth,the from and to value is same as you are using the selected values of variable AA.
    So no change in the value of 0CALMONTH
    Secondly, in the fox formula,  for zproject, you are using the same variables. Hence the fox formula understands that there is no change in the value.
    Define two variables for zproject, lets say proj1 and proj2.
    Assign proj1 ='0'.
    I have modified your fox code, give a shot with the following code, hopefully you might get the results as you want.
    DATA VAR1 TYPE 0CALMONTH.
    DATA PROJ1 TYPE ZPROJECT.
    DATA PROJ2 TYPE ZPROJECT.
    VAR1= VARV(AA).
    PROJ1 = 0.
    FOR EACH 0CALMONTH IN VARIABLE VAR1.
    PROJ2 = VARI(BB,1).
    {ZKEYFIGURE, PROJ2}={ZKEYFIGURE,PROJ1}.
    Endfor.

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

  • Variable used in FOx formula should get value from user

    Hi Gurus,
    In my fox formula I want to multiply a keyfigure (say quantity) with a factor. For example if the factor is 10 then all records should get multiplied by 10.
    But the requirement is user shpuld be able to give the factor that should be multiplied. That is the l_factor used in the fox function should be a variable which gets value from user. I know we can give variables in filter and planning functions in IP. But can we give values in Fox formula.
    I would really appreciate the time and effort.
    Thanking you,
    Jerry Jerome

    Hello,
    May be you can try this solution.
    I think you have create a dummy character info-object(Z_Number) of same data type interget number.Create variable for Z_Number and restrict in filter(ZV_NUM).
    DATA Z_MAT TYPE 0Material.
    DATA Z_NUM TYPE Z_NUMBER.
    DATA Z_NUM_READ TYPE I.(Declate same as data type for Z_Number)
    Z_NUM = VARV(ZV_NUM).
    FORACH Z_MAT.
    Z_NUM_READ = Z_NUM.
    {Z_KF1,Z_MAT} = Z_NUM_READ * {Z_KF1,Z_MAT}.
    ENDFOR.

  • How to change the variable value in fox formula?

    Hi All,
        Please help me achieve this scenario,
             in the variable selection screen , i wil give some i/p like, calyear(0calyear) = 2008.
          In planing function using FOX formula, i must be able change the variable value to 2009.
      Will it be possible to achieve this, can we change a variable value using FOX formula, if possible
    please let me knw how to achieve this.
    Thanks n Regards,
    Priya.

    Hi Priyadarshini,
    i dont know what is your requirement exactly.If you can give a better explanation of ur requirement we can help you. But to answer your question yes we can get new values for the variable in the planning function.
    for this you need to couple the planning function together with the planning filter in a planning sequence. This planning filter should have the variable that you wanted to change. In the WAD when you want to call this planning sequence there is an option to call variable screen. If you enable this, it will pop up the variable screen to get this value again.
    Guess this was helpful.
    Regards.
    Shafi.

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

  • Set global variable in FOX formula

    Hi all,
    Does anybody know how to change the value of a global variable inside a FOX formula?.
    I can get its value and assign to a local variable but I would like to set the global value after reading a keyfigure and make some calculations.
    is it possible? maybe with some ABAP function call?
    Thanks for your help!

    Include characteristic HIRE in your 'fields to be changed' of planning function and in FOX write:
    DATA L_HIRE TYPE HIRE.
    DATA EXISTBPSID TYPE ZTA_BPSID.
    DATA BPSIDNO TYPE ZTA_BPSID.
    BPSIDNO = VARV(BPSTAS2).
    FOREACH L_HIRE.
    IF EXISTBPSID = '#'.
    {L_HIRE,BPSIDNO} = {L_HIRE,EXISTBPSID}.
    BPSIDNO = BPSIDNO + 0000000001.
    ENDIF.
    ENDFOR.

  • Problem with Nested loop in Fox-Formula

    Dear Experts,
    Let s share the scenario :
    MaterialGroups with following Keys for Example AAAA, BBBB, CCCC..., Materialgroups are selected in the 1st input ready query, which is assigned to DataProvider DP_1 in a  webtemplate.
    every Materialgroup has several Materials, for instance:
    Materialgroup AAAA has following Materials: AAAA10, AAAA11, AAAA12, AAAA13...
    Materials are  selected in a second  input ready Query, which is assigned to a second DataProvider DP_2 in the Same Webtemplate as the query 1.
    Both Materialgroup and Material are based on the same Aggreagtion level and same real time cube.
    I want to copy the input values for every  MaterialGroup ( 1st query, DP_1) only to it s own Materials (2cond Query, DP_2).
    To resolve this Issue i wrote the following Fox Formula code with a nested loop, however it does not work properly. when I m debugging the code, i could release that the second Loop was ignored.but wehn i replace the second loop (nested loop) with a fixed value it s seems to work properly
    DATA MG1 TYPE MATG.<------ MaterialGroup
    DATA MT1 TYPE MAT.<----
    Material
    DATA S1 TYPE STRING.
    DATA S2 TYPE STRING.
    DATA S3 TYPE STRING
    DATA K TYPE F.
    DATA Z TYPE F.
    FOREACH MG1.
    To check Materialgroup in debugger
    S1= MG1.
    BREAK-POINT.
    K = {KEYfIG, #, MG1}.
    BREAK-POINT.
    FOREACH  MT1.   <----- if i set MT1 to a fixed value like AAAA11 then S3 get the wished value namely AAAA
    S2 = MT1.
    BREAK-POINT.
    S3 =  SUBSTR (MT1, 0, 4).  
    BREAK-POINT.
    IF S1 = S3.
    {KEYFIG, MT1, #} = K.
    following Statement is only used To check in debugger if Material has become the same Materialgroup value
    Z = {KEYFIG, MT1, #}.
    BREAK-POINT.
    ENDIF.
    ENDFOR.
    ENDFOR.
    Thakns for any help
    Frank
    Edited by: FRYYYBM on Mar 17, 2011 10:54 PM
    Edited by: FRYYYBM on Mar 17, 2011 11:06 PM

    Hi,
    Please try this way.
    DATA MG1 TYPE MATG.<------ MaterialGroup
    DATA MT1 TYPE MAT.<----
    Material
    DATA S1 TYPE STRING.
    DATA S2 TYPE STRING.
    DATA S3 TYPE STRING
    DATA K TYPE F.
    DATA Z TYPE F.
    FOREACH MT1.
    FOREACH MG1.
    To check Materialgroup in debugger
    S1= MG1.
    BREAK-POINT.
    K = {KEYfIG, #, MG1}.
    BREAK-POINT.
    FOREACH MT1. <----- if i set MT1 to a fixed value like AAAA11 then S3 get the wished value namely AAAA
    S2 = MT1.
    BREAK-POINT.
    S3 = SUBSTR (MT1, 0, 4).
    BREAK-POINT.
    IF S1 = S3.
    {KEYFIG, MT1, #} = K.
    following Statement is only used To check in debugger if Material has become the same Materialgroup value
    Z = {KEYFIG, MT1, #}.
    BREAK-POINT.
    ENDIF.
    ENDFOR.
    ENDFOR.
    ENDFOR.
    Thanks.
    With regards,
    Anand Kumar

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

  • How to convert a string from upper case to lower case in FOX formula

    Hi Experts,
    How to convert a string from upper case to lower case in FOX formula?
    Thanks,
    Cheers!!!
    PANKAJ

    The last result.append( c ) should be:
    result.append( Character.toLowerCase(c) );

  • Using BPS numberic variables in the FOX formula???

    Hi all,
    Can someone tell me how to use one variable (<b>the variable type is 'numberic'</b>) in the FOX formula? Thank you.
    FOX formula example:
    <b>Inventory $= inventory unit * inventory (per unit) * depreciation monthS (<u>this is a numberic variable</u>.</b>
    J.

    Hi John,
       You can use the VARV function to get the value of the numeric variable in FOX.
       Lets say your variable for depreciation months is ZDEPMTS.In your FOX, you
       can say: Inventory $= inventory unit * inventory (per unit) * VARV(ZDEPMTS).
       Hope this helps.
    Cheers
    Srini

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

Maybe you are looking for

  • With Firefox 22, whenever I turn on computer after hibernation Firefox crashes. Why and how do I fix this? I cannot find this exact problem on your site.

    When I am done with my computer I close the lid which sends it into hibernation. Usually I have 2-3 windows open with 3-10 tabs each. There has never been a problem until I upgraded to version 22. Now whenever I start the computer the windows will co

  • Live Paint Bucket in CS5

    Using Illustrator on a Windows box running XP sp3 with an Intuos 2 I've been using Illustrator CS2 for awhile and have upgraded to CS5.  I need some help with a problem I'm experiencing with the Live Paint Bucket.    I select the illustration, go to

  • Profile picture changing

    In address book, if i put a new profile picture for a contact, it works. But then after a few days it changes back to the pic that the contact has on their computer. In this case, it's my brother. He has a mac too. so i think that mail is recognizing

  • Help in buying PowerShot camera

    Hi I need help to buy a compact digital camera with high quality stills and full HD video recording capabilities. I found the following models: G15, S110, SX280 HS, SX260 HS. which one should I choose? which one is better? Best Regards, Barak Shimoni

  • Adobe Audition CC doesn't recognize VST plugins.

    Hello there,      I've been searching and searching through countless blogs and YouTube videos online but I have yet to find an answer to my question. I plan to use VST in the near future and have been downloading a few sample VST plugins. To answer