HOW TO USE ATTRIBUTE VALUE IN FOX FORMULA LOOP

HI,
IAM SUMMING UP AMOUNT BASED ON BELOW COMBINATION AND THROWING MESSAGE IF AMOUNT IS EXCEEDING OPENPO VALUE....AND IS WORKING FINE...NOW I HAVE A ENHANCE MENT THAT I HAVE TO USE ATTRIBUTE PROFIT CENTER VALUE IN THE LOOP. I HAVE DECLARED THIS --- PC = ATRV('0PROFIT_CTR',CC,CA). AND TRY TO USE PC IN LOOP..BUT SYSTEM PROPOSING PC SHOULD BE FIELD TO BE CHANGED..BUT IN MY CASE IT IS ATTRIBUTE WHICH WILL DISPLAY IN LAYOUT...AND FIRST LOOP SHOULD HAPPEN BASED ON PC ( FOREACH CCODE,FP,CR,CA,GL,PO,PC.)....PLEASE PROVIDE UR HELP.
DATA SUM1 TYPE F.
DATA SUM TYPE F.
DATA PO TYPE EBELN1.
DATA GL TYPE 0GL_ACCOUNT.
DATA CC TYPE 0COSTCENTER.
DATA VN TYPE 0VENDOR.
DATA SN TYPE SCRNUM1.
DATA SD TYPE SCRDATE.
DATA VS TYPE KDATB.
DATA VE TYPE KDATE.
DATA CCODE TYPE 0COMP_CODE.
DATA CA TYPE 0CO_AREA.
DATA FP TYPE 0FISCPER.
DATA CR TYPE XPRV_CIR.
DATA PC TYPE 0PROFIT_CTR.
CCODE = VARV('XCOMPCO').
CA = VARV('XCOAREA').
FP = VARV('XPERIOD').
CR = VARV('XPRVCIRC').
PC = ATRV('0PROFIT_CTR',CC,CA).
FOREACH CCODE,FP,CR,CA,GL,PO,PC.
SUM = 0.
FOREACH CC,VN,SN,SD,VS,VE.
IF {0AMOUNT,CCODE,CC,CA,FP,GL,PC,VN,PO,VS,VE,SD,SN,CR}
{OPENPOVAL,CCODE,CC,CA,FP,GL,PC,VN,PO,VS,VE,SD,SN,CR}.MESSAGE E001(UPF)WITH
'PROVISION AMOUNT SHOULD BE LESS THAN OPENPOVALUE'.
ELSE.
SUM = SUM +
{0AMOUNT,CCODE,CC,CA,FP,GL,PC,VN,PO,VS,VE,SD,SN,CR}.
ENDIF.
ENDFOR.
FOREACH CC,VN,SN,SD,VS,VE.
IF {0AMOUNT,CCODE,CC,CA,FP,GL,PC,VN,PO,VS,VE,SD,SN,CR} = 0
AND
{OPENPOVAL,CCODE,CC,CA,FP,GL,PC,VN,PO,VS,VE,SD,SN,CR} = 0.
SUM1 = 0.
ELSE.
SUM1 = SUM.
ENDIF.
IF SUM1 >
{OPENPOVAL,CCODE,CC,CA,FP,GL,PC,VN,PO,VS,VE,SD,SN,CR}.
MESSAGE E001(UPF)WITH
'PROVISION AMOUNT(SUM) SHOULD BE LESS THAN OPENPOVALUE'.
ENDIF.
ENDFOR.
ENDFOR.
THANKS,
RAJA

Hi,
If you want to read the value of profit center using keyword ATRV then you need to input values of parameters CC and CA.
Now the first line that you have written, to derive PC based on CC and CA
PC = ATRV('0PROFIT_CTR',CC,CA).
[code}
here CC value is not determined at runtime ; I mean what will be the value of CC when this line is executed. This line is not inside any foreach loop nor you are reading the value of CC using any variable.
if you want to use PC in first FOREACH CCODE,FP,CR,CA,GL,PO,PC. loop then CC value have to be  present.
Put ATRV code inside a loop where CC and CA values are read.
Thanks
Pratyush

Similar Messages

  • How to use cumulative Value in a formula

    Hello Gurus,
    I would like to use the cumulative value in a query as part of a formula calculation. I have created a KF which is assigned a constant value 1. When displaying the KF I am cumulating it so for each row I am getting 1,2,3,4...etc. How can I use this cumulated value in a formula calculation?
    For example, in a column cumulative count is 1,2,3,4...etc .My requirement is ,i want to identify the record with number 36 , to do this i have created a formula with boolean Equal to function comparing with the required number, but the boolean result what am i getting is Zero instead of one(1).
    The reason i found behind the problem is, the cumulative count that we see is dynamically happening during the run time for display ,but the internal value is 1 only.
    Is there any other way to meet this requirement or am i missing anypoint?.
    Thanks.

    Dear Yaseen,
                To get the value in formula cumulative,after you have created the formula for that particular key figure,go to edit and click on tab "calculations".
    In that select overall result as 'count all values not equal to zero' and single result as 'count all values not equal to zero' .
    And mark the cumulative check box underneath.
    I hope you get the desired result and please do me favour .
    Sumit goomber

  • How to use rounded values in BEx Formulas

    Hello,
    I have the following question. Is it possible to use rounded values up to a certain # of decimal points in BEx Formulas?
    I have the following problem.
    Consider this:
    keyfigure val 1 = 0.416666667
    keyfigure val 2 = 72
    val 3 (BEx Formula)  = val 2 / val 1 = 172.799999862
    However, what I need to do is this.
    val 1 & val 3 should rounded up to 2 decimal points. So, I really need the report to show this:
    val1 = 0.42
    val2 - 72
    val 3 = val 2 /val 1 = 171.43
    I changed the number of decimal places on val 1 and val3 to be 0.00. However, it appears that these rounded values are not taken into account in  the Formulas, as if the OLAP still uses the original values from the backend with 9 decimal points. So, no matter how many decimal points I use on the Display tab for a key figure, my val3 or result of my formula is always taking into account the 9 digit decimal values, not rounded values that I want. So in the example above, my val 3 comes to 172.80, which it should be 171.43 instead of you use the rounded values in the calculation.
    Please let me know if there is any workaround where I could force my BEx Formula to utilize the rounded values and not actual values from the backend DSO. Or any other solution.
    Thank you

    If you create a Formula in BEx Query Designer like the one below, it works:
    val3 = val2 / ( TRUNC ( ( val1 * 100 + 0.5 ) ) / 100 )
    The TRUNC function (among other things) actually ensures that your formula takes into account the rounded values that you want.

  • How to get attribute value from standard page ?

    Hi,
    How to get attribute value from standard page ?
    String str = (String)vo.getCurrentRow().getAttrbute("RunId");
    But this value is returning a null value ....
    Can anyone help me to get this attribute value which is actually having a actual value .

    getCurrentRow() would always return null if no setCurrentRow() is used.
    Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
    vo.reset();
    vo.next();
    Regards
    Sumit

  • How to use Special value set with Column clause to display addtional column

    hi
    can anyone tell me
    How to use Special value set with Column clause to display addtional column
    how can i use FND POPID and with COLUMN clause ?

    Dear Yaseen,
                To get the value in formula cumulative,after you have created the formula for that particular key figure,go to edit and click on tab "calculations".
    In that select overall result as 'count all values not equal to zero' and single result as 'count all values not equal to zero' .
    And mark the cumulative check box underneath.
    I hope you get the desired result and please do me favour .
    Sumit goomber

  • Reposting:urgent....how to use hashtable values

    Hi
    if i get all lovsession results in to a hash table
    how to use them
    i mean how to use the value of particular field in hash table(lov ).
    is it <hashtable>.get(object name);
    if it is what should be my object name...is it VO attribute of LOV???or the Id in that lov page??
    please help me out..
    Regards
    Sandeep.G

    if(pageContext.isLovEvent())
    String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM);
    Hashtable lovResults = pageContext.getLovResultsFromSession(lovInputSourceId);
    if (lovResults != null)
    value = (String) lovResults.get("<Lov Item Name>");
    }

  • How to use Table valued MSSQL  function in OBIEE

    Hi all,
    Can some one help me to understand how to use table valued function in OBIEE? I want to use a table valued function (MSSQL function, with some input parameter), in the physical layer to pull the data?
    I know for MSSQL Stored Procedure we can write as
    EXEC SP_NAME @Parameter = 'VLUEOF(NQ_SESSION.Variablename)'
    but now I have a table valued function in the query window I can get the data as
    select * from myfunction(parametervalue)
    In physical layer of OBIEE I have tried as
    select * from myfunction('VLUEOF(NQ_SESSION.Variablename)'), but I'm getting error as the NQ_SESSION variable doesn't have a value , but actually I have initialized the variable but still Im getting error.
    Can some one help me to solve this.
    Thanks,
    Mithun

    Follow this link and try yourself. let me know for issues
    Substring instr issue in obiee
    Appreciate if you mark
    Edited by: Srini VEERAVALLI on Feb 20, 2013 8:13 AM

  • How to use attributes in variable substitution???:(

    Hi all,
    Could you please help me out in how to use attributes in variable substitution....
    Regards,
    Sundar

    Hi,
    Use Adapter Specific Identifiers , instead of Variable Name substitution.
    Sender File adapter --> Adapter Specific Attributes --> Select File Name
    Reciver File Adapter -->Adapter Specific Attributes --> Select File Name
    In the mapping , use this code in an UDF to change the filename to what you want,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String filename="YOURFILENAME";
    String rSourceFileName = conf.put(key,filename);
    Regards,
    Bhavesh

  • How to use hashtable values

    if i get all lovsession results in to a hash table
    how to use them
    i mean how to use the value of particular field in hash table(lov ).

    I'm not clear what exactly are you looking for? Is it just the printing/reading of values in hashtable or some interaction of those values with beans?
    --Shiv                                                                                                                                                                                                                                                                                                                               

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

  • How to use DFF value in BG_ABSENCE_DURATION Fast formula

    Hi All,
    I would like to know how can we use DFF values in BG_ABSENCE_DURATION fast formula.
    Can we pass them as input values?
    Also, when we use them as DATABASE ITEMS how does Fast Formula identifies them.
    For example I have created a DFF value HALF_DAY that can take either "YES" nor "NO".
    I tried to use that as input value but that didnt work, not sure if it is possible at all or not.
    I also tried to use that as Data Base ITEM, as follows:-
    IF (ABSENCES_HALF_DAY WAS DEFAULTED ) then
    duration = 'FAILED'
    invalid_msg = 'DFF not working'
    Any help will be much appreciated.
    Thanks,
    Avinash
    but i am getting following error when i access SSHR
    Formula BG_ABSENCE_DURATION: ORA-01403: no data found ORA-01403: no data found Cause: During the PL/SQL execution part, an Oracle error was detected. Action: Please refer to your system administrator.

    Thanks Vigneswar  and Avaneesh for your helpful comments,
    Actually I want to retrive the DFF value that I pass while applying the Leave Request and not that already stored in the data base. I checked and found that the query you have mentioned is retriving the data from base tables.
    select target.ATTRIBUTE6 -- Attrinute6 is database item ABSENCES_HALF_DAY+
    from    per_absence_attendances                target,+
    per_all_assignments_f                  ASSIGN+
    WHERE   sysdate BETWEEN ASSIGN.effective_start_date+
    AND ASSIGN.effective_end_date+
    AND    ASSIGN.assignment_id                  = 647--&B2+
    AND    ASSIGN.assignment_type                = 'E'+
    AND    target.person_id                      = ASSIGN.person_id+
    AND    target.absence_attendance_id  =+
    *(select max (absence_attendance_id)*
    from   per_absence_attendances+
    where  person_id   =  ASSIGN.person_id+
    and    date_start <=  sysdate+
    I have only added folloing lines In my BG_ABSENCE_DURATION FF
    DEFAULT FOR ABSENCES_HALF_DAY is 'XX'+
    if (1 = 1) then+
    duration = 'FAILED'+
    invalid_msg = 'DFF not working: '+ABSENCES_HALF_DAY+
    But evry time output is *"DFF not working : Yes"* no matter what the value I am passing while applying leave. This value "Yes" is stored in DFF attribute 6 for the test employee and I guess FF is retriving this value from DATABSE not from current transaction.
    Could you please help how to retrive run time data.
    Thanks,
    Avinash

  • 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 realize special scenario with FOX formula - FOREACH, variables

    Hello,
    we want to use the integrated planning for the following thing within the portal:
    A salesman should add manual values (planned turnover) for his top 10 customers. The rest of his yearly budget should be distributed automatically and equally to the rest of his customers.
    I thought a lot about it and arrived at the conclusion that:
    - we have somehow to put the salesman number into a variable maybe also the year for which the planning should be done -- Which possibilities are given to do this?
    - We need an additional flag that tells if this customer has to be planned / was planned manually.
    After the manual planning a planning function (FOX formula) has to be executed in order to
    1. get the budget that was already planned manually
        use of FOREACH in combination with an IF clause
        -- Which kind of FOREACH do I have to use?
    2. calculated total budget - manual planned budget = budget that has to be distributed
        after FOREACH
    3. count on how many customers the distribution has to be done and calculate the
        turnover per customer (rest budget / counted customers)
        use of another FOREACH loop which counts every value that hasn't got the flag set
    4. distribute the remaining budget on the customers that weren't planned manually
        -- Can it be done with something like turnover=value that should be assigned ?
    Maybe it's simple to realize this scenario but I'm a absolute "newbie" on that theme.
    Thanks
    Bettina

    Hi,
    I have been following this thread for quite long, here's my take on this
    1. Please create all the master data like sales man, customers in BI. for the key customers  add an attribute to key customer which can be a single character field.
    2. Add Sales man as an attribute to customer master and maintain values for each customer.
    3. Create an exit variable for customer number, this should read value from the sales man variable and populate all the key customers.
    4. Create an agg level with the above 2 and the required time characteristic. There will be 3 variables on the input ready query a. sales man number b. key customer exit variable c. some time period variable.
    5. Create a planning function of type generate combination for the agg level created in the above step. Add this function to the work book or the web template.
    6. Now salesman will be able to go in and create his budget for the key customers.
    Annual budget entry
    1. Create an agg level without customer, add salesman and time characteristics.
    2. create a query which will allow to enter data (yearly budget) for the salesman.
    Allocation to non key customers
    1. Create an agg level that should create the missing combinations sales man and non key customers. If designed properly the first agg level can also be used for this function.
    2. Create a fox function which with foreach loop for customer and sales man if the amount is 0 add 1 to counter, also read the value wtih customer as blank (yearly budget), lastly if the amount is not blank sum up the amount. This will help in getting the balance amount.
    3. get balance figure as total - allocated. One more foreach loop same as above if the amount is blank then amount = balance / counter.
    Tried to answer
    thanks

  • How to use user variable in Member Formula

    Hi All
    I have to write a member formula for %linearity quarter for a weekly application.This member will be used in reports and we do not want to do this calculation in reports, hence need to write member formula. The formula is
    Week1 of Q1 forecast / Q1 Total Forecast , Week2 of Q1 Forecast/ Q1 Forecast.............,Week15 of Q2 forecast/ Q2Total Forecast.......and so on.
    According to me it should work in the below mentioned manner , but need help in improvising the formula.
    If(@ismbr("Weeks1") or @ismbr("Weeks2") or @ismbr("Weeks3") or @ismbr("Weeks4") or @ismbr("Weeks5") or @ismbr("Weeks6") or @ismbr("Weeks7") or @ismbr("Weeks8") or @ismbr("Weeks9") or @ismbr("Weeks10") or @ismbr("Weeks11") or @ismbr("Weeks12") or @ismbr("Weeks13") or @ismbr("Weeks14") )
    "Current_Forecast"/"Q1"->"Current_Forecast";......
    If anybody can help in suggesting how can i use user variable in this formula to achieve the required result.
    Thanks

    Hi
    Thanks for the suggestion and it would be a better idea to use ISIDESC as compared to ISMBR.
    I also wanted to ask if in the below mentioned formula if the result of first line is true than will the second line pick the current_forecast value of the respective member of Q1 and divide it by the current_forecast value of Q1.
    IF(@ISIDESC("Q1"))
    "Current_Forecast"/"Q1"->"Current_Forecast";
    Also i need to know how can i write a member formula for week YOY% using user variables.The general formula is
    Week 1 of FY13 - Week 1 of FY12/Weeks 1 of FY12
    Week 2 of FY13 - Week 2 of FY12/Weeks 2 of FY13 and so on till week 53.
    Thanks

  • How to use Default value in a column in Tabular form in insertion or upda

    Hello,
    I am trying to use Default values so that user need not have to enter data, but when I select default type and put a default value, I see an error message, if I try to add a new row.
    How can I use a default value in a Column in a Tabular Form?
    Gouri
    Edited by: user1046395 on Apr 3, 2009 9:58 AM

    Gouri,
    You can just simply edit to each column's report attribute. For example,
    To set default date,
    Default Type: PL/SQL Expression of Function
    Default: sysdate
    To set default text,
    Default Type: PL/SQL Expression of Function
    Default: *'CLERK'*
    If you still have an error, what is the error message?
    Ittichai

Maybe you are looking for

  • IPOD Mini is not recognized by my PC

    Help! I can't restore/update my Ipod Mini because my PC won't recognize it. When I reset the Ipod I get a folder/! or an Apple symbol - nothing more. The computer seems to be able to charge the Ipod, but doesn't recognize it - doesn't start Itunes, s

  • Bizarre X behaviour after boot

    Hello, I've recently done a fresh install on a new desktop, encrypted root with btrfs. I've installed minimal packages: base base-devel, xorg-server, xorg-xinit, xf86-video-nouveau, xf86-input-evdev, awesome, firefox and urxvt. Everything boots up fi

  • Using logic as host application for omnisphere

    Hey i am kind of new at using plug ins with programs like logic. I just can't figure out how to use set up logic as the host for omnisphere. If someone could help me out that would me much appreciated. Thanks.

  • ABRIR PDF DESDE INTERNET EXPLORER

    HOLA TENGO UN PC CON WINDOWS XP HOME EDITION, INTERNET EXPLORER 6 Y ADOBE ACROBAT 7 Y AL INTENTAR ABRIR UN DOCUMENTO PDF DESDE EL EXPLORER, EL SISTEMA ABRE UNA VENTANA DE ADOBE Y LA CIERRA AL INSTANTE. NECESITARÍA SABER QUE PUEDO HACER PARA SOLUCIONA

  • RAC and DNS balancing

    Hello. I'm interested in DNS-level load-balancing for Oracle RAC. Would clients work in the same way, if host1-vip resolves to address A, host2-vip - to address B and host resolves to both addresses A and B and we specify in tnsnames.ora: RAC = (DESC